PDA

View Full Version : How to set angle for polygon smoothing?



bignose
11-25-2001, 08:29 PM
Hello,

I am wondering if there is a way through the OpenGL API to set the threshold angle that is used for smoothing polygons using glShadeModel(GL_SMOOTH).

I know that most 3D modeling software lets you set the autofacet angle. Two polygons that have less than that angle between them and it smoothes the edge - greater than that angle and it does not, which gives you a sharp edge.

Does my explanation make sense? Basically I want to be able to increase or decrease the amount of smoothing that OpenGL does. I am dreading that the only way to do this is by manipulating the surface normals for the polygons. :-(

Thanks for any help!

Platinum
11-26-2001, 11:17 PM
If I understand your question well, then:

Yes, you can make the smoothing only by changing vertex normals by yourself. OpenGL is always drawing one triangle at a time, so it does not know about the existence of other triangles already drawn and those not yet drawn.

Imagine a situation, when you will draw several millions of triangles and OpenGL will store all of them somewhere and when drawing a new one always checked with this database, whether it shares an edge with another. It wouldn't be very "real-time" graphics, would it?

bignose
11-27-2001, 10:14 AM
Makes perfect sense. Thanks for the reply!