PDA

View Full Version : ugly teapot



exstud
10-26-2012, 08:40 AM
Hi

I'm new to opengl and this is my first post here...

I managed to build an opengl program that displays the standard teapot, problem I have is areas where the triangles overlap (one behind the other) show artifacts:

http://s6.postimage.org/jvugpdjr5/teapot.png

It's probably some obvious setting I forgot but it could take me days to find which one exactly (blending, z-fighting, antialiasing, ...?), so any pointers well appreciated :D

Dark Photon
10-26-2012, 12:42 PM
...problem I have is areas where the triangles overlap (one behind the other) show artifacts... (blending, z-fighting, antialiasing, ...?)

Are you talking about the "jaggies" (pixel-sized stair steps) on the edge of the base teapot where (for instance) it's in front of the spout?

If so, you want to enable multisample antialiasing (MSAA). See Multisampling (http://www.opengl.org/wiki/Multisampling) (OpenGL Wiki). Enabling this under GLX (UNIX/Linux) is very similar. Let me know if you want more detail.

Setting some ambient lighting so that the areas not facing the light aren't totally black will make it look better/more realistic as well.