Class: TDepthCueingShader

Declaration: AtmosphereShader.h

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.

Member Function: TDepthCueingShader::TDepthCueingShader

  1. TDepthCueingShader (const TDepthCueingShader & source)
  2. TDepthCueingShader (GCoordinate nearZ, GCoordinate farZ, const TColor & depthCueColor)
  3. TDepthCueingShader ()

Interface Category:

API.

Purpose:

  1. Copy constructor.
  2. Constructor that accepts values for the far Z distance, the near Z distance, and the depth cue color.
  3. Default constructor.

Calling Context:

  1. Called to copy an object.
  2. Call this function directly, when wishing to provide the initialization values.
  3. Do not call this function directly. It is a protected constructor used only by the stream-in operators.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDepthCueingShader::~TDepthCueingShader

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.

Member Function: TDepthCueingShader::ComputeShade

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDepthCueingShader::SetNearZDistance

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDepthCueingShader::SetFarZDistance

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDepthCueingShader::SetDepthCueColor

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDepthCueingShader::GetNearZDistance

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.

Member Function: TDepthCueingShader::GetFarZDistance

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.

Member Function: TDepthCueingShader::GetDepthCueColor

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDepthCueingShader::operator=

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.

Member Function: TDepthCueingShader::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

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.

Member Function: TDepthCueingShader::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

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.