Aether3D Game Engine
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ae3d::Material Class Reference

Material is used to render a mesh. More...

#include <Material.hpp>

Public Types

enum  DepthFunction { NoneWriteOff, LessOrEqualWriteOn }
 Depth function used when rendering a mesh using material.
 

Public Member Functions

class ShaderGetShader ()
 
bool IsValidShader () const
 
void Apply ()
 Applies the uniforms into the shader. Called internally.
 
bool IsBackFaceCulled () const
 
void SetBackFaceCulling (bool enable)
 
DepthFunction GetDepthFunction () const
 
void SetDepthFunction (DepthFunction aDepthFunction)
 
void SetMatrix (const char *name, const Matrix44 &matrix)
 
void SetShader (Shader *shader)
 
void SetTexture (const char *name, class Texture2D *texture)
 
void SetTexture (const char *name, class TextureCube *texture)
 
void SetRenderTexture (const char *name, RenderTexture *renderTexture)
 
void SetInt (const char *name, int value)
 
void SetFloat (const char *name, float value)
 
void SetVector (const char *name, const Vec3 &vec3)
 
void SetVector (const char *name, const Vec4 &vec)
 

Static Public Member Functions

static void SetGlobalRenderTexture (const char *name, class RenderTexture *renderTexture)
 

Detailed Description

Material is used to render a mesh.

Member Function Documentation

DepthFunction ae3d::Material::GetDepthFunction ( ) const
inline
Returns
Depth function.
class Shader* ae3d::Material::GetShader ( )
inline
Returns
shader.
bool ae3d::Material::IsBackFaceCulled ( ) const
inline
Returns
True, if backfaces are culled.
bool ae3d::Material::IsValidShader ( ) const
Returns
True if the shader exists and has been compiled and linked successfully.
void ae3d::Material::SetBackFaceCulling ( bool  enable)
inline
Parameters
enableEnable backface culling. Defaults to true.
void ae3d::Material::SetDepthFunction ( DepthFunction  aDepthFunction)
inline
Parameters
aDepthFunctionDepth function.
void ae3d::Material::SetFloat ( const char *  name,
float  value 
)
Parameters
nameFloat uniform name.
valueValue.
static void ae3d::Material::SetGlobalRenderTexture ( const char *  name,
class RenderTexture renderTexture 
)
static

Sets a texture into every material, overriding textures set by SetTexture.

Parameters
nameTexture uniform name.
renderTextureRender texture.
void ae3d::Material::SetInt ( const char *  name,
int  value 
)
Parameters
nameInteger uniform name.
valueValue.
void ae3d::Material::SetMatrix ( const char *  name,
const Matrix44 &  matrix 
)
Parameters
nameName. This is a uniform in the shader.
matrix4x4 matrix.
void ae3d::Material::SetRenderTexture ( const char *  name,
RenderTexture renderTexture 
)
Parameters
nameTexture uniform name.
renderTextureRender texture.
void ae3d::Material::SetShader ( Shader shader)
Parameters
shaderShader.
void ae3d::Material::SetTexture ( const char *  name,
class Texture2D texture 
)
Parameters
nameName. This is a uniform in the shader.
textureTexture.
void ae3d::Material::SetTexture ( const char *  name,
class TextureCube texture 
)
Parameters
nameTexture uniform name.
textureTexture.
void ae3d::Material::SetVector ( const char *  name,
const Vec3 vec3 
)
Parameters
nameVector uniform name.
vec3Vector.
void ae3d::Material::SetVector ( const char *  name,
const Vec4 vec 
)
Parameters
nameName. This is a uniform in the shader.
vecVector.

The documentation for this class was generated from the following file: