2
$\begingroup$

So I am making something for a video overlay. It should be semi-transparent to allow some of the video to be seen through it.

This was not a problem at first. The item was a glass ellipsoid with text (opaque) and other objects (opaque) in front of it which casts shadows and reflections. Using glossy surface and playing with roughness and also adding a transparent shader (mixed shader) did the trick.

Now the project includes putting something opaque behind the glass which should be diffracted through it.

Transparent shader does not diffract what is behind it. The glass shader does but once it is introduced, I lose all transparency in the glass.

Adding a mixed-shader with transparency gives a diffracted and non-diffracted view of behind. Adding a mixed-shader with holdout makes the ellipsoid and its diffractions semi-transparent, even so the opaque object is now semi-transparent (though the glass). Also tried refraction shader. Same issue as glass.

What I am trying to do is make anywhere where no light hits the glass (environment transmissions/reflections, refractions) are all transparent but opaque objects in front and behind the glass are still opaque.

Blender 2.73a, Cycles. Nodes.

$\endgroup$
1
  • $\begingroup$ Screenshots please? $\endgroup$
    – J Sargent
    Feb 25, 2015 at 20:54

1 Answer 1

5
$\begingroup$

One way you could do this is by using a sort of "greenscreen".

  1. Add a big sphere which encloses the entire scene, and give it a material which will only be visible when seen directly through a transmissive material. Also disable visibility for unwanted ray types:

    enter image description here

  2. Put the sphere on it's own layer (I put it on layer 2), and create a second renderlayer which excludes it:

    enter image description here

    The first renderlayer is identical except for the Exclude setting.

  3. Use the compositor to turn the green channel of one renderlayer into the alpha channel of the other:

    enter image description here


If there is already red green and blue in your scene, you could try using the compositor to turn the difference between the two renders into transparency:

enter image description here

However you may need to tweak things to get it to work as desired.

$\endgroup$
4
  • $\begingroup$ This seems to be exactly what I need but the level of the transparency is so weak (but there and appears to be just what I am looking for). How do I control the level of the transparency? (I have been trying for an hour with no luck yet). Nevermind. Intensity of the emmission of the outer sphere. THIS IS PERFECT!!! (Yes, I was shouting... in excitement). Thanks. $\endgroup$
    – Logics
    Feb 26, 2015 at 23:28
  • $\begingroup$ @Logics The method I used convert the green to alpha was a bit flawed (it was too dim as you noticed and it got some alpha in the wrong places, if you look at the bottom right corner of my previous example image). I've found a much better way now (updating answer). Increasing the intensity of the greenscreen will work, but it's a bit of a workaround. $\endgroup$
    – gandalf3
    Feb 26, 2015 at 23:36
  • $\begingroup$ Actually, your first method is better and I will tell you why.: My sphere (or ellipsoid) was to be blue. The scene was lighted by two lights, one green and the other magenta (producing white light on rough surfaces but green/magenta reflections on glossy surfaces). With the blue ellipsoid and the green environment, I got no transparencies. With the environment white, everything turned out perfect. I did not try your second method but it appears from following the logic that it is indeed a true "greenscreen" method which would affect green objects'and blue glass, etc. $\endgroup$
    – Logics
    Feb 27, 2015 at 0:03
  • $\begingroup$ @Logics Good point, I've added both methods to my answer $\endgroup$
    – gandalf3
    Feb 27, 2015 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.