![]() |
Public API Reference |
#include <material.h>
Inheritance diagram for csMaterial:
Public Methods | |
csMaterial (csEngine *engine) | |
create an empty material. More... | |
csMaterial (csEngine *engine, iTextureWrapper *txt) | |
create a material with only the texture given. More... | |
virtual | ~csMaterial () |
destroy material. More... | |
csRGBcolor & | GetFlatColor () |
Get the flat shading color. More... | |
float | GetDiffuse () |
Get diffuse reflection constant for the material. More... | |
void | SetDiffuse (float val) |
Set diffuse reflection constant for the material. More... | |
float | GetAmbient () |
Get ambient lighting for the material. More... | |
void | SetAmbient (float val) |
Set ambient lighting for the material. More... | |
float | GetReflection () |
Get reflection of the material. More... | |
void | SetReflection (float val) |
Set reflection of the material. More... | |
iTextureWrapper * | GetTextureWrapper () const |
Get the base diffuse texture (if none 0 is returned). More... | |
void | SetTextureWrapper (iTextureWrapper *tex) |
Set the base diffuse texture (pass 0 to set no texture). More... | |
void | AddTextureLayer (iTextureWrapper *txtwrap, uint mode, float uscale, float vscale, float ushift, float vshift) |
Add a texture layer (currently only one supported). More... | |
iTextureWrapper * | GetTextureWrapper (csStringID name) |
Get a texture (if none 0 is returned). More... | |
virtual void | SetShader (csStringID type, iShaderWrapper *shader) |
Associate a shader with a shader type. More... | |
virtual iShaderWrapper * | GetShader (csStringID type) |
Get shader associated with a shader type. More... | |
virtual void | AddChild (iShaderBranch *c) |
Add a child to this branch. More... | |
virtual void | AddVariable (csShaderVariable *v) |
Add a variable to this context. More... | |
virtual csShaderVariable * | GetVariable (csStringID name) |
Get variable. More... | |
virtual csSymbolTable * | GetSymbolTable () |
Get the symbol table (used by the implementation to store the variables). More... | |
virtual csSymbolTable * | GetSymbolTable (int i) |
Get a symbol table from the array of symbol tables. More... | |
virtual void | SelectSymbolTable (int i) |
Select the current symbol table from the array of symbol tables. More... | |
virtual void | SetEffect (iEffectDefinition *ed) |
Set effect. More... | |
virtual iEffectDefinition * | GetEffect () |
Get effect. More... | |
virtual iTextureHandle * | GetTexture () |
Get texture. More... | |
virtual iTextureHandle * | GetTexture (csStringID name) |
Get a texture from the material. More... | |
virtual int | GetTextureLayerCount () |
Get num texture layers. More... | |
virtual csTextureLayer * | GetTextureLayer (int idx) |
Get a texture layer. More... | |
virtual void | GetFlatColor (csRGBpixel &oColor, bool useTextureMean=true) |
Get flat color. More... | |
virtual void | SetFlatColor (const csRGBcolor &col) |
Set the flat shading color. More... | |
virtual void | GetReflection (float &oDiffuse, float &oAmbient, float &oReflection) |
Get reflection values (diffuse, ambient, reflection). More... | |
virtual void | SetReflection (float oDiffuse, float oAmbient, float oReflection) |
Set reflection values (diffuse, ambient, reflection). More... | |
void | Visit () |
Visit all textures. More... | |
Public Attributes | |
csMaterial::MaterialEngine | scfiMaterialEngine |
iMaterialEngine implementation. More... | |
Friends | |
class | csEngine |
Definition at line 78 of file csengine/material.h.
|
create an empty material.
|
|
create a material with only the texture given.
|
|
destroy material.
|
|
Add a child to this branch.
Implements iShaderBranch. Definition at line 191 of file csengine/material.h. References csSymbolTable::AddChild, iShaderBranch::GetSymbolTable, and SCF_QUERY_INTERFACE. |
|
Add a texture layer (currently only one supported).
|
|
Add a variable to this context.
Implements iShaderBranch. Definition at line 197 of file csengine/material.h. References csShaderVariable::GetName, and csSymbolTable::SetSymbol. |
|
Get ambient lighting for the material.
|
|
Get diffuse reflection constant for the material.
|
|
Get effect.
Implements iMaterial. |
|
Get flat color.
Implements iMaterial. |
|
Get the flat shading color.
|
|
Get reflection values (diffuse, ambient, reflection).
Implements iMaterial. |
|
Get reflection of the material.
|
|
Get shader associated with a shader type.
Implements iMaterial. |
|
Get a symbol table from the array of symbol tables. If there is only one symbol table, return that one. Implements iShaderBranch. Definition at line 206 of file csengine/material.h. |
|
Get the symbol table (used by the implementation to store the variables).
Implements iShaderBranch. Definition at line 205 of file csengine/material.h. |
|
Get a texture from the material.
Implements iMaterial. |
|
Get texture.
Implements iMaterial. |
|
Get a texture layer.
Implements iMaterial. |
|
Get num texture layers.
Implements iMaterial. |
|
Get a texture (if none 0 is returned).
|
|
Get the base diffuse texture (if none 0 is returned).
Definition at line 168 of file csengine/material.h. |
|
Get variable.
Implements iShaderBranch. Definition at line 201 of file csengine/material.h. References csStringID, and csSymbolTable::GetSymbol. |
|
Select the current symbol table from the array of symbol tables. If there is only one symbol table, this is a no-op. Implements iShaderBranch. Definition at line 207 of file csengine/material.h. |
|
Set ambient lighting for the material.
|
|
Set diffuse reflection constant for the material.
|
|
Set effect.
Implements iMaterial. |
|
Set the flat shading color.
Implements iMaterial. |
|
Set reflection values (diffuse, ambient, reflection).
Implements iMaterial. |
|
Set reflection of the material.
|
|
Associate a shader with a shader type.
Implements iMaterial. |
|
Set the base diffuse texture (pass 0 to set no texture).
|
|
Visit all textures.
|
|
iMaterialEngine implementation.
|