Jump to content

Smooth Normals


SpiderPig
 Share

Recommended Posts

Getting some mixed results with this.  There are no double vertices in the mesh any more (99.9% sure <_<) and this is with model->UpdateNormals().

This is the result.

SmoothNormals.thumb.png.2afd1c218107774644b78d1942e9f0e1.png

I've outlined the wireframe with red.

SmoothNormals_2.thumb.png.cb9f94114d0fe34b1ef4bae4ce2c12c3.png

It seems that if the triangles are really small it gives sharp results.

  • Like 1
  • Confused 1
Link to comment
Share on other sites

Love the Model::Save() method.  ;)

In blender I confirmed there is no double up on verts, all triangles are sharing what they should be.  These are the exported normals.  Using blender to recalculate smooth shading gave no visual difference.  I thought they should look better than this?  Maybe this is another pitfall of marching cubes.  Too many small thin triangles!

BlenderComponent.thumb.png.b4f6a8408f4e1ff9a866c95795632a75.png

BlenderComponentWireframe.thumb.png.c6bd426831ad12ebab2d407ee4046a88.png

Link to comment
Share on other sites

I agree, its a bit messy.  I could merge vertices in a 2nd pass but I think it'll be a bit slow - or maybe it could be done in one pass as I create the vertices... <_< but Surface Nets should make better geometry because the vertices should be relative evenly spaced, and there will be less triangles too.  I'm working on it now so should have some results soon.

Link to comment
Share on other sites

I saw here I might need to do a better job at averaging the normals of shared vertices.  It says to use the angle to determine the weight that each face's normal will effect the vertex.  I tried with the dot product and seemed to get slightly better results but I'm unsure on exactly what the value of "Angle" in this answers code should be.  Degrees maybe?  or just 0 to 1? <_<

Is there a "proper" method of average normals for shared vertices?  Usually I just add all the faces normals up that share the vertex and divided by total number of faces that share it.  Might be half my problem.

Link to comment
Share on other sites

If you are doing marching cubes, maybe it is possible to calculate the normals from the underlying volumetric geometry instead of trying to calculate them from the mesh? I mean you lose information when you go from volumetric to mesh, so maybe before losing that information it is possible to calculate normals that should be applied to the mesh?

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...