3

I want to make a mirror surface that is invisible, but still shows reflections. I found this nearly identical question but the only answer didn't work for me. It works great normally, but when I set the film to be transparent, the reflections disappear along with it: The weird thing is that it looks fine in the 3D view:

My materials set up is exactly the same as in the question I linked above, with a transparent and glossy shader added together:

So is it possible to have both a transparent background and a transparent reflective surface in cycles at the same time? Should I work around it with some compositing?

Burritosaur
  • 193
  • 2
  • 9
  • 1
    Check your rendering settings and your output image format. Make sure it's PNG with an alpha channel. – Jaroslav Jerryno Novotny Dec 07 '15 at 18:44
  • 1
    Related: http://blender.stackexchange.com/questions/36681/why-this-material-doesnt-render – Carlo Dec 07 '15 at 18:50
  • 1
    Can confirm: it's a PNG with an alpha channel. Something else that might be worth mentioning is that when it's in the process of rendering a tile that has a bit of reflection, the reflection will show up, but it disappears by the time it finishes rendering the tile. – Burritosaur Dec 07 '15 at 18:51
  • 1
    This is a known bug: http://blender.stackexchange.com/q/32900/599 – gandalf3 Dec 07 '15 at 19:19
  • @Carlo So how do I get it to show up the same way rendered as it shows up in the 3D view? I can't use a mix shader and hijack the texture's alpha value because I'm not using a texture, and I'm not sure I understand the Greater Than trick he's using because it's not doing anything when I'm trying it. – Burritosaur Dec 07 '15 at 19:21
  • Ended up using fancy node setups and compositing to take care of it. To be perfectly honest I have no idea what I did but it appears to be working. Pretty much sums up my whole experience with blender and computers in general lol. – Burritosaur Dec 08 '15 at 05:39
  • 1
    @Burritosaur it would be helpful for other users who have the same question if you wrote an answer detailing how you worked out the issue and shared your "Fancy node setups" –  Dec 10 '15 at 17:11

1 Answers1

1

In the end, I went with compositing an opaque background image underneath the transparent layer and that worked alright, but before that I used this node setup to set the alpha value based on the value of each pixel.

The Subtract node is used as a minimum threshhold. You might have to tweak that depending on your setup.

The first Multiply is just a messy way to get a definite 1 or 0 on whether or not the pixel should be visible or not.

The second Multiply is used to set the final alpha value for the partially transparent pixels.

The Add node at the end is just to make sure that no previously-opaque pixels become transparent.

In my case it ended up looking like this:

Burritosaur
  • 193
  • 2
  • 9