IFXShaderData |
IFXShaderData is the interface for a shader data object, which is essentially a container class for pointers to specific instances of objects that a shader will render. Shaders are a prescribed way of rendering objects. They are a rendering tool, which must act upon a specific set of objects in order to do their job. The shader data container is used to point to those specific instances. The IFXShaderData interface is used to change which instances the corresponding shader will use when it is next asked to render with IFXShader::Render().
There are two main types of data that a shader data container will have: meshes or particle groups. These two types are mutually exclusive, so a shader data container will have either one or the other, but not both. There are other supporting types as well: transforms and edge sets. Transforms will always be present, as both meshes and particle groups require an object-to-world matrix transformation. Edge sets, however, are only relevant to meshes, and are optional. Edge sets will not be present when shader data is associated with particle groups.
When to Use
Every shader has a pointer to an IFXShaderData interface, and it will query this interface as it prepares the render layer to render the shader data. Additionally, any object that must initialize or change the associations between shaders and their assigned data must ask the shader for its IFXShadaData interface and then use that interface to point the shader to the right data.
The IFXShaderData interface inherits the IFXUnknown interface and is supported by CIFXShaderData.
|
Interface Methods |
Description |
|
Retrieves the number of elements in the shader data. |
|
|
Sets the number of elements in the shader data. |
|
|
Retrieves the list of element-to-world matrices for the elements. |
|
|
Associates the shader data with a list of element-to-world matrices. |
|
|
Retrieves the array of pointers to IFXMesh interfaces currently associated with the shader. |
|
|
Associates the shader data with an array of pointers to IFXMesh interfaces. |
|
|
Retrieves the array of pointers to IFXEdgeSet interfaces currently associated with the shader. |
|
|
Associates the shader data with an array of pointers to IFXEdgeSet interfaces. |
|
|
Retrieves the array of pointers to IFXParticleGroup interfaces currently associated with the shader. |
|
|
Associates the shader data with an array of pointers to IFXParticleGroup interfaces. |
|
|
Retrieves the shader state of the model |
|
|
Associates the shader state with the model |
|
|
Gets the material ID for the shader |
|
|
Sets the material ID for the shader |
This method retrieves the number of elements in the shader data. Elements can be either meshes or particle groups, but not both. The number of edge sets is equal to the number of meshes. If the shader data uses particle groups, it does not use either meshes or edge sets.
Parameters:
|
puOutNumberOfElements |
The number of elements assigned to the shader data. This value represents the number of elements in the array of interface pointers retrieved by GetEdgeSets(), GetMeshes(), GetTransforms or GetParticleGroups(). |
This method establishes the number of elements associated with the shader data container. It is essentially the size of the arrays of interface pointers for meshes, edge sets, transforms and particle groups. Keep in mind that a shader data container cannot simultaneously be associated with meshes and particle groups. If it is associated with meshes, then it will have a list of transforms, and may or may not also have edge sets. It will not have particle groups if it has meshes. Conversely, if the shader data has particle groups, it will have transforms, but will have neither meshes nor edge sets.
Parameters:
|
uInNumberOfElements |
The number of elements in the shader data arrays of interface pointers for meshes, edge sets, or particle groups. |
Comments:
This method is intended to be called in conjunction with the other methods which assign the shader data container a list of elements. In other words, if the shader data is assigned a new element list (meshes, edge sets, particle groups, etc.) then it needs to be informed of the new element count as well, via SetNumberOfElements().
Retrieves an array of interface pointers to the element-to-world matrix transformations. There is one matrix transform for each element. In other words, if a shader data container has a list of meshes, then there will be one matrix transform for each mesh. If it has a list of particle groups, there will be one transform for each particle group.
Parameters:
|
pppmOutTransforms |
The address of an array of pointers to interfaces of matrices. |
Comments:
This method is intended to be used after having already called GetNumberOfElements() in order to be able to create an array of the appropriate size which can be handed to GetTransforms().
Assigns an array of IFXSGMatrix interface pointers to the shader data container. This array must have as many elements as there are in the shader data's array of either meshes or particle groups.
Parameters:
|
ppmInTransforms |
Description of param1 |
Comments:
Be sure to call SetNumberOfElements() after having assigned a new list of elements to the shader data container.
Retrieves an array of IFXMesh interface pointers. These are the mesh interfaces that the shader will use when rendering the meshes.
Parameters:
|
pppOutMeshes |
The address of an array of pointers to mesh interfaces |
Comments:
This method is intended to be used after having already called GetNumberOfElements() in order to be able to create an array of the appropriate size which can be handed to GetMeshes().
Assigns an array of IFXMesh interface pointers to the shader data container. This array must have as many elements as there are in the shader data's array of transforms (and edge sets if they are used).
Parameters:
|
ppInMeshes |
An array of pointers to IFXMesh interfaces |
Comments:
Be sure to call SetNumberOfElements() after having assigned a new list of elements to the shader data container.
Retrieves an array of IFXEdgeSet interface pointers. There must be as many edge sets as there are meshes assigned to the shader data container.
Parameters:
|
pppOutEdgeSets |
The address of an array of pointers to edge set interfaces |
Comments:
This method is intended to be used after having already called GetNumberOfElements() in order to be able to create an array of the appropriate size which can be handed to GetEdgeSets().
Assigns an array of IFXEdgeSet interface pointers to the shader data container. This array must have as many elements as there are in the shader data's array of meshes.
Parameters:
|
ppInEdgeSets |
An array of pointers to IFXEdgeSet interfaces |
Comments:
Be sure to call SetNumberOfElements() after having assigned a new list of elements to the shader data container.
Retrieves an array of IFXParticleGroup interface pointers. These are the interfaces that the shader will use when rendering the particle groups.
Parameters:
|
pppOutParticleGroup |
The address of an array of pointers to particle group interfaces |
Comments:
This method is intended to be used after having already called GetNumberOfElements() in order to be able to create an array of the appropriate size which can be handed to GetParticleGroups().
Assigns an array of IFXParticleGroup interface pointers to the shader data container. This array must have as many elements as there are in the shader data's array of transforms.
Parameters:
|
ppInParticleGroup |
An array of pointers to IFXParticleGroup interfaces |
Comments:
Be sure to call SetNumberOfElements() after having assigned a new list of elements to the shader data container.
This method retrieves the shader state of a model.
Parameters:
|
pppOutShaderState |
Pointer to SIFXModelShaderState |
This method assigns the shader state of a model.
Parameters:
|
ppOutShaderState |
Pointer to SIFXModelShaderState |
This method retrieves the material ID number to the shader.
Parameters:
|
puMatID |
Pointer to material ID |
This method assigns the material ID number to the shader.
Parameters:
|
uMatID |
Material ID number |
§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.