KarmaEngine
Game Engine for practical learning and research purposes
|
A class for shader + texture. More...
#include <Material.h>
Public Member Functions | |
Material () | |
A constructor. | |
void | OnUpdate () |
A hook into the game loop for updating uniforms and related stuff. | |
void | ProcessForSubmission () |
Process for various things belonging to the material before submitting the VertexArray (or issuing draw call via RenderCommand::DrawIndexed). Includes uploading uniforms to GPU. | |
void | AttatchMainCamera (std::shared_ptr< Camera > mCamera) |
Caching the current camera (m_MainCamera) | |
void | AddShader (std::shared_ptr< Shader > shader) |
Add to the list of shaders used by this material. | |
void | RemoveShader (std::shared_ptr< Shader > shader) |
Remove from the list of shaders. | |
void | AddTexture (std::shared_ptr< Texture > texture) |
Add to the list of textures used by this material. | |
void | RemoveTexture (std::shared_ptr< Texture > texture) |
Remove from the list of textures. | |
std::shared_ptr< Shader > | GetShader (const std::string &shaderName) const |
Getter for shader list. | |
std::shared_ptr< Shader > | GetShader (int index) |
Getter for shader by index. | |
std::shared_ptr< Texture > | GetTexture (int index) |
Getter for texture by index. | |
A class for shader + texture.
A material is a complete description of the visual properties of a mesh. This includes a specification of the textures that are mapped to its surface and also various higher-level properties, such as which shader programs to use when rendering the mesh, the input parameters to those shaders, and other parameters that control the functionality of the graphics acceleration hardware itself.
Karma::Material::Material | ( | ) |
A constructor.
|
inline |
Add to the list of shaders used by this material.
|
inline |
Add to the list of textures used by this material.
void Karma::Material::AttatchMainCamera | ( | std::shared_ptr< Camera > | mCamera | ) |
Caching the current camera (m_MainCamera)
std::shared_ptr< Shader > Karma::Material::GetShader | ( | const std::string & | shaderName | ) | const |
Getter for shader list.
std::shared_ptr< Shader > Karma::Material::GetShader | ( | int | index | ) |
Getter for shader by index.
std::shared_ptr< Texture > Karma::Material::GetTexture | ( | int | index | ) |
Getter for texture by index.
void Karma::Material::OnUpdate | ( | ) |
A hook into the game loop for updating uniforms and related stuff.
void Karma::Material::ProcessForSubmission | ( | ) |
Process for various things belonging to the material before submitting the VertexArray (or issuing draw call via RenderCommand::DrawIndexed). Includes uploading uniforms to GPU.
|
inline |
Remove from the list of shaders.
|
inline |
Remove from the list of textures.