Page 1 of 1

Water, shader or mesh manipulation?

Posted: Wed May 03, 2017 6:32 am
by realmsinthemists
Am wondering how to create water. Not just a flat plane simulating waves but the mesh needs to be deformed. For my scene I need ships to interact with the waves.

Have looked around the internet but only found 'Neat and awesome water'. One is with manipulating the mesh and the other is using a shader.

Anyone how can help me by pointing out where to start, which type I should use and more over why that one? I'll figure out myself how to do it, just need some help in which one. My first thought is using a shader, if so, please point me in the direction I should be heading.

r,

Re: Water, shader or mesh manipulation?

Posted: Wed May 03, 2017 10:25 am
by CuteAlien
If you need the ship to collide against the waves I would use mesh manipulation. You might also have to write your own ITriangleSelector for that as I think updating triangleselectors for static-meshes still is on my todo-list. Sorry about that, but it's not too hard - just have to create triangles for the mesh on cpu and return those (and for speed optimization this is likely also one of those cases where you would put your triangles in a gridwhich Irrlicht doesn't support yet anyway).

You might add some shader-effect on top of that (to get nice white on top and dark blue on bottom of waves for example).

And... I'm just guessing... I haven't coded an ocean yet.

Re: Water, shader or mesh manipulation?

Posted: Wed May 03, 2017 5:50 pm
by LunaRebirth
I've never done this so I'm not even sure this method is possible but:
Could you make an animated mesh scene node that does wave actions using bones, set the material to transparent, and add collision from the Irrlicht tutorials?
Add collision such as have a boat upper-half with collision, then a boat bottom-half without collision.