Liquid with different transparency (fastsss2)

Hi,

I have a project where is a liquid and bottom part of liquid is almost opaque but top part is more transparent. And a whole liquid is translucency like milk, diffuse, but very translucency, BUT TOP PART IS EVEN TRANSPARENT. How to do that ?

I wanna use FastSSS2 shader, because its great with amazing results, (milk preset is good enough) but I cant texture Scale parameter to set transparency more on top part, so what I have to do ?
please help

You can map the scatter radius parameter instead with a texture map (the black in the texture is radius 0.0, the white in the texture is the specified scatter radius value).

Bset regards,
Vlado

Here is an example (this one uses scatter radius of about 3000 cm and a gradient ramp map for the same parameter).

Best regards,
Vlado

Yeah, thats it man!!!

I tried it with different scatter radius, but i got some really ugly result. I try it again.

I dont know why, but it dont work :frowning:

What setting You have ? I think I have it right, but gradient is wrong.
I post a max file.
test.zip (51.5 KB)

Here is the scene for the image above.

Best regards,
Vlado
precipitation.zip (22.5 KB)

Thanks, I will look at it.

Oh, problem was a glass.

When I put a liquid object in a middle of inner and outer polygon of glass, I lose a transparency effect :frowning:

When I scale it down, transparency is good, but refraction is wrong, because liquid is not between inner and outer polygons. Is there any way to fix that ?


Yes, it appears to be a problem. Please email me to vlado@chaosgroup.com for a fix.

Best regards,
Vlado

Actually the problem was in the UVW mapping; both objects (the liquid and the glass) need to have matching UVW coordinates on the channel that is used for the scatter radius. I’ll post the scene in a moment.

Best regards,
Vlado

Here is what I got (first image is with the glass, second is without).

Best regards,
Vlado



test2.zip (51.2 KB)

I didnt look at Your scene yet. I will when I come home. But gradient of transparency is not the same like in the previous result or your first image. Dont know if You change something in gradient, but gradient looks weird, even without glass, which I dont get it.

Yeah, I changed the settings from your original file (was just playing).

Best regards,
Vlado

Oh, You change FastSSS2 settings.
I didnt have to much time to look at Your scene but I dont know exactly what You have done to the UVW mapping. There is an UVW mapping on a glass now, but when I change it, UVW mapping on a liquid change too. There is some connection, right ?
As I said, I look at it only for two or three minutes, so I hope I will find out :slight_smile:

ewww. looks like skim milk settled to the bottom and gone bad

When I use old FastSSS2 settings, liquid looks correct even with the glass with correct refraction. But I dont know, what Vlado do exactly to the UVW mapping. When I came home, I will look at it.

Ok, I have some time now, so I checked a scene. Thanks Vlado for UVW trick. I dont know how 3ds max or Vray computing a scene, I am not a programmer, so I dont know why there have to be a same UVW map on a glass as on the liquid, but it works pretty good.
There is two tests, I change some setting to achieve what I want.