Rendering glass and water together

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
josephmcs
Posts: 20
Joined: Mon Feb 01, 2021 7:02 am

Rendering glass and water together

Post by josephmcs » Tue Jun 01, 2021 5:59 am

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
Attachments
material forum test.png
Screen Shot 2021-06-01 at 1.51.03 AM.png
Screen Shot 2021-06-01 at 1.50.51 AM.png

User avatar
Sharlybg
Donor
Posts: 2783
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Rendering glass and water together

Post by Sharlybg » Tue Jun 01, 2021 8:02 am

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.
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA

josephmcs
Posts: 20
Joined: Mon Feb 01, 2021 7:02 am

Re: Rendering glass and water together

Post by josephmcs » Tue Jun 01, 2021 3:54 pm

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?

Martini
Posts: 104
Joined: Fri Nov 23, 2018 11:36 am
Location: Australia

Re: Rendering glass and water together

Post by Martini » Tue Jun 01, 2021 4:43 pm

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: https://forums.luxcorerender.org/viewto ... 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.
i9 9900K @ 5000MHz | 2x Gigabyte AORUS RTX 2080 Ti Extreme Waterforce WB 11G @ 2010MHz
Z390 Aorus Pro | 32GB Kingston HyperX Predator RGB @ 4300MHz

Post Reply