Layered Shaders?

Can I do layered shaders? As in, when light hits a layer, any reflection goes back to the camera, while any absorption goes to the next layer? I’ve tried this with “layer weight” nodes, but can’t quite get it to work. Thanks,

–Saib

Yes and no.
No: In Blender you can’t modify (i.e. recolor) data that has gone through a shader.
Yes: You can stack how many shaders you want usually through Mix Shaders.

Normally you’d stack through “Mix Shader” node and set a blend value. If you have good control on the inputs to various shaders, you can also use “Add Shader”, but you have to keep an eye on energy levels yourself here. Unless you know exactly how to utilize it, just stay with the Mix Shader and all should be good. Basically you can’t go wrong with Mix Shader, but Add Shader can blow up in your face. I.e. white gloss mixed 50% with white diffuse is okay, but white gloss ADDED to white diffuse gives you superbright, which normally is not what you’re looking for.

So yes, you can do layered “shaders” (as in, the nodes with green outputs), but you cannot layer “materials” (as in, what you apply to an object). However, the node shader system is flexible enough to allow most common things. The only drawback is that it can get kinda messy sometimes in complex setups.

Layer weight node is angle based weighting, either through a 0-1 fresnel or a 0-1 facing value, which you can then tweak further with math nodes, curves or whatever, before it usually controls a mix shaders fac input.

Edit:
Example image on various blends of a coating “layer” which consists of 16 layers in itself, in addition to the diffuse. Note in the 0.5, 0.5 one how the sharp reflection of the building is visible in the coat. Extremely visible in the 0.25, 0.85 one. And barely visible at all in the 0.25, 0.75 and 0.1, 0.9 ones, but here the blurred (inner) gloss is clearly more visible. A post on how it works can be found here, although that one only has 4 shellac layers, so a gradual transition from very blurred reflections to sharp ones would be visibly more pronounced. That’s why I did 16, which does increase rendertime significantly :slight_smile: