Page MenuHome

Cycles: Adding a "No Override Layers" option
Needs ReviewPublic

Authored by Lukas Stockner (lukasstockner97) on May 5 2015, 2:29 PM.

Details

Reviewers
None
Group Reviewers
Cycles
Summary

This patch adds an option the the RenderLayer settings that allows to remove the material override from some layers.
This can be used for finer control over overrides, for example, to have a clay environment render with the fully shaded character.
The option is pretty self-explanatory, once an Override Material is set, the option appears below it.

Credit for the idea goes to @Lsscpp (lsscpp).

Diff Detail

Repository
rB Blender
Branch
finer_override

Event Timeline

Lukas Stockner (lukasstockner97) retitled this revision from to Cycles: Adding a "No Override Layers" option.

Hi Lukas, great to see you giving some time to this, thank you a lot!
As posted on BA, there could be another option for this, that is having the override driven by a group instead. What do you devs think is more appropriate?

Using a group would probably work, but

  • I'm not too sure how to implement it (BL::Object offers no function that gives a list of groups, so I'd probably need to loop over all groups somehow), while the layer code was quite obvious, so I did it first
  • Adding lots of different objects to a dedicated group is quite a lot of work, while you usually use layers for a loose scene structuring anyways

Of course, this is a personal opinion (and not a very strong one), so I'd be open to changing the implementation.

Both of the approaches is just an attempt to put compositor job into render engine, in a limited way and in general you'll still need to split scene into a bit more render layers and combine them in compositor (using several overrides and so on). So the patch does not really improve anything, it just makes render layers even more cluttered.

If such functionality is really heavily used in someone's production then it could be done via an addon which prepares layers/compo setup.

I think that a feature like this would be better than making two or more renderlayers and compositing just because two render layers mean two different renders in a row, which means more time. I don't know how blender works under the hood, I imagined that with material override there's some "switch material" at the end for every object, so I thought that it would be easy to just mark some objects to be excluded from this switch.

Overall I see having overrides as a handy feature, as well as having the material override itself. And not stritcly related to compositor job. It's a matter of workflow.
Why then not stating "just make a linked scene and replace every material", instead of having the Material option?

The thing is, while it helps you to not bother with compositor setup when you only need to do one override and ignore some of the objects, you're still in big trouble when you want to override with more than one material.

So at the end of a day you'll still need to split your scene into separate render layers and combining them in the compositor. Or, alternatively, having a pre-render hook which will do override via RNA.

At the current state the patch can't make it into master branch.

At least for the uses that came to my mind while writing this patch, one override is usually enough. For example, there is currently no way to render a "clay render" with activated mesh lights since their emission shader is also overridden. Multiple renderlayers and/or the compositor won't help there since the lighting itself is basically broken. With this patch, you simply move the emitters to a layer and set it as No Override.
Another example that was mentioned is rendering an ArchViz preview where glossy materials like mirrors are overridden to get a clearer render.

Of course, having multiple flexible overrides would be better. However, the question is how to implement it (and whether it's worth the trouble): A list where you can add overrides, each one with a material and a layer list where it's applied? IMO, this patch already improves the situation a lot, it might not be the perfect solution, but it's better than no control over the override at all.

Also, I can't really see where this adds clutter to the UI since the option is hidden as long as you set no override.

So, what would need to be changed so that the patch could go into master?

There are lots of cases when override of particular objects/materials is useful. The thing is -- i'm not convinced this indeed belongs to render layers settings, it's more like something more global. And in this case:

a) It is simplier to implement the feature as an addon, which you can extend really crazy and support all sort of rule-based override (so instead of using layer/group-based matching you can say "replace material A with material B" or "replace object which contains shader node A with material B")
b) Clay case mentioned somewhere above is already covered with Clay Render addon.

Of course, having multiple flexible overrides would be better. However, the question is how to implement it (and whether it's worth the trouble).

it is already implemented either involving compositor or some python scripts.

IMO, this patch already improves the situation a lot

It just adds a shortcut for one particular usecase and at the same time pretends to be more generic solution.

So, what would need to be changed so that the patch could go into master?

Implement it as really flexible solution, preferably rule-based (some ideas are thrown above).

I can see the hesitation for render layers but I have to fully disagree on the compositor route as this needlessly increases render times (images / passes).

For example right now I am rendering a show where I just want a light not to touch one specific object. In Maya you do light links.

I personally agree on the add-on idea and linking.

Ideally I should be able to specify material overwrites and also light links this way. Besides just turning the reception of one light off I am not sure if it is possible to via a mix value increase or decrease the amount of received light.