Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

penetrator

clipping problems

This topic is 5452 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites
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
};

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!