Weird shading being so dark in viewport

Try to make some hard-surface. There are two different pairs of legs I use mirror modifier to make them symmetric from the main body.
Here is the view that you can see the two mirrored legs in the foreground, two original legs in the background. The right-hand-side leg behaves fine, but the left-hand-side leg behaves so weird and dark.I assign the given material in the right-hand side to the so-dark leg.



As below, the front one is the original leg, the rear one is the mirrored leg and being so dark.

I think it might caused by the light direction, so I try to exchange their location as below, while the mirrored leg(in front view this time) is still so dark.

Here is my viewport shading and render setting.


I disable AO then it seems to behave fine. Here comes what I cannot understand: what’s the reason that one leg behaves great while the other behaves weird if the AO enabled?

Looks like flipped normals, though I can’t think of why the Mirror modifier would do that. Try enabling Face Orientation overlay and see if those “black” legs have any red on them.

The legs look fine!
I just don’t know what’s the problem: shader? render engine? material? … or what?

Weird indeed. Can you upload a piece of it, say that round knee joint (with the modifier), so that I or someone else could take a closer look?

So here is my Blender file.
1112 Mech-5 forShader-2.blend (3.1 MB)

I rotate the leg, the shader looks so weird as below

Ok, so it is a combination of custom normals and the Mirror modifier. The modifier doesn’t handle custom normals correctly. I reported it back in 2015, but apparently it’s a “limitation”.
If you go to your object’s data button, under Geometry Data you’ll find the “Clear Custom Normals Data” button. Press it to get rid of the baked-in custom normals, that should fix the shading errors. Although you may need to then adjust the Auto Smooth angle and add/remove some sharp edges.

image

EDIT: oh and also, there are some internal faces on your meshes that may interact poorly with the top mirror modifier, you may want to get rid of those. Other than that, these are some slick looking legs!

2 Likes

Mirrored custom normal problem might be fixed, at least I can’t reproduce in my Blender 2.82 Alpha version from October 30 from buildbot. I found this fix for this bugreport, looks related.

1 Like

Oh, thanks for the heads up, @Sanne, I wasn’t aware of new developments on this. Some other tools might also become more aware of custom normals in the future.

2 Likes

That’s interesting, thanks for mentioning it. I love using custom normals and find it quite important that they work as expected. Good to know it’s being worked on.

1 Like

Thanks a lot @Stan_Pancakes !
I click the button without doing anything else, the result turns out to be great like below!

For the internal faces, do you mean the blue face that face in?

@Sanne glad to hear that, pretty excited for the upcoming stable release!
But I actually don’t remember I try to make ‘custom normals’, does that happen by ‘mark sharp’?

No, the ones at the axis of symmetry of the leg itself:

Also, those pistons/dampers that you have in the middle of the leg, they get mirrored on top of themselves as well. You could enable Bisect for the Y axis on the Mirror, or separate them into their own objects and remove the first Mirror for them.

As to how do the custom normals happen, an add-on could do that, or pressing that “Add Custom Split Normals Data” button, or applying some modifiers (like Weighted Normals).

1 Like

Thanks for your reply again!!

I check my Blender file but I cannot find those inside-out red faces.
May I know how you make the shader looks like this? My version in Blender 2.8 is blue-red.
Is that Viewport Overlay>Geometry>check ‘Face Orientation’?
Not sure why the result is different, maybe I miss something?

In my screenshot that’s just solid view without Face Orientation overlay, and the faces are merely selected. I.e. the red color is just my theme settings for selected geometry :slight_smile: I just selected them to show which ones I mean.

The Mirror modifier doesn’t remove these faces. It mirrors them together with the rest of the model, and they end up on top of each other. Then, with the Merge setting on, it also welds their vertices, and you end up with a model that has an internal face.

If you look closer you’ll see that that results in a shading seam, i.e. on the shin and foot:

…and with the internal face on the shin removed (but the one on the foot is still there):


(I’ve no idea why my screenshot software captured a piece of another window here).

Same goes for the rest of those internal faces. The same happens with the pistons, only they end up not with just one face, but with all faces “mirrored” on top of one another. This does not only cause shading problems, it basically creates “impossible” geometry.

1 Like

What Stan_Pancakes said, and you can also get them by editing normals directly via the Mesh -> Normals menu in edit mode. You can make them visible in the viewport overlay dropdown, Normals (at the bottom). It’s the middle button with the tooltip “Display Split Normals”.

1 Like

Cusom normals are also created by harden normal option in bevel modifier. You usually can fix issues by reordering mirror modifier to be on top (first in stack):

(in this example top object has mirror modifier first and bottom one last but otherwise they are identical)

bevel_harden_normals_mirror_mod_example.blend (180.0 KB)

1 Like

Ok! I got it! Thanks for the reminder!
I remove the inner face and the artifact disappear.
Actually the artifact happens because I’ve messed up my mesh.

Actually I prefer to connect the outer face and inner face with a horizontal edge, so I try to correct the mesh by extruding. The result turn out to be as below:

According to these modified meshes (in which I haven’t delete the inner face but it turn out to be fine), if I want to connect them horizontally and ‘clipping’ checked (in mirror modifier), whether deleting the inner face or not seems to make no difference for the shader. I know the geometry is wrong, but will it make any trouble afterward in this case?

@Sanne Thanks! I’m just wondering which step might I make the custom normal. But still, I appreciate your reminder!!

@Format64 Thank you! Great example and modifier combo!
I still have little idea about how to be an expert in modifier and make the combo practical in modeling, will spend more time to better my use of them to keep low poly!

Yes, this will come back to haunt you sooner or later. BTW, if I correctly understand what you did to fix it, you actually made it worse, as you now have the whole model overlapping twice :wink: But, at least with this approach you can just enable the Bisect option for the Y axis, and the modifier will cut away one half of the model for you and get rid of overlapping.

1 Like

Thanks for your reply!!

I’m not pretty sure what makes it worse if I just make those edge in blue mark as horizontal as the green mark below.

‘Bisect’ helps! It helps if the model surpasses its side of mirroring, but for those inner face right at the mirror(I make them at exact there by check ‘clipping’), I find it ok after applying the modifier.

I do an experiment as below. For those inner face marked by blue, I make them surpass the mirror (which makes overlapping faces and edges); for those marked by green, I just leave them at the mirror by clipping previously.

The result after applying as below(I delete some outer face to make it clearer.) There are truly troubles for the blue part since there are actually two geometries for where should be only one(viewable at the last picture). But there is only one face(rather than two overlapping ones) in the green part, which makes it just one geometry(with a normal extrudding).


Not sure if it’s true, but I have a personal conclusion here: ‘bisect’ helps to cut out the other side of geometries and make the modifier-applied mesh perfect. But if ‘Bisect’ unchecked, those faces right at the mirror behaves fine as extruding (rather than two overlapping faces) after applying the modifier, while there will be troubles for those geometries surpassed the mirror.

No, they do not behave fine. They’re overlapping :slight_smile: In the case where you “surpass the mirror” without Bisect, there’s effectively a hole in your mesh, you just can’t see it. And there are literally double cylinders on top of one another. But whatever, don’t say I didn’t warn you :wink:

Sorry for late reply.
I do appreciate your help and will try to figure out what do you mean.
Thanks a lot!!!