5

I am trying to create a shader that renders visible when looking at it from behind another invisible object, and vice versa. However, when the object is supposed to be invisible, it renders a black artifact in it's place. Is there any way to get rid of this and simply keep it transparent?

enter image description here https://i.stack.imgur.com/M6eRZ.jpg

Myristica
  • 143
  • 5

1 Answers1

6

I believe the issue you're having is due to a circular dependency. You're counting the number of Transparent Shaders the ray is passing through, but what happens when the material that that number depends on is a Transparency itself? I believe that's why Blender creates a Null shader.

You can do something similar with a Glass Transmission Shader set to IOR of 1.0 for your "transparent window" thingy. Disable everything but Camera in the Cycles Setting:

enter image description here

Then instead of Transparent Depth, just use the Transmission Depth input for your object:

enter image description here

enter image description here

bertmoog
  • 6,106
  • 2
  • 19
  • 37
  • I have a question that I feel is a bit relevant to the discussions here. I wonder could you please take a look at my question here? I basically want to render depth maps or surface Normals by somehow ignoring the transparent materials. Do you think that's possible? – Amir Feb 25 '18 at 00:52