Page 1 of 2

Irrlicht Water Question

Posted: Wed Jul 14, 2004 2:19 pm
by Bog_Wraith
I have used addWaterSurfaceSceneNode on several different kinds of meshes including addHillPlaneMesh and addTerrainMesh all with favorable results.

I have examined the special effects demo, kinghtofflight's terrainv002, and thesmileman's summer fun winner, as well as my own results and I have come to realize that addWaterSurfaceSceneNode SEEMS to only create a "skin" of water over the mesh. Once you go "under" the water...its empty.

IS there a way within Irrlicht to create water volume? To actually be within the water?

Posted: Wed Jul 14, 2004 3:50 pm
by arras
I dont think so ...you have to do it somehove diferent. Every object (3dmodel) consist of planes (triangles) there is nothing "solid" just 3d mesh.

hmm

Posted: Wed Jul 14, 2004 5:26 pm
by Bog_Wraith
Yeah I was thinking, even if I made a cube and applied waterscenenode to it, it would still be empty inside. Does anybody know how an underwater effect is made usually? It is particle system or something? thanks

Posted: Wed Jul 14, 2004 5:53 pm
by arras
I was newer doing it but may be you can change light and/or fog everytime camera gets under water so everithing looks more dark and more blue (or green)

Posted: Wed Jul 14, 2004 8:22 pm
by thesmileman
Once simple way to do it would be create a box with blue textures with the normals inverted so that you can not see it from the outside but once you go inside everything will be blue. If you made the texture somewhat transparent it would give the impression of being underwater(I think).

As a side note: does anyone know if you can have a two sided texture in Irrlicht. This may be a RTFM question but I dont really care.

Posted: Thu Jul 15, 2004 7:33 am
by arras
Texture have no sides, polygoon does ...so your question should stay: Can you have two sided polygoons? ...and answer is yes. You need two identical polygoons with only diference of firsth one have just oposite normals than second.

Posted: Thu Jul 15, 2004 7:44 am
by Rocketeer
Okay, this is just a theory (since I am away from my development system), but if you created your water box and turned off back face culling, would you then see water from both inside and out?

I guess that's the easiest way to make 2-faced polygons - only you get the same texture (but seen from the other side) on both faces. As arras says, if you want 2 different textures, you'd have to have 2 polygons.

Posted: Thu Jul 15, 2004 2:51 pm
by Bog_Wraith
Thanks. I'm going to experiment with some things, let you all know how it goes if i get something working.

Posted: Fri Jul 16, 2004 8:01 am
by dingo
The simplest thing to do would be to make a square (could load from a .x file for example or just code it).

Then make it a child of the camera node. Translate it forward a bit and make sure it is facing back towards the camera. Then make it blue and make it transparent.

Also make sure it is large enough to cover the entire screen and make sure it is close enough to be with the player's clip volume so world polys don't get between it and the camera.

This way everything will be seen through the transparent square

Posted: Fri Jul 16, 2004 8:10 am
by Tyn
Particles are one part of creating an under water look, having blue fog applied to the water scene node should also give the under water look. There are also some shader algorithms around that filter what the camera sees to give it the blurred, distorted look of being under water. Having bubbles come up in front of the camera from a particle emmiter and having gentle blue fog applied should give a fairly reasonable effect.

Posted: Fri Jul 16, 2004 10:33 am
by arras
you dont have to create transparent boxes around camera, just alter light (ambient or source). Fog would also help since under water visibility is lower.

ok

Posted: Fri Jul 16, 2004 5:43 pm
by Bog_Wraith
I'm goint to try and use a numer of methods to create an underwater effect. The first thing I am working out is underwater caustics animation which i have working fairly well. Gonna try this with fog I think.

Here's screen shot of the caustics, though you can't see it animated. Just imagine a pool bottom.
http://www.bogwraith.com/images/underwatercaustics.jpg

Posted: Sat Jul 17, 2004 1:03 am
by dingo
I would use the fog approach for a large body of water and especially if it is outdoors (naturalt lighting).

If it is just a small body of water with lights under the water line then I'd just tint the scene blue with an altered light or child box of the camera.

BTW with the caustics, does that mean you'll be creating a node for Irrlicht that handles DX9/Cg/GLSL shaders?

Once I've got throught the Orange Book I'll be looking to do this

Posted: Sat Jul 17, 2004 8:28 am
by Tyn
It is possible to create caustics without shaders but it looks a lot better with them. You can use them to slightly distort the view and make it look more realistic. I think it was Far Cry that uses that effect IIRC.

Posted: Sat Jul 17, 2004 9:42 pm
by Midnight
in rtcw there was a map called tank that had the coolest water I've ever seen in a game.

they used layers of foggy looking mesh to look like water depths and it was foggier underwater.

might be a good idea to get GTK and download the TANK map for return to castle wolfenstien I think you might be interested to see how they did it.

o wait I just realised you can't see that unless you decompile the map and that would remove the textures so...I'm downloading it now and I'll post some screenshots after I install rtcw again and load it up. 8)