Advertisement

clipping problems

Started by August 16, 2003 11:39 AM
5 comments, last by penetrator 21 years, 6 months ago
Starting from lesson27, i had to setup the min. clip distance at 0.1f in order to render cast shadows properly. However, since i have also a huge terrain, with 0.1f i get a LOT of z-buffer fighting, which disappear if i increase min. clip distance at 10. But at 10 i am not able to see cast shadows so ... there is a way to solve it ?
did you set the depth bits to 32 (in pixel format)?

Bobby
Game Core
Advertisement
Perhaps you mean 24 ? Anyway, this is part of the CreateGLWindow function..

static PIXELFORMATDESCRIPTOR pfd= // pfd Tells Windows How We Want Things To Be
{
sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor
1, // Version Number
PFD_DRAW_TO_WINDOW | // Format Must Support Window
PFD_SUPPORT_OPENGL | // Format Must Support OpenGL
PFD_DOUBLEBUFFER, // Must Support float Buffering
PFD_TYPE_RGBA, // Request An RGBA Format
bits, // Select Our Color Depth
0, 0, 0, 0, 0, 0, // Color Bits Ignored
0, // No Alpha Buffer
0, // Shift Bit Ignored
0, // No Accumulation Buffer
0, 0, 0, 0, // Accumulation Bits Ignored
24, // 24Bit Z-Buffer (Depth Buffer)
1, // No Stencil Buffer
0, // No Auxiliary Buffer
PFD_MAIN_PLANE, // Main Drawing Layer
0, // Reserved
0, 0, 0 // Layer Masks Ignored
};

yes
try 32
Game Core
tried, still the same...

glPolygonOffset?
Game Core
Advertisement
Solved ! I used the DEPTH_CLAMP_NV extension with
glEnable(GL_DEPTH_CLAMP_NV);
and now setting the minimum clip distance at 10.0f also stenciled shadows are correctly drawn.
I wonder however if Ati has an analogue extension, going to check it out.

This topic is closed to new replies.

Advertisement