Page 1 of 1

Rendering glass and water together

Posted: Tue Jun 01, 2021 5:59 am
by josephmcs
Hello all,

I'm having a problem that can be seen in the attached screenshot. Screenshots of the node setups too.

I've modeled a glass vase and want to put a floating orb of water in it.

Right now, the water orb gets very dark if it's behind the glass of the vase.

I've included a test orb to the left that shows the regular way water is rendered.

Why is it so dark if and only if it's inside the vase? This was also the case when I tried a more traditional volume that looked like water filling the vase.

Thank you

Re: Rendering glass and water together

Posted: Tue Jun 01, 2021 8:02 am
by Sharlybg
You first need to increase your specular value to something like 24 or higher.
And set the volume priority of glass vase higher than water sphere.
Currently you set them all at 0.

Re: Rendering glass and water together

Posted: Tue Jun 01, 2021 3:54 pm
by josephmcs
that helped, thank you so much.

Just curious as I figure out the logic of it: why would the volume priority of the glass be higher than that of the water? because it's closer to the camera?

Re: Rendering glass and water together

Posted: Tue Jun 01, 2021 4:43 pm
by Martini
josephmcs wrote: Tue Jun 01, 2021 3:54 pm Just curious as I figure out the logic of it: why would the volume priority of the glass be higher than that of the water? because it's closer to the camera?
Priority determines which volume "wins" when they are overlapping. You want the glass to take priority over the liquid, because the glass should always displace the water; the water cannot be 'inside' the walls of the glass. The volume with the highest priority replaces all the others - they don't mix.

What this means is, that your glass should have real thickness (glass outside, and air inside, usually an opening at the top). If your glass object is an enclosed solid with only outside faces, then you probably need to invert the volume priority, so the water can actually exist in the area occupied by what would otherwise be just the glass volume.


See here for the correct way to do it: viewtopic.php?f=4&t=728&hilit=glass+vol ... rity#p7550

Image


Increasing the light path bounces is necessary because each time a ray from the camera passes through a surface (or reflects off it), it counts as a specular contribution. The BlendLuxCore default is 6, so when you have multiple overlapping transmissive or reflective objects (like glass and water), it's easy to reach the limit, and then things start getting dark: Air->glass(1) ->air(2) ->water(3) ->air(4) ->glass(5)->air(6) and that does not even include reflections.