(bug?) createPlaneMesh() and fog

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Katsankat
Posts: 178
Joined: Sun Mar 12, 2006 4:15 am
Contact:

(bug?) createPlaneMesh() and fog

Post by Katsankat »

Merry Christmas everyone and have nice holidays.

The plane is fogged in the middle, its corners have no fog no matter where the camera is located.

The normal behaviour should be no fog close to camera, and fog from start to end distance.

The code:

Code: Select all

 
        #define TILEWIDTH 65536
 
        smgr->getActiveCamera()->setFarValue(TILEWIDTH);
 
        f32 fogstart = 30000.0f;
        f32 fogend   = TILEWIDTH - 200.f;
        f32 fogdensity=0.01f;
        bool pixelFog=false;
        bool rangeFog=true;
        driver->setFog(SColor(0xffC5D5F7), irr::video::EFT_FOG_LINEAR , fogstart, fogend, fogdensity, pixelFog, rangeFog);
 
 
        video::SMaterial mat;
                mat.MaterialType = video::EMT_SOLID;
                mat.setTexture(0, driver->getTexture("data/water.512.jpg"));
                mat.Lighting  = true;
                mat.FogEnable = true;
                mat.Shininess = 50.0f;
                mat.EmissiveColor = SColor(255, 240,200,150);
                mat.SpecularColor = SColor(255, 223,231,100);
 
        IMesh *mesh = smgr->getGeometryCreator()->createPlaneMesh (
                                        dimension2d<f32> (TILEWIDTH,TILEWIDTH), //tileSize,
                                        dimension2d<u32> (1,1),              //tileCount,
                                        &mat,                                //video::SMaterial *,
                                        dimension2d<f32>(16,16) );          //textureRepeatCount
 
        IMeshSceneNode *node = smgr->addMeshSceneNode(mesh);
        mesh->drop();
 
Screenshot of 4 nodes around origin (OpenGL driver, Linux, irrlicht 1.7.1)
The origin has no fog (dark blue), whereas camera is in the fog; strange or what did I do wrong?

Thanks in advance.

Image

:? So many questions without answer
Post Reply