how to create fog in part of a room?

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
baoyicai
Posts: 6
Joined: Tue May 22, 2007 7:28 am

how to create fog in part of a room?

Post by baoyicai »

hi, i got stuck with a fog problem.

i loaded a .irr house scene in, and i wanted to create fog in one of the rooms (bathroom, exactly..).
but since the house itself is a node, does this mean that i can only make the whole house foggy by calling setFog() ?
is there any methods that i can create fog in ONLY one of the rooms?

i was thinking that maybe i could create another cube node, put it in the bathroom, and make it transparent, then only enable fog on this cube node, but how to make the cube transparent?


thanks a lot in advance~
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

When you calling setFog() , it will affect all materials that has flag EMF_FOG_ENABLE enabled. So if you want any node to be affected by the fog, you should call something like:

Code: Select all

video::setFog( video::SColor(0,20,20,20), true, 100.0f, 200.0f );

bathroom_obj1->setMaterialFlag( EMF_FOG_ENABLE, true );
bathroom_obj2->setMaterialFlag( EMF_FOG_ENABLE, true );
...
P.S.: the only one limitation. there is only ONE fog settings available, means: you cannot assign for some nodes 1st fog settings, and for another nodes 2nd fog settings in the same scene.
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

i think this is your sollution baoyicai
baoyicai
Posts: 6
Joined: Tue May 22, 2007 7:28 am

Post by baoyicai »

thanks:)
i take a look through the link, the effect is perfect but i think it's a bit hard for me cause i don't know openGl actually..
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

you use irrlicht, forget openGL :)
Post Reply