Irrlicht Water Question

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.
Bog_Wraith
Posts: 12
Joined: Sun Jul 11, 2004 7:55 pm
Location: Tampa
Contact:

Irrlicht Water Question

Post 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?
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post 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.
Bog_Wraith
Posts: 12
Joined: Sun Jul 11, 2004 7:55 pm
Location: Tampa
Contact:

hmm

Post 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
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post 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)
thesmileman
Posts: 360
Joined: Tue Feb 10, 2004 2:20 am
Location: Lubbock, TX

Post 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.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post 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.
Rocketeer
Posts: 9
Joined: Sun Jul 11, 2004 9:13 am
Contact:

Post 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.
Bog_Wraith
Posts: 12
Joined: Sun Jul 11, 2004 7:55 pm
Location: Tampa
Contact:

Post by Bog_Wraith »

Thanks. I'm going to experiment with some things, let you all know how it goes if i get something working.
dingo
Posts: 95
Joined: Tue Mar 09, 2004 5:02 am
Location: Brisbane, Australia
Contact:

Post 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
-= Want your C code to control real life robots? www.users.on.net/~symes =-
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post 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.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post 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.
Bog_Wraith
Posts: 12
Joined: Sun Jul 11, 2004 7:55 pm
Location: Tampa
Contact:

ok

Post 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
dingo
Posts: 95
Joined: Tue Mar 09, 2004 5:02 am
Location: Brisbane, Australia
Contact:

Post 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
-= Want your C code to control real life robots? www.users.on.net/~symes =-
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post 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.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

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