ShaderData

Engine/source/materials/shaderData.h

More...

Protected Types

enum
_Anonymous_ {  NumTextures = 8
}
ShaderCache 

Private Types

Parent 

Protected Static Attributes

Protected Attributes

A semicolon, tab, or newline delimited string of case sensitive defines that are passed to the shader compiler.

bool
mRTParams [NumTextures]
mSamplerNames [NumTextures]

The shader macros built from mDefines.

Protected Functions

bool

Creates a new shader returning NULL on error.

Returns the shader macros taking care to rebuild them if the content has changed.

Helper for converting an array of macros into a formatted string.

Protected Static Functions

_onLMActivate(const char * lm, bool activate)

Public Functions

Returns the required pixel shader version for this shader.

Returns an initialized shader instance or NULL if the shader failed to be created.

bool
bool
hasSamplerDef(const String & samplerName, int & pos)
bool

Called when the object is added to the sim.

Called when the object is removed from the sim.

Forces a reinitialization of all the instanced shaders.

setSamplerName(const String & name, int idx)

Public Static Functions

Forces a reinitialization of the instanced shaders for all loaded ShaderData objects in the system.

Detailed Description

Protected Types

@112

Enumerator

NumTextures = 8
typedef HashTable< String, GFXShaderRef > ShaderCache 

Private Types

typedef SimObject Parent 

Protected Static Attributes

Vector< ShaderData * > smAllShaderData 

Protected Attributes

String mDefines 

A semicolon, tab, or newline delimited string of case sensitive defines that are passed to the shader compiler.

For example:

SAMPLE_TAPS=10;USE_TEXKILL;USE_TORQUE_FOG=1

FileName mDXPixelShaderName 
FileName mDXVertexShaderName 
FileName mOGLPixelShaderName 
FileName mOGLVertexShaderName 
F32 mPixVersion 
bool mRTParams [NumTextures]
String mSamplerNames [NumTextures]
Vector< GFXShaderMacro > mShaderMacros 

The shader macros built from mDefines.

ShaderCache mShaders 
bool mUseDevicePixVersion 

Protected Functions

_checkDefinition(GFXShader * shader)

_createShader(const Vector< GFXShaderMacro > & macros)

Creates a new shader returning NULL on error.

_getMacros()

Returns the shader macros taking care to rebuild them if the content has changed.

_stringizeMacros(const Vector< GFXShaderMacro > & macros, String * outString)

Helper for converting an array of macros into a formatted string.

Protected Static Functions

_onLMActivate(const char * lm, bool activate)

Public Functions

ShaderData()

DECLARE_CONOBJECT(ShaderData )

getPixVersion()

Returns the required pixel shader version for this shader.

getSamplerName(int idx)

getShader(const Vector< GFXShaderMacro > & macros)

Returns an initialized shader instance or NULL if the shader failed to be created.

hasRTParamsDef(const int pos)

hasSamplerDef(const String & samplerName, int & pos)

onAdd()

Reimplemented from: SimObject

onRemove()

Reimplemented from: SimObject

reloadShaders()

Forces a reinitialization of all the instanced shaders.

setSamplerName(const String & name, int idx)

Public Static Functions

initPersistFields()

reloadAllShaders()

Forces a reinitialization of the instanced shaders for all loaded ShaderData objects in the system.