Jump to content

Mesh shading in Blender


anselm Hexicola
 Share

You are about to reply to a thread that has been inactive for 3213 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

For the last while I have been trying to make an architectural model and just cant get the shading right - I have edge-split and so on; but now I admit defeat.

So, I made this simple tapered cylinder to (hopefully) illustrate my problem:-

shading1.jpg

The original was edge-split along the top and bottom rims; the sides were smooth-shaded, top and bottom flat-shaded.

The other 2 are duplicates altered as labelled.

This is how they look in Object mode:-

shading2.jpg

The continuous effect of the smooth shading is spoiled when a face is moved/extruded or simply removed. I  think this is most apparent in the faces above and below the modified face.

I am almost sure that this is because of the direction of the vertex normals.

Here are 2 Top View screenshots of (respectively) the original and the duplicate with the deleted face :-

shading3.jpg

Above, everything in alignment; below NOT.

shading5.jpg

I have tried lots of things to resolve this - but no success ...

Help, anyone?

[ I should add that that I have looked at Gaia Clary's "The secret life of Normals" and, more recently, Drongle McMahon's info about editing vertex normals. But I was not able to figure out a way to solve my own problem.]

 

Link to comment
Share on other sites

Your diagnosis is correct. By default Blender constructs vertex normals by a weighted interpolation of the face normals of the adjoining faces. So when you remove a face, its influence disappears and the vertex normal slopes more towards those of the remaining faces. I can think of a couple of easy work-arounds for your example case without using normal editing. (1) leave the face there, but make it completely transparent (easiest to assign it to a different material; use alpha masking, not blending). (2) Use Inset (I) on the face, making the inset distance very small, so that it's not visible.

However, the best way is with normal editing. Here is a setup that works for your example. The source mesh "nohole" is the same cone with the face still there (and not extruded). There are two copies of the cone in the target object, but the one on the left has its vertices in the vertex group "Group", which is used to restrict the vertices affected by the data transfer. So the distortion is still evident on the right hand cone, but is repaired by the data transfer on the left hand cone. For this I had to use a different face/vertex selection method from my previous example to avoid distortion of the cap. The advantage of this method is that it doesn't add any geometry or use an alpha texture. What's more, it means you don't need the edge split any more, as the normals around the caps are also copied in the data transfer, and those edges were made sharp in "nohole" by using a suitable auto-smooth angle. (Although that doesn't actually save geometry in the upload because the uploader will split the vertices with multiple normals).

If you do use this sort of method, don't forget that you can't make any changes to the geometry after applying the data transfer modifier, and you have to turn off the triangulation option in the Collada exporter.

ednm2.png

Link to comment
Share on other sites

Thanks for your detailed reply - I have yet to get the hang of the Data Transfer modifier, but I am sure I will.

One (possibly trivial) question - how come the Normal indicators in your screenshots are pink? When I have them showing in Blender they are either light blue (faces) or dark blue (vertices). Is this a setting of your own, or are you in a mode or menu that colours them thus?

Link to comment
Share on other sites

I think all the colours can be changed in user preferences, but I haven't changed mine. There are three colours for the normals. Face normals are light blue/cyan. The interpolated vertex normals are darker blue. The pink/magenta ones are the per-face-vertex normals. In the display section of the properties panel, these have separate buttons for toggling the display on/off, in the order interpolated, vertex/per-face-vertex, face, from left to right. The per-face-vertex (also called custom) normals don't exist (I think), and so don't get displayed, unltill you either turn on auto-smooth or get them from the data tranfer modifier (or both).The normal edit modifier tell you to turn on auto-smooth.

The ordinary vertex normals are there (in the display, probably dynamically generated) all the time. They are normals used, with interpolation, in smooth shading, but you can still see them if you have flat shading. Where the auto-smooth angle leaves a vertex smooth shaded, the custom normal and the ordinary vertex normal coincide, unless you have modified the custom normals with data transfer or normal edit modifiers.

Although the per-face-vertex normals shown after activating auto-smooth and those resulting from data transfer look the same in the display, they must be quite different internally, because without the data transfer the auto-smooth normals are not exported, but with data transfer they are. The altered normals also get exported if you use the normal edit modifier. With no auto-smooth, the data transferred normals appear, but don't get exported!*  So the effects of auto-smooth that you see in Blender don't carry through into SL, unless you transfer them to another copy of the mesh and have auto smooth turned on for that mesh too. I am completely ignorant about Blender's internal data stuctures and therefore I can't even guess what the difference might be.

*I just discovered this while checking before posting thus, because I had always had auto-smooth on so that I could see the differences from before and after the data transfer. I had never tried exporting a mesh with transferred normals but auto-smooth off. Now I have to go back and edit my previous post!

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3213 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...