Archived

This topic is now archived and is closed to further replies.

dragon376

Smooth in open GL

Recommended Posts

I am trying to have a "smooth" effect on a object created polygon by polygon. I have glShadeModel(GL_SMOOTH) but it seems that I need to do something else to have a smooth looking surface. NEED HELP Thanks Phil.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What do you mean by smooth?
Perhaps normals averaging or texture filtering?

Share this post


Link to post
Share on other sites
You need to get the normals for every surface before OpenGL can take the polys and make them smooth.

------------------------------
Trent (ShiningKnight)
E-mail me
ShiningKnight Games (I had to make one up, to fit in with the rest of you )
Project: Writing tutorials and code for my OpenGL Game Programming series
OpenGL Game Programming Tutorials

Share this post


Link to post
Share on other sites
If you get 1 normal per surface on your mesh you''ll get a flat shading which isn''t exactly "smooth". If you get 1 normal per vertex on your mesh OpenGL will gouraud shade it making the mesh look all pretty and "smooth".

Share this post


Link to post
Share on other sites
GL_SMOOTH = Gouraud shading.

It''s up to you to give the code the good value to get the desired effect.

-* So many things to do, so little time to spend. *-

Share this post


Link to post
Share on other sites
If you use polygon normals, to calculate vertex normals loop through all vertices and calc the average normal vector for all polys the vertex is used in.

Share this post


Link to post
Share on other sites