Accurate liquid in glass rendering

Could you break this convo out? I agree that it is off topic, but it’s a good conversation.

This method is old, faked method and only works with thin glass. Real method is be close as possible as glass surface, but not touch.

It’s not fake, it models things as they should be. Some other render engines support these situations, they’re called nested dielectrics. → https://www.sidefx.com/docs/houdini/render/nested.html#nested

Are we reading the same article?

That is not how fluids work, there isn’t a tiny airgap

the interface has it’s own IOR. the IOR is a ratio of the density on either side of the interface.

Cycles has nested dielectric feature?

No, that’s why you need to do some manual intervention and setup the interfaces and their materials.

from left to right: separated interface surfaces, inset fluid, overlapping fluid

2 Likes

Very interesting. separated interfaces make a huge difference in refraction behind the fluid, and it’s lighter colored. Do you use absorption for the fluid material setup?

I have a separate absorption volume object slightly inset.

With the separated interfaces, the normals are pointing in different directions, so you can’t use a volume shader in the water shader.

But this is not same thing.

Same as what?

Nested Dielectric.

The problem with this article is that he simply doesn’t mention that if you use that method you need to forget volumetrics. So, accurate, but not, No volume absorption, no volume scattering. No volumes at all, just shader diffuse tint. How realistic can that be?

It’s a corner case with a lot of the same physics

No, I imagine nested dielectrics needs to happen at the integration stage during path tracing, I guess each ray must carry information about its current medium to figure out the right IOR calculation if encountering a refractive surface (actually, reflective as well). It’s not something you can whip up in a shader, although the alternatives posted above look really good. Maybe, and I mean maybe that whole “delete intersecting geometry and create single interface material in its place” can be done in geonodes. It sounds like it would “just” be a matter of detecting intersecting or touching surfaces and merge them, assign a new material, all procedurally. I’m always looking for excuses to plug geonodes, I know sorry

Noop. Did you read what is nested dielectric?

As I said, this method creates fake result, but refraction still will be wrong. And absorption possibly would not work. And for animation and simulation, this method totally useless. Nested Dielectric must be in the Cycles code.

Please explain how your technique of creating a small airgap between the water and glass is better.

Folding your arms and saying no isn’t a good way to prove your point. I made a test scene where I followed the advice of that article I posted, I demonstrated how it works and you have just said no.

Prove how effective your system is. How well does it work for animation? You just seem to be constantly moving the goal posts and it’s annoying.

I wrote. Nested dielectric must be coded in the Cycles code, you can not simulate in the shader setup.

Agreed, which (again) is why you have to manually setup the interfaces, like I have done, which you are claiming is a fake result.

Given that cycles doesn’t have nested dielectrics, the technique I have shown is the best way to get accurate refractions. Absorption does take some extra work, but can be overcome with a separate volume.

Yes, it won’t work for animation. Just in case you want to bring that up again.