![]() |
Raven Engine v0.1
|
Abstract interface for material resource binding. More...
#include <Material.h>
Public Member Functions | |
| virtual void | SetTexture (const std::string &name, const Ref< Texture2D > &texture)=0 |
| Assigns a 2D texture to the material. | |
| virtual void | SetFloat (const std::string &name, float value)=0 |
| Assigns a scalar float value to the material. | |
| virtual void | SetFloat3 (const std::string &name, const Crux::vec3 &value)=0 |
| Assigns a 3-component float vector to the material. | |
| virtual void | SetFloat4 (const std::string &name, const Crux::vec4 &value)=0 |
| Assigns a 4-component float vector to the material. | |
| virtual void | Bind (const Ref< RenderCommandBuffer > &commandBuffer, void *pipelineLayout)=0 |
| Binds this material to the GPU pipeline. | |
Static Public Member Functions | |
| static Ref< Material > | Create (const Ref< Shader > &shader) |
| Factory method to create a material for the active rendering backend. | |
Abstract interface for material resource binding.
Materials define the data provided to a shader at draw time, such as textures and uniform values. Derived classes (VulkanMaterial, future backends) implement platform-specific binding logic.
Typical workflow:
|
pure virtual |
Binds this material to the GPU pipeline.
Backend implementations update GPU state (e.g., descriptor sets in Vulkan) and bind the material's parameters to the command buffer for rendering.
| commandBuffer | Command buffer where binding occurs. |
| pipelineLayout | The pipeline layout to bind against (backend-specific). |
Implemented in Raven::VulkanMaterial.
Factory method to create a material for the active rendering backend.
The specific subclass returned depends on the current renderer API (e.g., VulkanMaterial when using Vulkan).
| shader | Shader reference defining this material's binding layout. |
|
pure virtual |
Assigns a scalar float value to the material.
| name | The shader uniform name. |
| value | The float value to bind. |
Implemented in Raven::VulkanMaterial.
|
pure virtual |
Assigns a 3-component float vector to the material.
| name | The shader uniform name. |
| value | The vec3 value to bind. |
Implemented in Raven::VulkanMaterial.
|
pure virtual |
Assigns a 4-component float vector to the material.
| name | The shader uniform name. |
| value | The vec4 value to bind. |
Implemented in Raven::VulkanMaterial.
|
pure virtual |
Assigns a 2D texture to the material.
| name | The shader resource name (e.g., "u_AlbedoMap"). |
| texture | Reference to a Texture2D resource. |
Implemented in Raven::VulkanMaterial.