Jump to content

Strange Light Reflections on Meshes


Amphei Jierdon
 Share

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

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

Recommended Posts

Hello, 

I made socks, wich have a bund, and between socks and bund is an edgeloop, wich is set in a little. In Blender, everything looks perfect. 

 

In SL the bund is very much lighter hn the rest of he socks, and I don't know why.

 



 

If i switch off shaders in preferences, it looks better:



It also looks perfect, if I switch to full bright..., but then the socks glow a night.  

Does anybody have an idea, how I can minimize or avoid that effect? 

Link to comment
Share on other sites

Here's how it works. Three diagrams on the left or each row show sections through a simplified cylindrical model. The model shading is simulated on the right by using the top-down Matcap in Blender. The top row has top and bottom closed. In the middle, both are open. At the bottom is the same as the top, but with extra edge loops close to the top and bottom of the vertical sides, as Aquila suggested.



Blender mainly works initially from face normals*. These are shown, in the middle of each face, by the light blue lines on the left. They stick out from the middle of the face at right angles to the faces. Note that the top two are the sane except for the missing faces. At the bottom you can see the extra face normals belonging to the narrow faces made by the new edge loops.

Collada only uses vertex normals. For a smooth shaded object, these are generated by interpolation (more-or-less averaging) the adjacent face normals. These vertex normals, that get exported to the dae file, are shown by the green lines in the middle diagrams. The vertex normals bordering the removed faces are now different because the contribution of those face normals has been removed.

When the mesh is shaded in the viewer, the normals of each point on the surface is interpolated between the vertex normals. The results of this interpolation at a sample of points is shown by the orange lines in the third column. Now you can see why you see the shading on the top right. The normals at the top of the band point upwards, towards the light, while those at the bottom of the band point downwards, away from the light. So the lower part of the band gets less light and is darker. The whole of the longer part of the cylinder has normals pointing downward. So it is shaded as if it receives little illumination. When the top and bottom surfaces are removed, the effect on the band is still there, although less pronounced. The long cylinder is now more brightly shaded lower down than at the top.

When the extra edge loops are added, the new perpendicular vertex normals near the top and bottom cause all the interpolated normals to be parallel. So now the shading on the vertical faces is even. All the curvature is compressed into the narrow space between the old and new edge loops, resulting in the appearance of rounded edges.

*Now we can also have editable custom vertex normals. These provide other ways of solving the shading problem. But that's more complicated. So I will leave it out for now.

 

Link to comment
Share on other sites

The problem arises because you need smooth shading across the edges around the circumference of the sock, but not across the horizontal edge loops. In Blender there are two other ways of achieving this without adding the edge loops. First, you can turn on "Auto Smooth" under the triangle tab in the properties panel and set the smoothing angle to an appropriate angle. Unfortunately the vertex normals made by auto-smooth don't get exported by the current Collada exporter. So that doesn't work for SL (unless you transfer them to another copy of the mesh using a data transfer modifier*). The same effect can be obtained by using the edge-split modifier with the appropriate angle setting. This also gives you finer control if you use the marked sharp edges instead. You can also split edges explicitly with the split edge tool. These all break the connection of the faces either side of the split edge, duplicating the vertices, so that the normals are no longer interpolated across the split edges. These methods use less extra geometry than the added edge loops, but result in a perfectly sharp edge which shades unrealistically. The edges made by adding edge loops look better because their shading makes slightly rounded edges which look more realistic, especially for shiny objects where they are necessary for realistic highlights.

Here are these different methods, rendered in Blender (orthographic camera) at the to and in SL, at the bottom.
(1-5) are all simple geometry: (1) Flat-shaded; (2) + smooth-shading (3) + auto smooth 85 deg; (4) + auto smooth 180 deg, with normals transferred from 3; (5) Edge split 85 deg. (6) is the smooth shaded model, 2, with the added edge loops. (7) is the same as 6, with an added edge loop on the top too, to make the top look flat. Notice that the models look similar in Blender ans SL, except for 3, which looks like 2 because the auto-smooth vertex normals are not exported unless they are first transferred to a new copy of the mesh to make "custom normals", as in 4.



Link to comment
Share on other sites

Just wanted to say that it still amazes me how both of you are SO good at this --  LOL.

 

Some things I understand now. Others not so much. But I do note that you each have a least a 90% "success rate" and I do remember all the times you helped me. So THANK YOU from the general Blender folks at large.

 

I am sure everyone appreciates how giving you are to "the cause".

 

:D

Link to comment
Share on other sites

  • 5 weeks later...

I would like to come back to the topic of this thread, because I again have problems with strange light reflections. 

 

This time it is at the zone between the thighs of short pants. 

 



Even after I thougt, I understood all the help in this thread, I can not see, where these bright blue spots come from. 

In Blender, the same area looks very normal: 

 

Link to comment
Share on other sites

Guessing, but it looks to me as if you have a few duplicated faces, with the normals flipped. Turn of backface culling and then try deleting the faces. If they are duplicated, you will still see the duplicate face when one is deleted. Or switch to wireframe view, which lets you see the inverted normals. Also, there is a black spot that looks like an isolated vertex. What is that?

Link to comment
Share on other sites


Drongle McMahon wrote:

Guessing, but it looks to me as if you have a few duplicated faces, with the normals flipped. Turn of backface culling and then try deleting the faces. If they are duplicated, you will still see the duplicate face when one is deleted. Or switch to wireframe view, which lets you see the inverted normals. Also, there is a black spot that looks like an isolated vertex. What is that?

Thank you, but I didn't find duplicated faces. But I removed the edge split modifier, and that solved the problem. 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2660 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...