Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TShader
Inherited By:
None.
Purpose:
TBumpMapShader is a concrete class, derived from TShader, that applies a bump map to a 3-D object in order to simulate a bumpy or dimpled surface. The bump map is stored in a TBumpMap object (which is NIL by default and which you should set by a constructor argument or by invoking TBumpMapShader::SetBumpMap). TBumpMapShader::ComputeShade overrides that of the TShader base class. TBumpMapShader::ComputeShade first extracts a value from the TBumpMap, using the texture coordinate to determine which spot in the map should be used. The value extracted from TBumpMap is used as the surface shading normal for the current point on the object's surface, replacing the existing value of TShadingSample.fShadingNormal.
The TBumpMapShader has a subsidiary shader that it uses to perform additional shading after extracting the surface shading normal from the bump map. By default, this shader is a TReflectanceShader, but by invoking TBumpMapShader::SetChildShader (or with a constructor argument) you can replaced the default shader with an instance of any other class that descends from TShader. The TBumpMapShader automatically invokes this subsidiary shader's ComputeShade member function to perform the additional shading, which uses the new shading normal.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TBumpMapShader ()
- TBumpMapShader (const TBumpMap & map)
- TBumpMapShader (const TBumpMap & map, const TShader & childShader)
- TBumpMapShader (const TBumpMapShader & source)
Interface Category:
API.
Purpose:
- Default constructor. Sets the bump map to NIL and the child shader to a TReflectanceShader.
- Constructor used to set the bump map to the given value.
- Constructor used to set the bump map and the child shader to the given values.
- Copy constructor.
Calling Context:
- Called by the stream-in operators. You can call this function directly.
- Call this function directly.
- Call this function directly.
- Called to copy an object. You can call this function directly.
Parameters:
- Takes no parameters.
- const TBumpMap & map -The bump map to use.
- const TBumpMap & map -The bump map to use.
- const TShader & childShader -The child shader to use to shade the color after it has been selected from the bump map.
- const TBumpMapShader & source -The object to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TBumpMapShader ()
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: TBumpMapShader::SetBumpMap
virtual void SetBumpMap (const TBumpMap & bumpMap)
Interface Category:
API.
Purpose:
Sets the bump map to the given value.
Calling Context:
Call this function directly.
Parameters:
- const TBumpMap & bumpMap -The new bump map to use.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBumpMapShader::GetBumpMap
virtual const TBumpMap * GetBumpMap () const
Interface Category:
API.
Purpose:
Returns a pointer to the bump map that is held by this object.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a pointer to a TBumpMap object that is used by this object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBumpMapShader::ComputeShade
virtual void ComputeShade (TShadingSample & shadingInfo, const TSceneState & sceneState)
Interface Category:
API.
Purpose:
Computes the resultant color and other shading variables, given the current surface point and scene state.
Calling Context:
Call this function directly.
Parameters:
- TShadingSample & shadingInfo -The shading information about the point to be shaded.
- const TSceneState & sceneState -The state of the scene.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBumpMapShader::SetChildShader
virtual void SetChildShader (const TShader & aShader)
Interface Category:
API.
Purpose:
Sets the child shader, which is used to shade the base color after it is chosen from the bump map, to the given shader.
Calling Context:
Call this function directly.
Parameters:
- const TShader & aShader -The new child shader to use.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBumpMapShader::GetChildShader
virtual TShader * GetChildShader () const
Interface Category:
API.
Purpose:
Returns a pointer to the child shader, which is used to shade the color after it has been chosen from the bump map.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a pointer to a TShader object that is the child shader.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBumpMapShader::GetShadingUsageVariables
virtual void GetShadingUsageVariables (TShadingUsageVariables & variables) const
Interface Category:
API.
Purpose:
Returns a TShadingUsageVariables object specifying what information the shader needs in order to shade the surface. This is dependent upon the needs of the child shader as well as the needs of the bump map color getter.
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.
TBumpMapShader & operator =(const TBumpMapShader & 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: TBumpMapShader::operator>>=
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.
Member Function: TBumpMapShader::operator<<=
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.