More robust NPR lighting system request

Some context:
I ran into an issue today where I wanted to set a lamp to only affect one object in my scene. I found a workaround in Eevee that did the trick nicely. I set the lamp to have a custom distance, just long enough to light the objects I wanted to light and nothing else. I then decided to go with a Cycles render and tried doing a similar technique using the “light falloff” node. I couldn’t get a satisfying result so I went back to the drawing board and decided to look into “exclusive lighting” to stylize my lights. I found that I can set up render layers to achieve this effect, but it is a somewhat involved process and would get messy if I were to use this technique for a larger scene with many stylized objects such as a cartoon or cel shaded animation.

My suggestion:
The ability to include/exclude lights from either a collection, object, or material, would go a long way to give more creative control to the artist. I understand that Cycles is a photorealistic rendering engine but, with the absence of Internal render and the technical limitations of the Eevee lighting system, it only makes sense to add more NPR options to Cycles for use cases like this. This is not the first time I’ve needed to do something like this, and from my internet browsing, I don’t seem to be the only one missing a feature like this.

Hopefully we can one day have a lot more control over our lamps so we can more easily achieve results like this: Guilty Gear GDC - “Controlling the Lighting” (via YouTube). Would be great to see this in Eevee, too, considering it can be done in other game engines such as Unreal Engine.

There is already the light group task ⚙ D12871 Cycles: Light Groups
Maybe this feature will be integrated in 3.2

Fantastic! Thanks for the task tracker.

Yikes this is a tough job to do in terms of programming, on the Task Tracker.
this probably would be considered a full rewrite now for Cycles-X/Blender 3.0

The only way to do NPR is with fake lights, not actual lights, and consequently to use only Emission shader.

The math part, I made it up, I just only show the technique. For more proper and standard NPR you will have to find a better node setup. I think there is a channel on youtube called Blender NPR and explains everything in super detail.

1 Like

Yeah running into this issue as well. MALT is really appealing but not everyone is willing to learn how GLSL works to do NPR. NPR is very interesting but definitely more interesting towards 2D artists and such or people who have no interest in VFX at all.

Unfortunately you can’t skip the complex technique behind it, your best bet is to look at it as a “black box” with the thinking of copying rather than understanding it.

There are lots of videos here related to Blender and generally NPR techniques.

https://www.youtube.com/c/BlenderNPR/videos

Most importantly these videos are focused only on the very famous “Guilty Gear” shader technique.

https://www.youtube.com/results?search_query=blender+guilty+gear

The reason is most importantly is that render engines of any kind, historically and architecturally were never meant to be used like this. As of the legendary raytracers at the time of the 80s or even the first raytraced movies in the early 90s. The NPR aspect is entirely alien to this kind of software design, as for example having a mathematic shading model (pseudo real > Phong, close to real > Global Illumination) and then try to do anything the opposite way to break all rules (fake normals, fake lighting, fake surface shading). However with lots of hack and trickery is super impressive to note that results have become acceptable and very pleasing.

The problem with a method like this (which I have tried) is that you lose out on shadows and especially self shadowing and the like. While a full rewrite would suck for the developers, currently trying to exclude lights from affecting objects is very difficult and requires a good knowledge of compositing or very custom node groups.

In the case of my scene, I wanted to add a slick sheen on one object in my scene. However, the lamp I was using to do this was leaving an ugly specular reflection on the ground and affecting things I didn’t want. My solution was to move my object and custom lighting into a separate render layer and render it over top of my other render layer. The downside is that the lighting doesn’t appear in the reflections of my base render layer. It works as a workaround but it screams “hack”.

Being able to utilize an “include/exclude” system for lighting would be much more beneficial as you can have shadows, specular, and everything else and choose which objects get influenced. Unrealistic for PBR and VFX scenes but good for motion graphics, anime, NPR and so on.

I found a new technique, it will allow you take a typical diffuse material which responds to light sources correctly and such. But then convert it to color and filter it through a color palette. Now you won’t need the Emission shader hack anymore.

I think that is much better option.

Experiments with NPR/Toon shading in Eevee - Tutorials, Tips and Tricks - Blender Artists Community

Now the next step is to do manual work on the shadow play in each frame. How the ‘guilty gear’ crew did the animation, was to have each character object have it’s own dedicated lights that would be manually and customized for each frame, to achieve draw-like shadows.

As for example 2D artists tend always to hit shadows on bottom left/right rims of the surfaces, is very subtle and surgically measured.

However if you don’t plan to go for such of a high level of fidelity you can go for more broad results.

I made an NPR asset pack years ago, before the “shader to RGB” node was created. They work in Eevee and probably work in Cycles. The issue is they also don’t use real lighting and are controlled by a normal value. They are also very heavy shaders and are by no means simple or optimized. I put a lot of work into them. These might work for this type of effect as lighting is controlled on a per material basis. Still, having direct control of real lighting setups would be MUCH better.

If you’re interested, here’s a link to the files. No copyright.

1 Like