viewport background and fog

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
bearSoft
Posts: 165
Joined: Fri Apr 01, 2005 9:55 pm
Location: Denmark

viewport background and fog

Post by bearSoft »

hi
This is needed if colored fog is used
If we remove the skybox in a scene and instead want the screen cleared to a specific color -How can that be done?

-a different (and better) aproach would be to add the fog to the skyboxnode but that .. i dont think that is posible??
ty.
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
MeisterK
Posts: 66
Joined: Sat Feb 26, 2005 1:20 pm

Post by MeisterK »

You can/must supply irrDriver->beginScene with a color which is used for the background if no skybox is present.

For the 2nd: you might attach a light source to the active camera

Is this what you looking for?
bearSoft
Posts: 165
Joined: Fri Apr 01, 2005 9:55 pm
Location: Denmark

Post by bearSoft »

yes MeisterK i think i had a bad idea about how fog in a landscabe could look
the thing is, when the fog get dense the skybox (eg sky) wont be visible
The situation is different if a very sparse fog was used
Now the sky would change in the 'direction' (color quality) of the fog used
My idea was to get a 'media-like' end-result, but dynamic.. (eg craZy->wacko:)
Drifting fog is propl. not easy..

i now have an ok result using this code:

Code: Select all

            if(keys[irr::KEY_KEY_F]){                
                farveQ+=1;   
                 if(farveQ>=255)farveQ=255;

// fog    
                   driver->setFog( irr::video::SColor(0,farveQ,farveQ,farveQ),
                   linearFog, 
                   fra,
                   til,
                   dens, 
                   isPixelFog, 
                   isRangeFog
                   );
                }  
the var farveQ also controls the screen color and hence the two colors follows each other and gives a realistic result
no drifting or layering though -lolda
any ideas on that would be greatly apreaciated
thank you.[/b]
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
Post Reply