Water, shader or mesh manipulation?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
realmsinthemists
Posts: 28
Joined: Mon Mar 27, 2017 7:29 am

Water, shader or mesh manipulation?

Post 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,
For my end result I am working on:
- Volume Voxel System
- Simple light weight physics engine
CuteAlien
Admin
Posts: 9629
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Water, shader or mesh manipulation?

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Water, shader or mesh manipulation?

Post 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.
Post Reply