[Contribution] NPR nodes in EEVEE

From what I heard, EEVEE does not support limiting lights by groups, and it would be difficult to support performance wise. This is understandable if you consider indirect lighting effects: all the data will probably have to be computed for every light group in use. This is why I’m suggesting a special NPR-directed node that only sees lamps and only does the shadow check and very basic shading computations, so that it would maybe be easier to implement.

In BI it was possible to limit lights seen by a material using a group, and limit per lamp which objects shadow its light, so I feel that without this Eevee won’t become its fully featured replacement.

1 Like

I see now. So EEVEE will not be supporting light groups? Does Cycles support it? Seems that it’s a basic feature that lighters use all the time. Like Light Linking in Maya. I will look more into it, thank you for mentioning it!

The maker of Eevee said in IRC that it’s not supported and would negatively affect performance, but he may look into it some day, or something like that. Cycles doesn’t support it either.

Light hacks aren’t physically realistic, so it’s kinda understandable that engines that aim for PBR won’t put supporting it as any kind of priority.

About Split Shader, I think it’s fine to have a convenient NPR shader with various features builtin, like we have Principled BSDF and Principled Volume. But then I think it should be usable as a single shader node, if you have to manually plug in Diffuse BSDF and Emission it’s quite low level and then you might as well start using shader node groups.

Also what is available in the properties editor is not really a good reason to choose a design, that can always be improved.

I see what you mean but in this case I have to disagree. Uber shaders are not flexible enough. You are limited by the implementation. What I aim for is to bring back what is possible in BI, which is make-your-own toon shader. Sometimes lower-level is best (but not so low level you have to plug in math nodes and do dot product).

Case in point, nobody used the built-in Toon shading in BI. Standard practice was to use ramps and roll your own. Toon BSDF in Cycles is also very very limited.

How would you propose an uber Toon shader would work? How would you specify the amount of slices? I don’t think Blender nodes can dynamically chamge number of socket. Not to mention NPR is broad enough that having, say, a Principled Cel Shader would be limiting what’s possible.

@angavrilov That’s a little unfortunate that light groups won’t be supported. Lighters doing realistic renders use them all the time, even if it’s realistic. Sometimes you need to cheat a little (^^)

Uber shaders are good for PBR precisely because there’s only one ideal physically realistic result and all shaders are aiming at it.

One problem with Toon shaders in both Cycles and BI is that they add up lights like usual, and moreover do that after the slicing, so you can’t use multiple lights to fill in lighted areas without destroying the proper look. What you likely need there is max of dot product for all of the lights, then slice; hence the Use Maximum option in my node mockup.

Another developer just submitted a patch for a “Shader to Color” type node:
https://developer.blender.org/D3190

@brecht I’ve finished the implementation for this proposal. Should I submit a new patch or update the one Kinouti made?

2 Likes

It’s best to submit a new patch.

Nice render tests!

1 Like

So here’s an update. The Shader to RGB node was accepted into trunk after working with Clement to fix it up, but it was suggested that I implement the other two nodes as node groups and submit them as an add-on. This is now done, but I am wondering about what the best way to make an add-on that makes node groups available would be. As far as I know, node groups are usually distributed in .blend files.

I suppose I could make an add-on that appends them into the scene upon opening a scene, but that seems like to mutch of a messy hack. Any ideas?

Thank you for all the hard work you’ve done! Fair winds for the rest, too!

I don’t know the details but I was under the impression that part of 2.8 development is “Amber” an asset management system for Blender. (Or I guess part of 2.8 is creating the infrastructure for asset management and Amber is the proof-of-concept asset manager?)
Either case wouldn’t custom nodes make perfect sense as “assets”?
Though, looking at it I haven’t heard of Amber in awhile and it seems like Amber isn’t meant to be end all asset management system for Blender… So I guess even if that would be eventually the best solution at the moment it isn’t really helpful :confused:
Between that and making an add-on that appends them in I can’t really think of anything better, though u _u

@3Rton See that’s the thing, usually node groups are distributed as just .blend files but I feel that it’s very important to have these be in Blender somehow. Split Lighting especially is as important in NPR as Mix Shader and Add Shader are for PBR. Without it people will just use the ramp node which is a pain to use.

@brecht What do you think is the best way?

I don’t really disagree with the importance but if they say they won’t accept it in master than what can one do. ¯_(ツ)_/¯ I’ve only been stalking the mailing list and bug tracker and I don’t really understand why not just add them to the master but they probably have a fair reason.

I think NPR shader node groups would fit well in the asset manager, and we would like to have it in Blender 2.8 and ship assets along with Blender. That would also let us include a wider variety of NPR shaders, not just a basic split shader.

The only problem is that it’s not 100% certain the asset manager will be finished in time for the first released 2.8 version. I think it’s likely and if not it should happen soon after.

1 Like

In that case I will make a simple .blend file that has the two node groups (and perhaps include some completed shaders that use them) and distribute it. And when the asset system is done I will contribute it there.

Also just to explain, the Split Lighting node is not just a basic split shader, it’s more like one ‘peg’ of a ramp node. You can chain them together to create a full shader, change the blur, and plug in textures to affect the split point and blur. It’s better than the ramp node because it allows you to wrap up a toon shader completely in a node group, among other things. The ramp node is great for certain things but as the backbone of an NPR shader it’s very cumbersome and limited. This is why I originally wanted to get it in as a proper node.

I hope this topic fits in here as it is about NPR with EEVEE in Blender 2.8 and future versions.

We did some intensive work with advanced toon shaders that included the use of Freestyle for outlining. Unfortunately this didn’t work in Cycles using a panoramic equirectangular camera for VR rendering.

Are there plans to include Freestyle in EEVEE without the restriction regarding panoramic cameras? Or would there be another way to create freestyle like effects in EEVEE without freestyle (which also allow panoramic renders?) Could this be part of the 2.8 Code Quest as well?
Thanks for your feedback.

EEVEE itself doesn’t support panoramic renders, so it is a bit early to talk about that. And definitively not something we can afford to prioritize during the code quest.

Sigh… Thanks for the reply Dalai. … So patience is our ally.

What I’ve seen so far from all the video updates from code quest you are all doing an amazing job and I can’t wait to get Blender 2.8 for my art.

Keep up the great work and have fun!