5
$\begingroup$

Say I put Blender's iconic monkey inside a glass sphere (hollow, but solidified around its exterior). All lamps and camera(s) are outside the sphere. Using Cycles.

What I want to accomplish is for the sphere to get rendered as an "ordinary" glass object, whereas the monkey inside of it gets rendered identical to the way it would get rendered if the sphere around it did not exist at all. (Most of all, I want to avoid the dimming effect the glass would otherwise have on the monkey's (diffuse) surface brightness).

Is this doable? By using the Light Path input in the node editor perhaps? Or maybe by compositing two render actions into a single image?

$\endgroup$
4
$\begingroup$

Yes, this is possible.

To do this, we can make a glass material which allows some light rays through without refracting them based on certain conditions.

To get a good idea of which rays we want to let through, it's a good idea to try and visualize the possible ways rays could bounce through your scene (at least up to a few bounces):

enter image description here
This diagram doesn't show all possible light paths for three bounces, this is just for demonstration purposes.

I've highlighted the ray which we want to ignore in order to illuminate Suzanne as if the glass sphere wasn't there in green. Keep in mind that rays travel from the camera.

So as a solution for this particular case, you could create a node setup that ignores rays which:

  • Have bounced a maximum of once
  • Are not transmission rays
  • Are colliding with the inside of the glass

enter image description here

Result (200 samples):

enter image description here

For comparison, here's the same scene rendered with just a glass shader (2000 samples):

enter image description here

$\endgroup$
  • $\begingroup$ Interesting node logic. Thank you very much! Would you mind sharing the blend file with which you rendered the above output (unless such requests are frowned upon here)? I tried to reproduce it myself, but some parameter(s) must be in the wrong ballpark somewhere ...I'm still a bit of a Blender noob to be honest. $\endgroup$ – Will Sep 15 '15 at 9:46
  • $\begingroup$ A belated thank you for the .blend file. I think what I lacked was your use of a large emitting plane with no camera ray visibility, and turning on the subsurf modifier. Learning a lot here! :) $\endgroup$ – Will Sep 17 '15 at 0:21

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.