Lighting Error with 2.81 (NPR / Inverted Hull / Cell Shading)

Hiya BA!

I just switched from 2.8 to 2.81 and some of my lighting/materials got messed up. I’m really not sure what the problem is and I need some help :sweat_smile:. Here are a few pictures:

So this is the base model:
Screen Shot 2019-12-15 at 2.50.38 PM

This is in material preview which is great and what I was looking for:

This is in EEVEE rendered mode. You can see there are weird artifacts that look really ugly:

Modifiers on the icosphere (inverted hull method):
Screen Shot 2019-12-15 at 2.50.45 PM

Main material:

Hull material:
Screen Shot 2019-12-15 at 2.51.52 PM

I would love any suggestions, because I’m really confused. Everything was fine in 2.8, so I’m not sure why it’s messing up in 2.81. Thanks BA!

~ Para :heart:

1 Like

Hello - I am not able to re-create what you have based on the information given, but here are some thoughts: I had to look up “inverted hull method,” and tried in 2.81b.

First, make sure that backface culling is enabled under Material:Settings. This seemed to fix things for me.

Also, I would change your main material and put the color ramp before the shader. Attaching a color directly to a Surface Material Output does not seem reasonable (although I do not know what the “Shader to RGB” node does - this is the first time I’ve noticed it). Also, the color ramp could be replaced with a solid RBG input since there is no input into the color ramp to change its output (i.e., mapping to the UV, using the z coordinate of the object, or any other possible method to distinguish where on the color ramp to use.) Currently, the input into the color ramp is a single , unvarying value.

Other notes: This is minor, but you appear to be using a round cube, perhaps, and not an icosphere which is all triangles. Also, you show a subdivision surface modifier, but your images do not show its effect (the object should not have sharp edges using catmull-clark method).

1 Like

Hey @Phil_n,

I made a mistake by calling it an icosphere :sweat_smile:; it is actually a cube with sub surf. Also, the inverted hull method is a way to get cell shading, using a “hull” to create a black outline. That’s done through the solidify modifier I provided. Also the Shader to RGB node takes in a shader and converts its lighting properties into a “flat” shaded material, as seen here:

https://twitter.com/andrewpprice/status/1138664835271389184?lang=en

So your suggestions don’t really solve my problem I’m afraid.

Strangely, the problem gets worse with more complicated shapes and when in perspective mode. Huh

Material Preview (How I want it to look)
Screen Shot 2019-12-15 at 6.02.21 PM

EEVEE
Screen Shot 2019-12-15 at 6.02.14 PM

You can’t connect a color to a shader input, you need another shader in between

1 Like

Hullo @Hadriscus,

I’m prettyyyyyy sure you can haha. At least that was the case in 2.8:

~ Para :heart:

Hi - This also explains the “hard” edges on a sub-surfed object - it was a simple cube. I suspect it might have to do with your lighting set up. Maybe try starting with a blank file and just the basics.

That is what I did here: https://youtu.be/VroJFIX3R60

I cannot say enough how great Eevee is for quick renders!

1 Like

I guess Eevee is being clever here but better be safe and connect sockets in a way that makes sense.

1 Like

I felt the same way, but in Blender, as in life, you can do anything as long as it works :slight_smile:

1 Like

A bit more digging later, I can confidently say I still don’t know the problem. The issue appears to be with overlapping normals/backface culling.

With solidify off:

Screen Shot 2019-12-15 at 6.48.01 PM

With solidify on:

Screen Shot 2019-12-15 at 6.48.05 PM

It doesn’t appear to have anything to do with the lighting setup or the materials themselves. Just the solidify modifier. Weird

Hi Paragon. Blender stylized NPR lover and creator here. Please upload a .blend file from here: http://pasteall.org/blend/
I want to solve your case.
It´s most likely 3 factors. But if you can´t upload, please check the solidify modifier with the offset and material index offset. I´m pretty sure the issue can be addressed.
This topic you´ve posted it´s been asked countless times on my socials as well, so I´m doing a video about it.

1 Like

Here you go, @PierreSchiller!

ErrorNPR.blend (634.2 KB)

I’m really not sure what the issue is, because this worked perfectly in 2.8.

Don´t worry. Our operators are working hard to ensure to find the issue. Please hold the line.

1 Like

Evaluating your file sir. Please just hold on a few minutes.

1 Like

We’re checking the light caching and shadow issue. It´s most likely a bug. Let me identify this for you, sir. Thank you for holding the line.

Found the error: Non-normalized faces. Corrected with “smooth faces” (right click menu over object).
Also, bumped to 4k, shadow parameter’s box on SCENE level (not material level). Activated back cull only on Material properties.
Here´s the video.

Thank you for calling 1-800-I love Blender. Remember: our community is eager to help you. Have a great day.

1 Like

Hey David,

Do you think you could upload the .blend file? I’m not really sure what you changed, because I did enable smooth faces. Not really sure what you did differently.

~ Para

After staring at my screen for wayyyy too long, I finally fixed the problem. The issue was that the hull material was casting a shadow on the base material. This problem can be solved by switching the shadow mode for the hull material to “none”. Leaving this as a solution for anyone who comes across this issue while making NPR materials. Really big thank you to @PierreSchiller, @Phil_n, and @Hadriscus for sitting through my stupidity :sweat_smile:.

Screen Shot 2019-12-15 at 10.06.59 PM

Screen Shot 2019-12-15 at 10.07.23 PM

Thanks BA!

~ Para :heart:

1 Like

Really just wanted to advise on best practices, glad you sorted it out.

Hadrien

1 Like

Hey ParagonProductions, just wanted to say thank you so much for finding this solution! I’ve been getting pretty annoyed about this too, initially fixing it by increasing Shadow Bias on the lights, but your solution is much cleaner. Appreciate it! :slight_smile:

1 Like

Really late to this… but tysm!! :heart:

~ Para