Cycles: Compile "specialized" shader graphs for transparent shadows and emission
Needs RevisionPublic

Authored by Lukas Stockner (lukasstockner97) on Dec 3 2017, 3:42 AM.

Details

Summary

Currently, for transparent shadows and mesh emission, the full shader is evaluated even though only the transparency/emission values are used.

Therefore, this patch makes Cycles compile additional graphs where all irrelevant closures are removed and uses these instead for evaluating transparency/emission.

Unfortunately, I didn't really notice any significant speedup, but I figured I might still upload it in case I just overlooked something or someone has an idea how to improve it.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 1011
Build 1011: arc lint + arc unit
Sergey Sharybin (sergey) requested changes to this revision.Dec 6 2017, 2:52 PM

Ok, here are the points:

  • Don't see any explicit issues in the code.
  • Don't really have strong points on why is it not faster (but see the brainstorm below!)
  • Current patch only introduces complexity, without benefits. So wouldn't apply it to master yet.
  • To keep code review page in manageable state, requesting changes so the patch does not appear in "Needs Review" for until it's really ready.

That being said, not saying it's a bad/wrong patch, just trying to bring patch review tracker back to a manageable state. Here goes the brain storm.

What scenes did you test this on? I would imagine, that you really need to have some complex shader in non-transparent path in order to start seeing measurable difference.

Did you verify that the SVM is all correct after the changes? Maybe it still interleaves some unwanted closures for shadow shader

This revision now requires changes to proceed.Dec 6 2017, 2:52 PM