Class Material¶
Defined in File material.h
Inheritance Relationships¶
Base Type¶
public portal::Resource(Class Resource)
Derived Type¶
public portal::renderer::vulkan::VulkanMaterial(Class VulkanMaterial)
Class Documentation¶
-
class Material : public portal::Resource¶
Abstract material interface for shader parameter binding.
Binds shader parameters (uniforms, textures, images) by name using reflection. Supports scalars, vectors, matrices, textures, and images.
Subclassed by portal::renderer::vulkan::VulkanMaterial
Public Functions
-
template<typename T>
inline void set(const StringId bind_point, const T &t)¶ Binds scalar uniform (int, float, etc.)
- Template Parameters:
T – Scalar type
- Parameters:
bind_point – Uniform name
t – Value to bind
-
template<reflection::IsVec T>
inline void set(const StringId bind_point, const T &t)¶ Binds vector uniform (vec2, vec3, vec4)
- Template Parameters:
T – Vector type
- Parameters:
bind_point – Uniform name
t – Value to bind
-
template<reflection::IsMatrix T>
inline void set(const StringId bind_point, const T &t)¶ Binds matrix uniform (mat2, mat3, mat4)
- Template Parameters:
T – Matrix type
- Parameters:
bind_point – Uniform name
t – Value to bind
-
virtual void set(StringId bind_point, const ResourceReference<Texture> &texture) = 0¶
Binds texture (resource reference)
-
template<typename T>
inline T &get(const StringId bind_point)¶ Gets scalar uniform value.
- Template Parameters:
T – Scalar type
- Parameters:
bind_point – Uniform name
- Returns:
Reference to uniform value
-
template<reflection::IsVec T>
inline T &get(const StringId bind_point)¶ Gets vector uniform value.
- Template Parameters:
T – Vector type
- Parameters:
bind_point – Uniform name
- Returns:
Reference to uniform value
-
template<reflection::IsMatrix T>
inline T &get(const StringId bind_point)¶ Gets matrix uniform value.
- Template Parameters:
T – Matrix type
- Parameters:
bind_point – Uniform name
- Returns:
Reference to uniform value
-
virtual Reference<ShaderVariant> get_shader() = 0¶
Gets material shader.
Public Static Functions
-
static inline portal::ResourceType static_type()¶
-
template<typename T>