Reflection Planes
You can create reflections in your scene by enabling the simple reflection option. This setting gives you the ability to specify not only the coordinates of the reflection plane, but the amount of fading and opacity as well. You can use the opacity parameter to specify the transparency of the reflection plane. Setting the opacity to 1 creates a completely opaque reflection plane while setting the opacity to 0 creates an entirely translucent plane. In most cases, you will want the opacity to be somewhere in between. The default value is 0.5.
In addition to these two parameters, Visualize provides blurring and attenuation under the DirectX driver. When blurring is on, the entire reflection is softened uniformly. You can set a blurring value that ranges from 1 to 31. This value determines the size of the blur region. Attenuation is an effect where the model’s reflection fades as it moves away from the reflection plane. With attenuation, you set the near and far planes which are defined as orthogonal distances from the reflection plane’s location. At the near plane, the image is the most opaque. As it moves toward the far plane, attenuation is applied linearly until the model is no longer visible beyond that distance. Each pixel’s overall alpha value is calculated by multiplying the model’s alpha, the reflection’s opacity, fading (if enabled) and the attenuation value (if enabled).
To use a reflection plane, you must set up the parameters using SetSimpleReflection
, then specify the plane itself using SetSimpleReflectionPlane
. The parameter to the latter function is a plane, as defined geometrically by the four coefficients of the plane equation Ax + By + Cz + D = 0
.
mySegmentKey.GetVisualEffectsControl().SetSimpleReflection(true, 0.5f, 1U, false, 0, 0.2f);
mySegmentKey.GetVisualEffectsControl().SetSimpleReflectionPlane(HPS::Plane(0, 1, 0, 1));
mySegmentKey.GetVisualEffectsControl().SetSimpleReflection(true, 0.5f, 1U, false, 0, 0.2f);
mySegmentKey.GetVisualEffectsControl().SetSimpleReflectionPlane(new HPS.Plane(0, 1, 0, 1));
A scene reflected about the **x* axis*
Limitations
Reflection planes cannot be used in scenes in which fixed frame rate mode is in use.