Jump to content
  • Advertisement
Sign in to follow this  
CRACK123

OpenGL smoothing groups

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

Hey, I have been looking around for info on how smoothing groups are calculated but I don't seem to find any info on it. First of all I am still confused as to what smoothing groups is - is it just another fancy name for vertex normals ? Also how would one go around doing a good job of rendering smoothing group models in OpenGL. I have an DirectX x file which has a model having smoothing group normals. It has 64 normals and the face indices it should be applied to. It seems like you wouldn't be able to do it one call using glDrawArrays and would have to go to immediate mode to do this. What would be the best way to use smoothing groups in OpenGL. Thanks

Share this post


Link to post
Share on other sites
Advertisement
You can best learn what smoothing groups are in 3d studio max. No they cannot be calculated, just exported from a 3d modelling software package. If you want to understand smooting groups, just think of vertex normals. They are giving the impression that a certain polygonal surface is smooth and curved by lighting the polys properly. Now if you have a mesh that uses vertex normals, the mesh looks smooth and curved. But let's say you don't want it to be smooth, you want a certain edge on the mesh to be visible. In this case, you create 2 smoothing groups (which are just identification numbers) and all the polys from one side of the edge will go into the first smoothing group and the rest will go into the second. If a vertex belongs to polys in different groups, then for that vertex different vertex normals are calculated for each group. By doing this, we acctually obtain visible edges because the smoothing groups are rendered sepparately, one group at a time(using let's say vertex arrays) and there are different normals for adiacent polys. The numbers exported from 3dsmax that identify smoothing groups are numbers that represent a single bit set to one in the whole value, which can easely be obtained using a bit mask.

You are right, you cannot do it in one glDrawArrays. You must split your mesh into submeshes, each submesh containing just one material and all polys of that submesh being grouped in the same smoothing group. Then you render one submesh at a time. You cannot render multiple smoothing groups at one time because of the multiple vertex normals along the edges of one group. Think for ex to a cube. In this situation, you will have different smoothing groups for each face, and for each vertex you will have 3 vertex normals, one for each face.

Hope it helps

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!