class HT_Shader
This class provides the data structure for shading properties
of various geometry, such as tri-strips. It obtains the color per pixel
and acts as a light filter. For example, material is a type of shader.
For more information, see the section "Material
Functions," in chapter 8, "Lighting
and Material Functions."
See Also
HT_Basic_Material,
HT_Texture,
HT_Material,
HT_Complex_Textured_Material,
HT_Complex_Material,
HT_Basic_Textured_Material
Class Diagram
Methods
diffuse_texture
Queries for the basic color
of the material per pixel.
parent
Queries for the parent
material.
shade
Computes the color for a given pixel.
shade_d
Computes the color for a given pixel - double precision.
type
Queries for the type of
shader.
Constructor
HT_Shader::diffuse_texture
Purpose
Queries for the basic color
of the material per pixel.
Synopsis
HT_Texture diffuse_texture (void) const
Details
This is similar to the basic material color, however
it can be computed on a per pixel basis as opposed to being one simple
color throughout.
HT_Shader::HT_Shader
Purpose
Constructor to initialize a new HT_Shader object
.
Synopsis
HEIDI_API HT_Shader (HT_Shader const &);
HEIDI_API HT_Shader ();
HT_Shader::parent
Purpose
Queries for the parent
material.
Synopsis
HT_Shader_Data const * parent (void) const
Details
Since a shader must have a material beyond it, parent
can query for this material.
HT_Shader::shade
Purpose
Computes the color for a given pixel.
Synopsis
HT_RGBA shade (HT_Rendition const * hr,
HT_Vector const * normal = null,
HT_Point const * position = null,
HT_RGB const * color = null,
HT_Parameter const * parameter = null,
int param_width = 1,
HT_Vector const * aligner = null) const
Details
Similar to material functions, shade computes
the color for a given pixel. The interface now allows for "n" triplets
of texture vertex parameter data to be associated with each vertex of,
for example, tristrips. The first place this is seen is in the set_vertex_parameters()
member function of HT_Tristrip.
Additionally, this new information needs to be passed on through to all
of the functions that may make use of it. In all cases it is an optional
int function argument, also defaulting to 1, added immediately after the
HT_Parameter
* param argument. For more information see
HT_Vertex_Set_Data::set_vertex_parameters.
See the shade_d method for double precision.
HT_Shader::shade_d
Purpose
Computes the color for a given pixel.
Synopsis
HT_RGBA shade_d (HT_Rendition const * hr,
HT_Vector const * normal = null,
HT_Point_D const * position = null,
HT_RGBA const * color = null,
HT_Parameter const * parameter = null,
int param_width = 1,
HT_Vector const * aligner = null) const
Details
Similar to shade, this method computes the color
for a given pixel, but in double precision. See the shade
method for further details.
HT_Shader::type
Purpose
Queries for the type of
shader.
Synopsis
HT_Shader_Type type (void) const
Details