ProcessedMaterial Class Reference#include <processedMaterial.h>
Inheritance diagram for ProcessedMaterial:
[legend]List of all members.
Detailed Description
This is an abstract base class which provides the external interface all subclasses must implement.
This interface primarily consists of setting state. Pass creation is implementation specific, and internal, thus it is not in this base class.
|
Public Member Functions |
| ProcessedMaterial () |
virtual | ~ProcessedMaterial () |
virtual void | init (const GFXMaterialFeatureData::FeatureListHandle &features, GFXVertexFlags vertFlags)=0 |
| Initializes us (eg. loads textures, creates passes, generates shaders).
|
virtual bool | setupPass (SceneState *, const SceneGraphData &sgData, U32 pass)=0 |
| Sets up the given pass.
|
virtual MaterialParameters * | allocMaterialParameters ()=0 |
virtual MaterialParameters * | getDefaultMaterialParameters ()=0 |
virtual void | setMaterialParameters (MaterialParameters *param, S32 pass) |
virtual MaterialParameters * | getMaterialParameters () |
virtual MaterialParameterHandle * | getMaterialParameterHandle (const String &name)=0 |
virtual void | cleanup (U32 pass) |
| Cleans up the state and resources set by the given pass.
|
RenderPassData * | getPass (U32 pass) |
| Returns the pass data for the given pass.
|
const RenderPassData * | getPass (U32 pass) const |
| Returns the pass data for the given pass (const version).
|
virtual U32 | getNumStages ()=0 |
| Returns the number of stages we're rendering (not to be confused with the number of passes).
|
U32 | getNumPasses () |
| Returns the number of passes we are rendering (not to be confused with the number of stages).
|
bool | hasGlow () |
| Returns true if any pass glows.
|
U32 | getStageFromPass (U32 pass) const |
| Gets the stage number for a pass.
|
virtual void | dumpMaterialInfo () |
| Dump shader info, or FF texture info?
|
|
virtual void | addStateBlockDesc (const GFXStateBlockDesc &sb) |
virtual void | setTextureStages (SceneState *, const SceneGraphData &sgData, U32 pass)=0 |
| Sets the textures needed for rendering the current pass.
|
virtual void | setTransforms (const MatrixF &world, const MatrixF &view, const MatrixF &projection, const U32 pass)=0 |
| Sets the transformation matrix, i.e. Model * View * Projection.
|
virtual void | setLightInfo (SceneState *, const SceneGraphData &sgData, U32 pass)=0 |
| Sets the light info for the given pass.
|
virtual void | setEyePosition (MatrixF objTrans, Point3F position, U32 pass)=0 |
| Sets the eye position so we can do view dependent effects such as specular lighting.
|
virtual void | setBuffers (GFXVertexBufferHandleBase *vertBuffer, GFXPrimitiveBufferHandle *primBuffer) |
| Sets the given vertex and primitive buffers so we can render geometry.
|
Protected Member Functions |
void | _setBlendState (Material::BlendOp blendOp, GFXStateBlockDesc &desc) |
| Sets the blend state for rendering.
|
GFXTexHandle | _createTexture (const char *filename, GFXTextureProfile *profile) |
| Loads the texture located at filename and gives it the specified profile.
|
|
virtual void | _initStateBlockTemplates (GFXStateBlockDesc &stateTranslucent, GFXStateBlockDesc &stateGlow, GFXStateBlockDesc &stateReflect) |
| Creates the default state block templates, used by initStateBlocks.
|
virtual void | _initPassStateBlock (const Material::BlendOp blendOp, U32 numTex, const U32 texFlags[Material::MAX_TEX_PER_PASS], GFXStateBlockDesc &result) |
| Does the base render state block setting, normally per pass.
|
virtual void | _initRenderStateStateBlocks (const Material::BlendOp blendOp, U32 numTex, const U32 texFlags[Material::MAX_TEX_PER_PASS], GFXStateBlockRef renderStates[RenderPassData::STATE_MAX]) |
| Creates the default state blocks for a list of render states.
|
virtual void | _initRenderPassDataStateBlocks () |
| Creates the default state blocks for each RenderPassData item.
|
virtual U32 | _getRenderStateIndex (const SceneGraphData &sgData) |
| This returns the index into the renderState array based on the sgData passed in.
|
virtual void | _setRenderState (const SceneGraphData &sgData, const U32 pass) |
| Activates the correct mPasses[currPass].renderState based on scene graph info.
|
Protected Attributes |
Vector< RenderPassData * > | mPasses |
| Our passes.
|
Material * | mMaterial |
| The material which we are processing.
|
MaterialParameters * | mCurrentParams |
Material::StageData | mStages [Material::MAX_STAGES] |
| Material::StageData is used here because the shader generator throws a fit if it's passed anything else.
|
bool | mHasSetStageData |
| If we've already loaded the stage data.
|
bool | mHasGlow |
| If we glow.
|
U32 | mMaxStages |
| Number of stages (not to be confused with number of passes).
|
GFXVertexFlags | mVertFlags |
| Vertex flags.
|
GFXStateBlockDesc | mUserDefined |
Constructor & Destructor Documentation
ProcessedMaterial::ProcessedMaterial |
( |
|
) |
|
virtual ProcessedMaterial::~ProcessedMaterial |
( |
|
) |
[virtual] |
Member Function Documentation
virtual void ProcessedMaterial::setTransforms |
( |
const MatrixF & |
world, |
|
|
const MatrixF & |
view, |
|
|
const MatrixF & |
projection, |
|
|
const U32 |
pass | |
|
) |
| | [pure virtual] |
virtual void ProcessedMaterial::setEyePosition |
( |
MatrixF |
objTrans, |
|
|
Point3F |
position, |
|
|
U32 |
pass | |
|
) |
| | [pure virtual] |
Sets the given vertex and primitive buffers so we can render geometry.
virtual MaterialParameters* ProcessedMaterial::getDefaultMaterialParameters |
( |
|
) |
[pure virtual] |
virtual MaterialParameters* ProcessedMaterial::getMaterialParameters |
( |
|
) |
[inline, virtual] |
virtual void ProcessedMaterial::cleanup |
( |
U32 |
pass |
) |
[virtual] |
Returns the pass data for the given pass.
Returns the pass data for the given pass (const version).
virtual U32 ProcessedMaterial::getNumStages |
( |
|
) |
[pure virtual] |
U32 ProcessedMaterial::getNumPasses |
( |
|
) |
[inline] |
Returns the number of passes we are rendering (not to be confused with the number of stages).
bool ProcessedMaterial::hasGlow |
( |
|
) |
[inline] |
Returns true if any pass glows.
U32 ProcessedMaterial::getStageFromPass |
( |
U32 |
pass |
) |
const [inline] |
Gets the stage number for a pass.
virtual void ProcessedMaterial::dumpMaterialInfo |
( |
|
) |
[inline, virtual] |
Sets the blend state for rendering.
Loads the texture located at filename and gives it the specified profile.
Creates the default state block templates, used by initStateBlocks.
virtual void ProcessedMaterial::_initRenderStateStateBlocks |
( |
const Material::BlendOp |
blendOp, |
|
|
U32 |
numTex, |
|
|
const U32 |
texFlags[Material::MAX_TEX_PER_PASS], |
|
|
GFXStateBlockRef |
renderStates[RenderPassData::STATE_MAX] | |
|
) |
| | [protected, virtual] |
Creates the default state blocks for a list of render states.
virtual void ProcessedMaterial::_initRenderPassDataStateBlocks |
( |
|
) |
[protected, virtual] |
virtual U32 ProcessedMaterial::_getRenderStateIndex |
( |
const SceneGraphData & |
sgData |
) |
[protected, virtual] |
This returns the index into the renderState array based on the sgData passed in.
virtual void ProcessedMaterial::_setRenderState |
( |
const SceneGraphData & |
sgData, |
|
|
const U32 |
pass | |
|
) |
| | [protected, virtual] |
Activates the correct mPasses[currPass].renderState based on scene graph info.
Member Data Documentation
The material which we are processing.
Material::StageData is used here because the shader generator throws a fit if it's passed anything else.
If we've already loaded the stage data.
Number of stages (not to be confused with number of passes).
|