-
Notifications
You must be signed in to change notification settings - Fork 0
Material
Noah Gallo edited this page Mar 12, 2023
·
2 revisions
A material describes how a 3D object should be rendered. The mosic basic material simply defines a shader, but materials should also be used for storing non-object specific shader uniforms, like textures and colors (not for storing transformation matrices).
| Signature | Description |
|---|---|
| Material(Shader* shader) | Creates a new material with the given shader |
| Name | Property? | Type | Description |
|---|---|---|---|
| window | No | GLFWwindow* | A pointer to the GLFW window assciated with this window |
| scene | No | Scene | The scene this window is set to run |
| Resolution | YES | ivec2 | The Resolution of the current window |
| Signature | Return Type | Description |
|---|---|---|
| void SetBool(const string& name, bool value) | void | Set's a shader uniform bool value |
| void SetInt(const string& name, int value) | void | Set's a shader uniform int value |
| void SetFloat(const string& name, float value) | void | Set's a shader uniform float value |
| void SetVec3(const string& name, glm::vec3 value) | void | Set's a shader uniform vec3 value |
| void SetVec4(const string& name, glm::vec4 value) | void | Set's a shader uniform vec4 value |
| void SetMat4(const string& name, glm::mat4 value) | void | Set's a shader uniform mat4 value |
| Use() | void | Tells the GPU to use this material (override for custom materials and load defined uniforms here) |