Jump to content

[SOLVED] Problem with ship trail and ocean waves


photo

Recommended Posts

I want to use a particle system to represent a ship trail, but, as you can see in the attached screenshot, the trail disappears beneath the waves when the sea is not flat.

post-59-0-91455400-1359546885_thumb.jpg

To have the possibility to project particles on the water object would be perfect (as suggestion), but I'll be happy if there is any way render particles over the water object (but not over other elements)

Link to comment

We have the same problem, though for us it is more noticeable as our wave heights need to be higher. It is on our list of problems to deal with, so any help here would be appreciated also.

 

I would guess that we would need to make an expression that altered the height of the 'flat' particles and modified their z height (with a small offset) for their lifetime.

 

Ivan, are you using 'ROUTE' or 'FLAT' particle type?

Link to comment

The key problem is: particles are not decals, so they will never align smoothly with the wave surface. Even standard decals would not solve the problem as the decal mesh geometry would have to be dynamically adopted each frame according to the wave motion. Therefore for realistic foam trail decals on a water surface with 'real' waves some specialized decal approach/object will be required.

 

We realized these effects in a different engine via per-frame pre-rendering of all foam decals to a texture which then was projected per-pixel onto the water surface itself within the water mesh fragment-shader.

Link to comment

Thanks for the insightful, more correct and clever suggestion Ulf.

 

Though 'pretty', Unigine's water has many flaws and is too limited at the moment to warrant an investment just for the ship trails.

 

We have many work arounds to make anything go with waves at the moment, so we would be ok with one more dodgey solution to 'fake' the ship trails.

 

Is there a way to affect the spawned particles like we do the nodes?

 

Node node = getNode();

Node parent = engine.world.getNode(2058937570);

 

if(parent != 0 && parent.getType() == NODE_OBJECT_WATER) {

ObjectWater water = class_cast(parent.getTypeName(),parent);

forloop(int i = 0; node.getNumChilds()) {

Node child = node.getChild(i);

vec3 p = child.getWorldPosition();

p.z -= water.getHeight(p);

child.setWorldPosition(p);

}

}

 

We can get/set the normal from the wave and set a small offest as well.

Link to comment

Don't think so. No direct access to particles and also you will have artifacts when they grow in size due to their planar nature. In UNIGINE OilRush the particle foam effects work as they use a flat ocean without big waves.

For realistic foam trails on wavy ocean surface I am quite sure that you need a specialized solution from UNIGINE crew as described above.

Maybe frustum has an idea how to solve this ?

Link to comment
  • 4 weeks later...

Sorry, right now we cannot offer such solution out of the box. Though there are no stoppers from the technology point of view. You need to sync particles with sinusoidal movement of waves via shaders.

Link to comment

Thanks manguste... Shaders are where I take my bat and ball and head home. Best left to the maths magicians and their respectable witchcraft..

 

(My brain leaks a little out my ears when I read shaders... Or is that vegetative dribble..? I can however, open boxes. ;))

 

+1 for this sometime in the future..

Link to comment

Nat,

 

Ookie-dookie, will take that request into account if there's suddenly (and not likely, sorry) a gap in our development plan :)  Let thou master box opening in the meantime and rock the world by thine art!

Link to comment
×
×
  • Create New...