![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
None.
Inherited By:
None.
Purpose:
The TShadingUsageVariables class is a simple wrapper for a set of Booleans, provided as public member variables for efficiency. These Boolean variables specify what sorts of information a TShader needs in order to shade a 3-D surface. The possible sorts of information include the color, position, tangent, shading normal, parametric coordinates, and texture coordinate of each point to be shaded. (A shader also makes use of other information, such as the lighting and camera, but these are specified in TSceneBundle, not in the TShadingUsageVariables object.) Note that the TShadingUsageVariables object does not itself store the information for each point; that is the role of TShadingSample. Instead, the TShadingUsageVariables object merely specifies whether to ignore such information when each point is shaded.
A TShadingUsageVariables object is returned by TShader::GetShadingUsageVariables, which the renderer invokes in order to asks the shader what information it needs. The renderer invokes this function only once per surface; then, for each point to be shaded, the renderer provides the necessary information in the TShadingSample argument to TShader::ComputeShade. A TShadingUsageVariables object is also used as an argument to TShadingSample::LinearInterpolate, for shading an interpolated point.
The TShadingUsageVariables constructor initializes all the member variables to false. TShader sets fShadingNormal, fPosition, and fBaseColor to true. Similarly, each TShader derived class turns on whichever variables it is interested in.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
virtual ~ TShadingUsageVariables ()
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.
- TShadingUsageVariables ()
- TShadingUsageVariables (const TShadingUsageVariables &)
Interface Category:
API.
Purpose:
- Default constructor. Initializes all variables to false.
- Copy constructor.
Calling Context:
- Called by the stream-in operators and directly.
- Called to copy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
bool operator ==(const TShadingUsageVariables & source) const
Interface Category:
API.
Purpose:
Compares two TShadingUsageVariables to see if they are equal.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the objects are true.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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.
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 form.
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.