Jump to content
  • Advertisement
Sign in to follow this  
Deathscythe_HC

OpenGL Screwed up rendering

This topic is 4642 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

Anyone got this kind of screwed-up render? It's supposed to be 3 shaded triangles ( 1 on top of two other ). Each triangle is composed of three colors ( Red, Green and Blue ). The background color should be black, not red ( well, the first time it is rendered, the background is black, but in all subsequent renderings, the background becomes red ). Screwed-up rendering I have the latest drivers for my video cards ( GeForceFx 5600 & GeForce 4 Go ) so I can guess the problem does not lie there. If someone can give me a hint or point somewhere the problem could be, that would be greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
It kind of looks like you're getting z-fighting with a gigantic red quad. Check for stray vertices maybe? Also, make sure that you are clearing everything correctly (color and possibly depth buffer).

If I had to guess, I'd say that you are attempting to clear the screen using a big quad and are forgetting to reset the color to black in your render loop. You should really use glClear here or at least move the quad back away from the triangles. The problem is that the big quad is being drawn in virtually the same spot (as far as the depth buffer is concerned) as the triangles and is some spots the quad wins while in other spots the triangles win.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Are you using SDL as a framework?

If so, then make sure you are using glClear to clear. NOT SDL_FillRect(screen, NULL, 0);. I've tried that out of curiousity and it messed up, it looked SIMILIAR to that, so I can't guarentee anything.

C++

Share this post


Link to post
Share on other sites
First of all, I'm not using the SDL framework. I'm coding with the OpenGL API directly in my renderer framework.

Second, I clear the buffers using the glClear command. The only polygons I draw on the screen are those 3 triangles using a display list ( I call the display list 3 times at different positions ).

I'm wondering if I scrapped something with my code. I guess there is a certain order to follow when you call the API methods when rendering. When I run the demos on NeHe, the rendering is OK.

Share this post


Link to post
Share on other sites
I use a 16-bit depth buffer. When I looked in my code what was the depth, I remarked I did not enabled it because right now, I do not need it. Could this be the problem? I guess I'm gonnas find out by testing it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!