Class: TShadingSample

Declaration: Shaders.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TSurfaceSample

Inherited By:

None.

Purpose:

A TShadingSample stores information needed for shading a particular point on a sampled 3-D surface. This information describes local surface characteristics such as the normal, texture coordinates, and tangent. A renderer provides this information, and then supplies it to a TShader object by passing the TShadingSample object as an argument to the shader's ComputeShade member function. The TShader then uses the information to compute the resultant color (or other variables) at this point on the surface, taking into account the lighting and whatever other factors the particular shader is concerned with (such as reflectance or a texture map). TShadingSample derives from TSurfaceSample. TShadingSample inherits public member variables that define the geometry of the point as well as its color and texture coordinate. To these member variables, TShadingSample adds others that are specific to shading computation. It also adds TShadingSample::LinearInterpolate, which creates shading information for a surface point that lies between two points whose shading information is already known. (Not all renderers necessarily use interpolation, however.)

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TShadingSample::LinearInterpolate

virtual void LinearInterpolate (const TShadingSample & anotherPoint, TShadingSample & returnPoint, GParametric t, const TShadingUsageVariables & usageVariables)

Interface Category:

API.

Purpose:

Creates shading information for a point that lies at the specified proportion of the way between this TShadingSample and the TShadingSample argument. Linearly interpolates the values of any member variables specified by the TShadingUsageVariables argument. The return point contains the interpolated values.

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: TShadingSample::operator=

TShadingSample & operator =(const TShadingSample & src)

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: TShadingSample::TShadingSample

  1. TShadingSample (const TShadingSample & aShadingSample)
  2. TShadingSample ()

Interface Category:

API.

Purpose:

  1. Copy constructor.
  2. Default constructor.

Calling Context:

  1. Called to copy an object.
  2. Called by the stream-in operators. You can also 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: TShadingSample::~TShadingSample

virtual ~ TShadingSample ()

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: TShadingSample::operator==

bool operator ==(const TShadingSample & source) const

Interface Category:

API.

Purpose:

Compares two TShadingSample objects and returns true if they are equal.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the objects are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TShadingSample::operator>>=

TStream & operator >>=(TStream & towhere) 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: TShadingSample::operator<<=

TStream & operator <<= (TStream & fromwhere)

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.