glass - Simulate transparent glass glassbal - Simulate refraction caused by a glass ball
Surface "glass" "Ka" n "Ks" n "Kd" n "roughness" n "specularcolor" c "envname" s "Kr" n Surface "glassbal" "Ka" n "Ks" n "Kd" n "roughness" n "specularcolor" c "envname" s "eta" n
float Ka=0, Ks=0.6, Kd=0, Kr=0.5, eta=0.6 float roughness= 0.025 (for glass) or 0.2 (for glassbalP) color specularcolor=[1 1 1] string envname=""
The glass shader makes objects appear to be made out of transparent and possibly colored glass. No refraction is attempted, so the glass appears to be thin, but reflections are simulated using the environment map named envname. The environment map's reflective intensity Kr can be controlled to fine-tune the appearance: a lower-intensity reflection may look better on very dark glass. Although you can use the shader even if you don't have an environment map (just don't pass an envname), it will look more like transparent plastic than glass.
You can use the shader for either clear glass or colored glass by setting the surface color (clear glass has color 1,1,1). The transparency of the glass is controlled only by the surface color; if you want to make the glass less transparent you should make the color darker.
The glassbal shader can be used to make some objects look like solid glass. It simulates the refraction seen through a sphere turning objects seen through the glass upside-down and backwards. The shader needs the environment map envname to do this refraction. It will not work without an environment map. Because the shader simulates refraction as if the object is a sphere, it works well on curvy objects like teapots (and spheres), but will not look right on flat objects or cylinders.
The color of the object can be set with the surface color, just as with glass. The transparency is somewhat different here, however, because the camera is not really seeing through the object. Therefore, the surface opacity should always be set to (1,1,1), and the relative intensity of the refraction will again depend on the surface color.
The parameter eta is the relative index of refraction of the atmosphere to the glass. By default, this is the standard value of air (1.0) relative to glass (1.66).
The parameters Ka,Ks and Kd have the usual meanings of ambient, specular and diffuse reflective intensities, respectively. roughness and specularcolor control the sharpness and color of the specular highlight.
glassbal needs an environment map;
glass looks bad without one.
Control over color should be more fine-tuned.
Pixar Animation Studios
|