![]() |
rag
graphic 2d engine
|
Represents a render material that would affect how objects will be rendered. More...
#include <Material.h>
Public Types | |
enum | EBlendMode { BLEND_NORMAL, BLEND_ADD, BLEND_PRE_ADD } |
Public Member Functions | |
Material (const std::string &vsh, const std::string &fsh) | |
Default constructor using two paths for vertex and fragment shader respectively. | |
virtual | ~Material () |
Default destructor. | |
void | setUniform (const std::string &name, float value) |
Set float shader uniform. | |
void | setUniform (const std::string &name, const glm::vec2 &value) |
Set vec2 shader uniform. | |
void | setUniform (const std::string &name, const glm::vec3 &value) |
Set vec3 shader uniform. | |
void | setUniform (const std::string &name, const glm::vec4 &value) |
Set vec4 shader uniform. | |
void | setUniform (const std::string &name, const glm::mat3 &value) |
Set mat3 shader uniform. | |
void | setUniform (const std::string &name, const glm::mat4 &value) |
Set mat4 shader uniform. | |
const std::vector< TUniformVar > & | getUniforms () const |
Returns the list of all uniforms related with the current shader program. | |
Public Attributes | |
std::string | vsh |
Path for vertex shader. | |
std::string | fsh |
Path for fragment shader. | |
int | textureId |
Texture id. | |
EBlendMode | blendMode |
Blending mode. | |
int | priority |
Materials with higher priority are propagated down in the Display List. | |
bool | stopsPropagation |
If true, no matter priorities, material won't be affected by parent materials. | |
Friends | |
class | Renderer |
Represents a render material that would affect how objects will be rendered.
A Material is based in a vertex and fragment Shader. A texture is linked to the material, and a blend mode. Everything will contribute to the final result when the object is rendered.