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: 30
Joined: Mon Feb 01, 2021 7:02 am

Rendering glass and water together

Post 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
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
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Rendering glass and water together

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

Portfolio : https://www.behance.net/DRAVIA
josephmcs
Posts: 30
Joined: Mon Feb 01, 2021 7:02 am

Re: Rendering glass and water together

Post 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?
Martini
Posts: 125
Joined: Fri Nov 23, 2018 11:36 am
Location: Australia

Re: Rendering glass and water together

Post 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.
AMD Ryzen Threadripper PRO 5995WX 64-Cores | 2x Gigabyte RTX 4090 Gaming OC
ASUS Pro WS WRX80E-SAGE SE WIFI | 256GB Kingston Server Premier ECC Unbuffered DDR4
Post Reply