View Full Version : Jagged Polygon Edges
07-18-2003, 11:54 AM
I am trying to display a 3D cube or other similar entity. I noticed that the top face of the cube (in an isometric type view) is being displayed with a jagged edge through which I can see a portion of the polygon making up the back face(s). I have enabled GL_POLYGON_SMOOTH, but that doesn't seem to work. Does anyone know how to fix this problem so that I don't get conflicts along corners of my 3D objects?
07-18-2003, 11:58 PM
Have you tried to call glHint also? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc03_9uno.asp
My guess is that you will get antialiasing but that it will be very slow. If you have a newer card with full screen anti aliasing, FSAA, will that probably be a better idea.
I think this is because of the z fighting between the back facing polygon and the front facing. You can do back face culling - glEnable(GL_CULL_FACE) or decrease the far view plane distance to get more accurate z buffering - gluPerspective(.......).
doing back face culling will also increase the rendering speed.
[This message has been edited by ctoa (edited 07-19-2003).]
07-21-2003, 02:48 AM
Read this: http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/002510.html
07-21-2003, 05:58 AM
Okay, I'm about to show my "beginner" status again, but what the heck...I'm a beginner. I'm working on a simulation of Jupiter and it's four major moons. I draw everything in the XY-plane and then effectively rotate the entire scene with gluLookAt() by using an up vector of (0, 0, 1), so I get an "edge-on" view of the system. So, if I want to sort my objects back-to-front using their Z-values to help with anti-aliasing, I'm really using my objects' Y-values since they're all in the XY-plane, right? Or for Z-buffer purposes, is my Y-axis acting as the Z-axis because of the gluLookAt() rotation?
FYI, the reason I draw in the XY-plane as opposed to the XZ-plane is because in a separate viewport, I render a 2-D miniature "heads-up" view of the planet/moon system using gluOrtho2D, GL_POINTS, and glVertex2d(), to which I simply pass the x and y coordinates of each object.
07-21-2003, 06:43 AM
Drawing order sorting is not done in object but screen coordinates.
You need to apply the modelview and projection matrix to the polygons and sort by resulting z.
Polygon smoothing is a weird feature. I would recommend to try full scene antialiasing (FSAA) or multisampling instead.
FSAA is just a flick of a switch in your vendor's control panel, you just render your scene as usual, easy as that.
Multisampling needs to be selected via WGL_ARB extensions pixelformat and multisample.
[This message has been edited by Relic (edited 07-21-2003).]
07-21-2003, 04:44 PM
FSAA did the trick. Is there a way to set this in software, similar to the way waiting for vsync is set and unset?
07-22-2003, 12:42 AM
Yes, if supported by your OpenGL implementation with the extensions in my last sentence from above.
See http://oss.sgi.com/projects/ogl-sample/registry/ for the specs. You might to look up some examples on the developer pages of your graphics vendor.
07-22-2003, 08:44 AM
Thanks, Relic. I think it's time I learned about the OpenGL extension mechanism. I've been using the basic API up until now.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.