Reflectivity, Transparency, and Refraction
In addition to controlling an objects basic surface shading characteristics, surface shaders also control reflectivity, transparency and refraction.
As you may suspect, a surface shader’s Reflection parameters control an object’s reflectivity. The more reflective an object is, the more other objects in the scene appear as reflections on the object’s surface.
As an object becomes more reflective, its other surface parameters, such as those related to diffuse, ambient, and specular areas of illumination, become less visible. If an object’s material is fully reflective, its other material attributes are not visible at all.
|
As you increase an object’s reflectivity, you can keep its other surface attributes visible by drastically raising their values. For example, a specular highlight that was set to 1 on a non-reflective object could be set to 1000 on a highly reflective object. |
You adjust reflectivity using the Reflection options on the Transparency/Reflection tab of a surface shader’s property editor. Reflection values usually range from 0 to 1, with 0 representing no reflectivity and 1 representing complete reflectivity, giving the object a perfectly mirrored surface.
There are two ways to set the reflectivity values:
• Use the color sliders to set the reflection values. To adjust all of the color sliders at once, hold down Ctrl and adjust one slider. All of the color sliders will be moved to the same position.
For more information about setting color values, see Defining Color Properties in the Interface and Tools guide.
or
• Select the Use Alpha option to control reflectivity using only the alpha slider.
|
Although you can only drag a parameter’s slider to a maximum value of 1, you can increase the values by typing higher numbers in the parameter’s text box. |
Controlling Reflection with Textures
You can also control reflectivity using a texture by connecting the texture to the surface shader’s reflectivity input. Follow the procedure [here] for creating a reflectivity map or use any of the methods described in Three Basic Texturing Methods.
|
Typically, a black-and-white texture or an image’s alpha channel is used to create a reflectivity map, with well-defined areas for reflectivity and non-reflectivity. |
If you are controlling reflectivity with a texture, you may find the Invert and Scale settings useful.
• Invert simply inverts the color or alpha value that is driving the reflectivity.
This is useful when you are using a black-and-white image or an image’s alpha channel to control reflectivity. Normally, the white areas of the image are the most reflective, while the black areas are not reflective at all. This option reverses the effect of these values. Selecting Invert is often easier than inverting the image file itself.
• The Scale value adjusts the intensity of the reflectivity.
This is useful when you are using an image to control reflectivity since the amount of reflectivity defined by a given image is fixed, and may be more or less than you want. Scaling the reflectivity is often faster and easier than adjusting the actual image.
|
When setting the reflectivity options, remember that the Use Alpha, Invert, and Scale parameters are applied in that order. So if you are using all three of these parameters, the reflectivity’s alpha is inverted, and any scaling is applied to the inverted result. |
A surface shader’s Transparency parameters control an object’s transparency. The more transparent an object is, the more you can see through it.
As with reflectivity, transparency affects the visibility of an object’s other surface attributes. You can compensate for this by increasing the attributes’ values, such as changing specular color values that were 1 on an opaque object to 10 or higher on a transparent object.
You adjust transparency using the Transparency options on the Transparency/Reflection tab of a surface shader’s property editor. Transparency values usually range from 0 to 1, with a value of 0 representing no transparency and 1 making the object completely transparent. For a transparent surface such as glass, a value of 0.9 is more convincing than a value of 1.
There are two ways to set transparency values:
• Use the color sliders to set the transparency value. To adjust all of the color sliders at once, hold down Ctrl and adjust one slider. All of the color sliders will be moved to the same position.
For more information about setting color values, see Defining Color Properties in the Interface and Tools guide.
or
• Select the Use Alpha option to control transparency using only the alpha slider.
|
Although you can only drag a parameter’s slider to a maximum value of 1, you can increase the values by typing higher numbers in the parameter’s text box. |
Controlling Transparency with Textures
You can also control transparency using a texture by connecting the texture to the surface shader’s transparency input. Follow the procedure [here] for creating a transparency map or use any of the methods described in Three Basic Texturing Methods.
|
Typically, a black-and-white texture or an image’s alpha channel is used to create a transparency map, with well-defined areas for transparency and opacity. |
If you are controlling transparency with a texture, you may find the Invert and Scale settings useful.
• Invert simply inverts the color or alpha value that is driving the transparency.
This is useful when you are using a black-and-white image or an image’s alpha channel (matte) to control transparency. In a typical matte, the black areas are transparent and the white areas are opaque. For surface shaders, on the other hand, the reverse is true: black areas are opaque and white areas are transparent. Inverting the transparency gives you the correct transparency defined by the matte (black is transparent and white is opaque).
• The Scale value adjusts the intensity of the transparency.
This is useful when you are using an image to control transparency since the amount of transparency defined by a given image is fixed, and may be more or less than you want. Scaling the transparency is often faster and easier than adjusting the actual image.
|
When setting the transparency options, remember that the Use Alpha, Invert, and Scale parameters are applied in that order. So if you are using all three of these parameters, the transparency’s alpha is inverted, and any scaling is applied to the inverted result. |
When transparency is incorporated into an object’s surface definition, you can also define the refraction value. Refraction is the bending of light rays as they pass from one transparent medium to another, such as from air to glass or water.
|
When you use refraction and reflections, you may need to increase the Ray Depth value on the Optimization tab of the Rendering Options property editor. The use of refraction and reflections may take longer to render. |
You can set the refraction from a surface shader’s property editor. The default value is 1, which represents the density of air. This value allows light rays to pass straight through a transparent surface without bending. Higher values make the light rays bend, while values less than 1 makes light rays bend in the opposite direction, simulating light passing from air into an even less dense material (such as a vacuum).
Refractive index values usually vary between 0 and 2, but you can type in higher values as needed.
|
You can enter the actual physical refraction values for real matter and the behavior of light passing through it will be simulated. |
The following table lists some common transparent materials and their refractive index value:
Material |
|
Air |
1.00 |
Ice |
1.31 |
Water |
1.33 |
Acetone |
1.36 |
Alcohol |
1.39 |
Glass |
1.50–1.89 |
Polystyrene |
1.55 |
Emerald |
1.57 |
Topaz |
1.61 |
Ruby/Sapphire |
1.77 |
Crystal |
2.00 |
Diamond |
2.42 |
Casting and Visibility Options
Every object’s visibility property controls how the object reacts to reflection, transparency and/or refraction rays. For each of these ray types, the visibility property includes two parameters:
• The Caster parameter controls whether the object can cast a particular type of ray (reflection, transparency or refraction).
• The Visible parameter controls whether the object is visible to that type of ray.
|
For reflections, transparency, and refraction, XSI’s definition of a caster is the opposite of mental ray’s. For these attributes, mental ray uses the term “caster” to mean “image caster.” Thus a reflection caster, for example, is visible in the surface of reflective objects. This is equivalent to XSI’s Visible parameter. Similarly, what XSI calls a “caster” is called a “receiver” by mental ray because it receives an image. So a reflection receiver reflects other objects in its surface. This is not an important distinction unless you’re rendering using the mental ray standalone (ray3.exe — see Ray3.exe Rendering in the Rendering guide for details). |
The next three sections provide example of how toggling these parameters for each ray type can affect the objects in your scene. For information about setting these options, see Setting Casting and Visibility Options.
Reflection Casting and Visibility
If an object is a reflection caster, it can cast reflection rays that sample the scene. Surrounding objects are reflected in its surface, provided that they are visible to reflection rays. Of course some amount of reflectivity must be defined in the object’s material for this to work (see Reflectivity for details).
|
|
|
In this example, the silver sphere is a reflection caster. The other objects are visible to reflection rays, so they appear reflected in the sphere’s surface. |
Turning the silver sphere’s Reflection > Caster parameter off makes the sphere unable to cast reflection rays, and so nothing is reflected in its surface. |
Turning off the Reflection > Visible parameter for the blue sphere makes it invisible to reflection rays cast by the silver sphere, and it no longer appears reflected in the silver sphere’s surface (although its shadow does). |
Transparency Casting and Visibility
If an object is a transparency caster, it can cast transparency rays that sample the scene. Surrounding objects are can be seen through its surface, provided that they are visible to transparency rays. Of course some amount of transparency must be defined in the object’s material for this to work (see Transparency for details).
If a transparent object has an index of refraction value that is not equal to one (in other words, some refraction is defined), its transparency casting and visibility options have no effect. Instead, you need to can adjust its refraction casting and visibility options (see Refraction Casting and Visibility).
|
|
|
In this example, the silver sphere is a transparency caster. The other objects are visible to transparency rays, so they are visible through the sphere’s surface. |
Turning the silver sphere’s Transparency > Caster parameter off makes the sphere unable to cast transparency rays, and so nothing is visible through its surface. |
Turning off the Transparency > Visible parameter for the jack and the red sphere makes them invisible to transparency rays cast by the silver sphere, and they are no longer visible through the silver sphere’s surface (although their shadows are). |
Refraction Casting and Visibility
If a transparent object has an index of refraction value that is not equal to one (in other words, some refraction is defined), its transparency casting and visibility options have no effect. Instead, you need to can adjust its refraction casting and visibility options.
When an object is a refraction caster, it can cast refraction rays that sample the scene. Surrounding objects are can be seen through its surface — properly distorted according to the index of refraction — provided that they are visible to refraction rays. For this to work, some amount of transparency must be defined in the object’s material and the object’s index of refraction must set to a value other than 1 (see Transparency and Refraction for details).
|
|
|
In this example, the silver sphere is a refraction caster. The other objects are visible to refraction rays, so they are visible through the sphere’s surface. |
Turning the silver sphere’s Refraction > Caster parameter off makes the sphere unable to cast refraction rays, and so nothing is visible through its surface. |
Turning off the Refraction > Visible parameter for the jack and the red sphere makes them invisible to refraction rays cast by the silver sphere, and they are no longer visible through the silver sphere’s surface (although their shadows are). |
Ray Visibility and Shadows
Even if you make an object invisible to a particular ray type (reflection, transparency or refraction), the object can still cast a shadow, which may be visible in reflective surfaces, or through transparent objects. To prevent an object from casting a shadow, you can turn off its Shadow > Caster visibility parameter. This is described in Shadow Casters and Receivers.
|
|
Even though the jack and the red sphere are invisible to transparency rays, they still cast shadows onto the floor, which is visible to transparency rays. Those shadows are visible through the sliver sphere. |
Turning off the Shadow > Caster parameter for the jack and the red sphere prevents them from casting shadows onto the floor, so no trace of either object is visible through the silver sphere. |
Setting Casting and Visibility Options
By default, every object is both a caster of, and visible to reflection, transparency, and refraction rays. If necessary, you can deactivate any of these parameters to control the scenes reflections, transparency and/or refraction more precisely.
Toggling reflection casting/visibility is useful when you’re rendering a scene in multiple passes. For example, you might specify which reflections appear in each pass. Or, to speed up rendering, you could prevent foreground objects from reflecting very distant objects by making the distant objects’ invisible to reflection rays.
To toggle reflection casting and/or receiving
1. Select the object whose reflection casting and/or receiving you wish to toggle, and open an explorer (press 8).
2. Expand the object’s hierarchy and click its visibility node to open the object’s Visibility property editor.
3. On the Rendering tab, toggle the object’s Caster and/or Visible parameters for Reflection, Transparency, and/or Refraction.
Grouping Reflection Casters and Receivers
If your scene contains a lot of objects, casting and visibility can be difficult to manage on a per-object basis. In complex scenes, it’s easier to group objects and use overrides to control reflection, transparency and refraction casting and visibility for all of the objects in the group. This process is described in Creating Visibility-Option Groups in the Interface and Tools guide.
SOFTIMAGE|XSI v.6.01