Raw Edges when Quad hits Quad
I have started writing a program that generates an artifical terrain with water and mountains.
The water is one big blue quad on Y 0, the mountains are constructed of many small quads (Y+).
The problem is that where the mountains reach into the water the edges become terribly raw the further you move away (sometimes parts of the whole mountain disappear!).
So you better understand the problem I have uploaded a screenshot and the executable here: http://members.aon.at/gpf/ogl/
(you can move back/forward with j/u and rotate with a,s,d,w).
When I remove the Quad that generates the water everything looks correct so I guess OpenGL is lazy when rendering the crossing from one quad (mountain) into the other (water).
Any ideas what is causing this/How I can fix it?
thanks in advance, Max
PS.: I use a Geforce 256 SDR/Athlon 700/WinNT 4
This is happening because the Zbuffer isn''t accurate enough. You could try using a 32 bit zbuffer.
Or, when calling glPerspective, make the last two parameters(the near and far clip plane) closer together. This will improve the accuracy.
Or, when calling glPerspective, make the last two parameters(the near and far clip plane) closer together. This will improve the accuracy.
Thanks for the answer.
I''ll try to modify the call to gluPerspective() and see if it works.
How/where could i enable the 32bit z buffer?
I''ll try to modify the call to gluPerspective() and see if it works.
How/where could i enable the 32bit z buffer?
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 Double 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
16, // 16Bit Z-Buffer (Depth Buffer)
0, // No Stencil Buffer
0, // No Auxiliary Buffer
PFD_MAIN_PLANE, // Main Drawing Layer
0, // Reserved
0, 0, 0 // Layer Masks Ignored
};
in the pixelformatdescriptor, there is 16,// 16Bit Z-Buffer (Depth Buffer)
there write 32 in
we wanna play, not watch the pictures
{
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 Double 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
16, // 16Bit Z-Buffer (Depth Buffer)
0, // No Stencil Buffer
0, // No Auxiliary Buffer
PFD_MAIN_PLANE, // Main Drawing Layer
0, // Reserved
0, 0, 0 // Layer Masks Ignored
};
in the pixelformatdescriptor, there is 16,// 16Bit Z-Buffer (Depth Buffer)
there write 32 in
we wanna play, not watch the pictures
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement