Tutorial: Glass, Water, Plastic
CS22. W19 Loeb
Rendering Glass and Liquid
Several of you have asked about creating liquid inside of glass (for example, in your fishbowl or for a wine glass) Here are some tips (from Solid Angle and me). You can also use an Ocean Shader (from the Create Node procedural texture options or use fluid dynamics (in FX module), but dynamics are more important if you want the water to move or interact with a surface or physically based attribute such as wind.
Below, I go over some simpler ways to create glass and liquid using aiStandardSurface shaders.
Glass surface normals face outward from the outer faces of the glass and inwards from the inward facing faces, if you have modeled the glass with depth.
Liquid inside the glass should also be modeled (you can duplicate the geometry and then scale it and delete faces above where the water will be.
You will want to fill the top cap of the liquid, and add some edges around the top to create a bit of a meniscus effect.
Water surface normals point outward and upward
(From Solid Angle)
You can see the direction of you normals by going to View>Polygons>Face Normals
And you can reverse or change or conform the direction of your face normals by going into Mesh Display
You need to scale down the water just a tiny bit so that Arnold knows how to render it and sees it as two distinct objects. If you scale it down too much it won't look natural. Just a bit!
Turn off Opaque setting in the object Shape Node
Remember, for an object to be trasparen in Arnold, you need to go into the object's shape node, to the Arnold Tab, and uncheck Opaque.
Glass: In the aiSurface Shader Attribute Editor:
- Set the Base Weight to 0 and
- Increase the Specular Weight to 1.
- Change the Index of Refraction to 1.5
- Increase the Transmission Weight to 1.
Liquid: Same attribute values as for glass except:
- Change the Index of Refraction to 1.3
Transmission Weight: Transmission Weight value affects the amount of light that passes through the volume of the glass based on color. By default, Transmission Color is white, which means no distance-based tint. Try lowering it from full white to something with a bit of gray in it.
Ray Depth/Transmission In the Render Settings:
The transmission depth setting defines how deep the transmission of the rays through a surface (how far past the surface the light travels). By default, the depth is set to 8 in the Render Settings Ray Depth Tab.
The deeper the transmission depth, the more detail you see in the glass.
Total for Ray Depth sets a limit on the total number of ray depths in the scene. The value for Total should be greater than the sum of the Diffuse, Specular and Transmission (Diffuse + Transmission + Specular < Total).
TIP: If your render times increase a lot using glass surfaces, select the mesh and disable 'enable internal reflections' in the Advanced section of the Standard Surface shader.
Plastic bottle with water:
Above is a link to the Solid Angle support files with a cool bit about creating a plastic water bottle.
Solid Angle makes Arnold. Their support documents can be quite helpful although there is a lot more information here than you need. Still, use this resource as you render!