Maria GDK 5.0.0.738
Documentation of native code in develop branch
Loading...
Searching...
No Matches
STK::Material Class Reference

#include <StkMaterial.h>

Public Member Functions

void merge (const Material &mat)
 
void setName (const std::string &name)
 
const std::string & getName () const
 
void setDepthTest (const bool depth_test)
 
bool getDepthTest () const
 
void setShaderProgram (const std::shared_ptr< ShaderProgram > &shader_program)
 
const std::shared_ptr< ShaderProgram > & getShaderProgram () const
 
void setTexture (const std::shared_ptr< Texture > &texture)
 
const std::shared_ptr< Texture > & getTexture () const
 
void setTextureTransform (const std::shared_ptr< STK::TextureTransform > &tex_xfm)
 
std::shared_ptr< STK::TextureTransformgetTextureTransform () const
 
void setBlendFunc (const std::shared_ptr< BlendFunc > &blend)
 Set blending function.
 
const std::shared_ptr< BlendFunc > & getBlendFunc () const
 
void apply (const std::shared_ptr< const Material > &curr_material=nullptr)
 
void setCastShadows (const bool cast_shadows)
 
bool getCastShadows () const
 
std::shared_ptr< MaterialrefCopy ()
 

Protected Attributes

std::shared_ptr< ShaderProgramshader_program_
 
std::shared_ptr< Texturetexture_
 
std::shared_ptr< TextureTransformtex_xfm_
 
std::shared_ptr< BlendFuncblend_func_
 
std::string name_
 
bool cast_shadows_
 
bool depth_test_
 

Detailed Description

Material - Simple material class with only color texture

Member Function Documentation

◆ apply()

void Material::apply ( const std::shared_ptr< const Material > &  curr_material = nullptr)

Apply material. This method will apply the current material settings in the current GL context. If a curr_material is given, we compare each material setting with the current state first to avoid unnecessary state changes.

◆ setCastShadows()

void STK::Material::setCastShadows ( const bool  cast_shadows)
inline

Enable/disable shadow casting. If shadow casting is disabled, all objects with this material will be skipped in the shadow map rendering pass.


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