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:
- const TShadingSample & anotherPoint -The other point used in the interpolation process.
- TShadingSample & returnPoint -The interpolated shading sample values.
- GParametric t -The proportional distance between this point and the other point at which to interpolate the values. This value should be betweenand 1.
- const TShadingUsageVariables & usageVariables -The variable that specifies which of the TShadingSurface member variables to interpolate.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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.
- TShadingSample (const TShadingSample & aShadingSample)
- TShadingSample ()
Interface Category:
API.
Purpose:
- Copy constructor.
- Default constructor.
Calling Context:
- Called to copy an object.
- Called by the stream-in operators. You can also call this function directly.
Parameters:
- const TShadingSample & aShadingSample -The object to be copied.
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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:
- TStream & towhere -The stream 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.
Member Function: TShadingSample::operator<<=
TStream & operator <<= (TStream & fromwhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromwhere -The stream 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.