Page 1 of 1

viewport background and fog

Posted: Wed May 11, 2005 10:41 am
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.

Posted: Wed May 11, 2005 12:12 pm
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?

Posted: Wed May 11, 2005 12:32 pm
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]