//---------blablabla
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, shadow_map_fb);
glViewport(0, 0, shadowMapSize, shadowMapSize);
glClear (GL_DEPTH_BUFFER_BIT);
draw_cocheworld(); //draw the shadow map
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
//---------blablabla
FBO dirty shadow map problem
I'm trying to add shadow mapping to my game. To get a higher resolution shadow map, I started using a frame buffer object. But since I did that, I get strange results; the shadows projected to the floor, stays there even when the car goes away and clears only every 1 or 2 seconds. This doesn't happen if the car is on top of a ramp, for example. Its very weird... any ideas why this happens?
Here a sceenshot (without textures)
Try
and if not you may need to include more code...
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
and if not you may need to include more code...
the only thing that helps is drawing a big quad facing down under the scene.
dont understand why.
dont understand why.
are you using GL_LEQUAL for your depth buffer parameters? You may need to post more code...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement