![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TAtmosphereShader
Inherited By:
None.
Purpose:
TDepthCueingShader is a concrete class, derived from TAtmosphereShader. TDepthCueingShader determines, from the scene state, the distance between the camera and the surface location being rendered. It uses this distance to determine the atmospheric attenuation. If there is attenuation, the shaded color at the current location on the surface is modified accordingly. Otherwise, it is left as the color that was already computed by the regular shader. If the surface is beyond a given distance, called fFarZDistance, its color is always set to the depth-cue color. If the surface is nearby (less than fNearZDistance), TDepthCueingShader leaves its color unmodified. If the surface distance is between these two values, the modified color is linearly interpolated between the preexisting color and the depth-cue color.
Instantiation:
Allocate on the stack or the heap.
Deriving Classes:
None. None Needed.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TDepthCueingShader (const TDepthCueingShader & source)
- TDepthCueingShader (GCoordinate nearZ, GCoordinate farZ, const TColor & depthCueColor)
- TDepthCueingShader ()
Interface Category:
API.
Purpose:
- Copy constructor.
- Constructor that accepts values for the far Z distance, the near Z distance, and the depth cue color.
- Default constructor.
Calling Context:
- Called to copy an object.
- Call this function directly, when wishing to provide the initialization values.
- Do not call this function directly. It is a protected constructor used only by the stream-in operators.
Parameters:
- const TDepthCueingShader & source -The object to be copied.
- GCoordinate nearZ -The minimum distance at which to perform atmospheric attenuation.
- GCoordinate farZ -The maximum distance at which to perform atmospheric attenuation.
- const TColor & depthCueColor -The target color used for the atmospheric attenuation.
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TDepthCueingShader ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void ComputeShade (TShadingSample & shadingSample, const TSceneState & sceneState)
Interface Category:
API.
Purpose:
Computes the specific atmospheric shading effects due to the effects of distance upon the color of each shading sample. The TShadingSample will be modified based upon the effects of the depth cue shader.
Calling Context:
Call this function directly.
Parameters:
- TShadingSample & shadingSample -Information about the point to be shaded, including position vectors, texture coordinates, base color, and so on. After modification by this function, the new values are returned in this argument.
- const TSceneState & sceneState -The set of graphic scene attributes corresponding to the shading sample.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetNearZDistance (GCoordinate nearZ)
Interface Category:
API.
Purpose:
Sets the minimum distance at which to modify a shading sample. Shading samples that are closer (to the camera) than this amount are not modified by this function.
Calling Context:
Call this function directly.
Parameters:
- GCoordinate nearZ -The minimum modification distance, in world coordinates.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetFarZDistance (GCoordinate farZ)
Interface Category:
API.
Purpose:
Sets the maximum distance at which to modify a shading sample. Shading samples that are further (from the camera) than this amount are set to the depth cue color defined by this object.
Calling Context:
Call this function directly.
Parameters:
- GCoordinate farZ -The maximum modification distance, in world coordinates.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetDepthCueColor (const TColor & depthCueColor)
Interface Category:
API.
Purpose:
Sets the color to be used for shading samples that occur at a distance greater than the maximum distance defined in this object. Colors at a great distance tend to be dimmer and approach the depth cue color as they get farther away.
Calling Context:
Call this function directly.
Parameters:
- const TColor & depthCueColor -The color to be used for shading the samples occurring in the far distance.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual GCoordinate GetNearZDistance ()
Interface Category:
API.
Purpose:
Returns the value of the minimum modification distance used by this object.
Calling Context:
Call this function directly.
Parameters:
Return Value:
A GCoordinate specifying the minimum distance at which to stop any shading modifications.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual GCoordinate GetFarZDistance ()
Interface Category:
API.
Purpose:
Returns the value of the maximum modification distance used by this object.
Calling Context:
Call this function directly.
Parameters:
Return Value:
A GCoordinate specifying the maximum distance at which to do an interpolated shading modification.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void GetDepthCueColor (TColor & depthCueColor)
Interface Category:
API.
Purpose:
Returns the color to be used if the shading sample is farther away than the maximum modification distance defined by this object.
Calling Context:
Call this function directly.
Parameters:
- TColor & depthCueColor -The color to be used for shading.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TDepthCueingShader & operator =(const TDepthCueingShader & source)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Call this function by using the operator in an assignment statement.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -The stream that the object streams itself out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -The stream that the object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.