MatInstance

Engine/source/materials/matInstance.h

More...

Public Friends

class

Protected Attributes

Public Functions

Adds a shader macro which will be passed to the shader during initialization.

Adds this stateblock to the base state block used during initialization.

Get a MaterialParameters block for this BaseMatInstance, caller is responsible for freeing it.

Returns the active features in use by this material.

Returns the material this instance is based on.

Get the current parameters for this BaseMatInstance (BaseMatInstances are created with a default active MaterialParameters which is managed by BaseMatInstance.

Returns the features that were requested at material creation time which may differ from the active features.

Returns the state hint which can be used for sorting and fast comparisions of the equality of a material instance.

bool
bool
init(const FeatureSet & features, const GFXVertexFormat * vertexFormat)
bool

Returns true if this MatInstance is built from a CustomMaterial.

bool

Returns true if the material is forward lit and requires a list of lights which affect it when rendering.

bool

Returns true if this material is instanced.

bool

Reinitializes the material using the previous initialization parameters.

Sets the vertex and primitive buffers as well as the instancing stream buffer for the current material if the material is instanced.

Sets custom shader data.

Set the current parameters for this BaseMatInstance.

setNodeTransforms(const MatrixF * address, const U32 numTransforms)

Sets node transforms for the current stage. Used for hardware skinning.

This initializes various material scene state settings and should be called after setupPass() within the pass loop.

This is normally called from within setupPass() automatically, so its unnecessary to do so manually unless a texture stage has changed.

This initializes the material transforms and should be called after setupPass() within the pass loop.

bool

Sets up the next rendering pass for this material.

setUserObject(SimObject * userObject)

Sets a SimObject which will passed into ShaderFeature::createConstHandles.

bool

Used to increment the instance buffer for this material.

Updates the state blocks for this material.

Protected Functions

Create a material instance by reference to a Material.

Private Functions

Detailed Description

Public Friends

Protected Attributes

MatInstParameters * mActiveParameters 
bool mCreatedFromCustomMaterial 
S32 mCurPass 
Vector< MatInstanceParameterHandle * > mCurrentHandles 
Vector< MatInstParameters * > mCurrentParameters 
MatInstParameters * mDefaultParameters 
FeatureSet mFeatureList 

The features requested at material creation time.

bool mIsForwardLit 

If the processed material requires forward lighting or not.

bool mIsHardwareSkinned 

If the processed material requires bone transforms.

Material * mMaterial 
U32 mMaxStages 
ProcessedMaterial * mProcessedMaterial 
GFXStateBlockDesc mUserDefinedState 
Vector< GFXShaderMacro > mUserMacros 
SimObject * mUserObject 
const GFXVertexFormat * mVertexFormat 

The vertex format on which this material will render.

Public Functions

~MatInstance()

addShaderMacro(const String & name, const String & value)

Reimplemented from: BaseMatInstance

addStateBlockDesc(const GFXStateBlockDesc & desc)

Reimplemented from: BaseMatInstance

allocMaterialParameters()

Reimplemented from: BaseMatInstance

dumpShaderInfo()

Reimplemented from: BaseMatInstance

getCurPass()

Reimplemented from: BaseMatInstance

getCurStageNum()

Reimplemented from: BaseMatInstance

getFeatures()

Reimplemented from: BaseMatInstance

getMaterial()

Reimplemented from: BaseMatInstance

getMaterialParameterHandle(const String & name)

Reimplemented from: BaseMatInstance

getMaterialParameters()

Reimplemented from: BaseMatInstance

getPass(U32 pass)

Reimplemented from: BaseMatInstance

getProcessedMaterial()

getRequestedFeatures()

Reimplemented from: BaseMatInstance

getShaderInfo(GuiTreeViewCtrl * tree, U32 item)

Reimplemented from: BaseMatInstance

getStateHint()

Reimplemented from: BaseMatInstance

getUserObject()

Reimplemented from: BaseMatInstance

getUserStateBlock()

Reimplemented from: BaseMatInstance

getVertexFormat()

Reimplemented from: BaseMatInstance

hasAccumulation()

Reimplemented from: BaseMatInstance

hasGlow()

Reimplemented from: BaseMatInstance

init(const FeatureSet & features, const GFXVertexFormat * vertexFormat)

Reimplemented from: BaseMatInstance

Reimplemented by: LightMatInstance, DeferredMatInstance

isCustomMaterial()

Reimplemented from: BaseMatInstance

isForwardLit()

Reimplemented from: BaseMatInstance

isHardwareSkinned()

isInstanced()

Reimplemented from: BaseMatInstance

reInit()

Reimplemented from: BaseMatInstance

setBuffers(GFXVertexBufferHandleBase * vertBuffer, GFXPrimitiveBufferHandle * primBuffer)

Reimplemented from: BaseMatInstance

setCustomShaderData(Vector< CustomShaderBindingData > & shaderData)

Reimplemented from: BaseMatInstance

setMaterialParameters(MaterialParameters * param)

Reimplemented from: BaseMatInstance

setNodeTransforms(const MatrixF * address, const U32 numTransforms)

Reimplemented from: BaseMatInstance

setSceneInfo(SceneRenderState * state, const SceneData & sgData)

Reimplemented from: BaseMatInstance

setTextureStages(SceneRenderState * , const SceneData & sgData)

Reimplemented from: BaseMatInstance

setTransforms(const MatrixSet & matrixSet, SceneRenderState * state)

Reimplemented from: BaseMatInstance

setupPass(SceneRenderState * state, const SceneData & sgData)

Reimplemented from: BaseMatInstance

Reimplemented by: LightMatInstance, ShadowMatInstance, ReflectionMatInstance

setUserObject(SimObject * userObject)

Reimplemented from: BaseMatInstance

stepInstance()

Reimplemented from: BaseMatInstance

updateStateBlocks()

Reimplemented from: BaseMatInstance

Protected Functions

MatInstance(Material & mat)

Create a material instance by reference to a Material.

getShaderMaterial()

Reimplemented by: DeferredMatInstance

processMaterial()

Private Functions

construct()