Cycles: Add option that makes background visible through glass have alpha transparency

Authored by Lukas Stockner (lukasstockner97) on Oct 29 2017, 4:27 PM.

Diff Detail

rB Blender

I like the general idea, but if you don't mind I'll make some tweaks/optimizations in the implementation.

  • Small optimizations, mainly using new LABEL_TRANSMIT_TRANSPARENT to avoid passing around roughness.
  • Make it work with shadow catcher (and holdout) behind glass. This feature will often be used together with a shadow catcher.
  • Fill environment (background) pass behind transparent glass, so that it can be composited back in to get the complete render.
  • Split into two properties "Transparent Glass" and "Roughness Threshold" (defaulting to 0.1), to try to make the UI more intuitive.
  • Use squared roughness for the threshold like the principled BSDF. For 2.8 we should change the other BSDFs to this roughness convention as well, we might as well use it already as there is no way to be consistent with all BSDFs.

Here's an example together with a shadow catcher.

Sergey Sharybin (sergey) requested changes to this revision.Dec 6 2017, 3:45 PM
Sergey Sharybin (sergey) added inline comments.

Either call it bsdf_get_square_roughness which is explicit and easy to read, or follow general Blender style and use _sq.

Would really suggest the first one.


You can not assign non-square value to a square one.

Surely, kernel_data.background.transparent_roughness_threshold is likely storing squared value, but this is not what the name suggests and this line reads as a bug.

This revision now requires changes to proceed.Dec 6 2017, 3:45 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 12 2018, 2:06 AM
This revision was automatically updated to reflect the committed changes.