Hi, I have this 3ds mesh as the terrain of my project (I did it so because the results are much better performance wise as well as in quality).
Now, my problem is that when rendering it under OpenGL it has this annoying color flickering when moving the camera direction, while when rendered under Direct3D it works, quite fine with no flickers at all.
I've attached two screenshots showing how it looks when moving the camera just a little bit to the right. You'll see that the whole mesh darkens significantly.
It also seems that the
nody->setMaterialFlag(video::EMF_LIGHTING, true);
flag doesn't make any difference, since even when there's no light at all the mesh remains completely iluminated as if it was receiving light from an omnidirectional like source.
Any help appreciated,
Thanks.
Color flickering on meshes when in OPENGL
-
- Posts: 34
- Joined: Wed Apr 25, 2007 3:48 am
-
- Posts: 362
- Joined: Sun Dec 16, 2007 9:25 pm
(this is a guess) but does it matter if you have a light in the 3ds scene? and if so, did you?
Post this userbar I made on other websites to show your support for Irrlicht!
http://img147.imageshack.us/img147/1261 ... wernq4.png
http://img147.imageshack.us/img147/1261 ... wernq4.png
-
- Posts: 34
- Joined: Wed Apr 25, 2007 3:48 am
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
You have to renormalize normals after scaling, otherwise lighting will fail. Also, when scaling too large you will notice that the faces will become pretty huge. Due to the per-face shading you can spot pretty bad color changes and seams. You can increase the triangle count in order to overcome this problem (the terrain scene node uses dynamic LOD for this reason, otherwise you will get too many faces in the very far background). Or you use per-pixel shading with phong shaders or similar techniques.