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();
The origin has no fog (dark blue), whereas camera is in the fog; strange or what did I do wrong?
Thanks in advance.
So many questions without answer