water transparency

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
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

water transparency

Post by juliusctw »

Hello
I can create the water fine, but I would really like to add some transparency to it, is it do able ? I try to play with the alpha but didn't go anywhere


screenshot of my project
http://www.freewebs.com/iamar/Gallery/welc.JPG
laforced
Posts: 39
Joined: Tue Feb 01, 2005 5:07 am
Location: South Carolina,USA
Contact:

Post by laforced »

http://www.moon-labs.com/ml_resources.htm


scroll to bottom of page. learn technique and apply to Irrlicht
If you're not making GREAT games
you belong in an institute!
The Game Institute.
www.gameinstitute.com
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

thank you for the reply

Post by juliusctw »

Hello

Thank you for the reply, i saw your site and i tried to read the source code, unfortunately, i am not a good enough programmer to just read the code and pick up the technique , i am also not familiar with the engine you are using.

i am just very curious if anything as good as what the site had to offer ever has been done in irrlicht ? would any one care to share their source code, i guess in the end if no one will, i will have to go learn the technique and write a class for the forum,, i hope it doesn't come to that : )

any suggestions?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

It's painfully simple to do, merely because i managed to do it when i was first playing with water for the fun of it. Here's a picture:
Image

I don't have the code for that anymore, but check out the SpecialFX demo as that's where the use of water is demoed.

It could be this code:

waterNode->setMaterialType(EMT_REFLECTION_2_LAYER);

Try something like one of these:

EMT_TRANSPARENT_ALPHA_CHANNEL
EMT_TRANSPARENT_ADD_COLOR
EMT_TRANSPARENT_REFLECTION_2_LAYER

Or one of the other possible values which has transparent in it, or just experiment with all the other ones too as you might be able to find a nice effect.
Image Image Image
Duncan Mac Leod
Posts: 64
Joined: Sun May 22, 2005 3:06 pm
Location: Germany
Contact:

Post by Duncan Mac Leod »

laforced wrote:http://www.moon-labs.com/ml_resources.htm


scroll to bottom of page. learn technique and apply to Irrlicht
Nice WaterEffect :D - hope that anyone will port it to irrlicht...
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

thank you so much

Post by juliusctw »

Hello it worked with

node->setMaterialType(EMT_TRANSPARENT_ADD_COLOR);

However, I have more question, when i walk into the water , the water disappears, (that's cus there's only a layer)

I would like to walk into water and still feel like i am in water, any suggestions?

Another question, how much process does water take? how much does it slow down the computer?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

A submarine game someone did in Irrlicht used blue fog to simulate being underwater, which looked nice for being underwater all the time, and i suppose you could have a way of turning the fog on when you go beneath the water somehow, but it wouldn't work very well for the transition, unless it was a quick transition so you wouldn't notice the change. I mean to say that you couldn't have the water line halfway up the screen so it looks like the bottom half of the screen is underwater and the top half is not.
Image Image Image
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

great suggestion

Post by juliusctw »

Hello

You are probably right, i can imagine that the transition would not be smooth due to the blocky nature of the fog.

I guess i can just have 2 fogs 1 kinda cover the surface, the other under the water, this way the transition is less noticeable

or

i can somehow create a bubble effect when going into the water, so you see bubbles during the transition and then the fog.... any bubble effects out there?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You could render a partially transparent texture over the part of the screen that is underwater. If the water surface is flat it would not be incredibly difficult to do.

Travis
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

You could use multipass renders OR use volumetric fog... theres an article on it in OpenGL at 'nehe.Gamedev.net' but I'm not sure if Irrlicht supports it.
pushpork
Post Reply