MaterialShaderProperties Class
Represents a Value Object for an immutable set of material properties. More...
Declaration
Public Constructors Index
| MaterialShaderProperties ()=default | |
|
Default constructor for MaterialShaderProperties. More... | |
| MaterialShaderProperties (helios::math::vec4f baseColor, float roughness=0.0f) noexcept | |
|
Constructs a MaterialShaderProperties instance with the specified values. More... | |
Public Destructor Index
| ~MaterialShaderProperties ()=default | |
|
Default destructor for MaterialShaderProperties. More... | |
Public Member Functions Index
| MaterialShaderProperties | withBaseColor (helios::math::vec4f baseColor) const noexcept |
| MaterialShaderPropertiesOverride | overrideBaseColor (helios::math::vec4f baseColor) const noexcept |
| MaterialShaderProperties | withRoughness (float roughness) const noexcept |
| void | writeUniformValues (shader::UniformValueMap &uniformValueMap) const noexcept |
|
Writes the current properties into the given UniformValueMap. More... | |
Private Member Attributes Index
| const helios::math::vec4f | baseColor_ = {1.0f, 1.0f, 1.0f, 1.0f} |
|
Base color for the material. More... | |
| const float | roughness_ = 0.0f |
|
The roughness factor of the material. More... | |
Description
Represents a Value Object for an immutable set of material properties.
This class acts as a Value Object, encapsulating fundamental material characteristics like base color and roughness. Once an instance is created, its properties cannot be changed. Methods prefixed with `with*` facilitate functional updates by returning a **new** MaterialShaderProperties instance with the specified property modified, leaving the original object - which may still be in use by existing Renderables - untouched.
Definition at line 27 of file MaterialShaderProperties.ixx.
Public Constructors
MaterialShaderProperties()
| default |
Default constructor for MaterialShaderProperties.
initializes all properties to their default values.
Definition at line 64 of file MaterialShaderProperties.ixx.
Referenced by withBaseColor and withRoughness.
MaterialShaderProperties()
| inline explicit noexcept |
Constructs a MaterialShaderProperties instance with the specified values.
- Parameters
-
baseColor The initial base color for this MaterialShaderProperties instance.
roughness The initial roughness factor for the material, which defaults to 0.0f.
Definition at line 72 of file MaterialShaderProperties.ixx.
Public Destructor
~MaterialShaderProperties()
| default |
Default destructor for MaterialShaderProperties.
Definition at line 57 of file MaterialShaderProperties.ixx.
Public Member Functions
overrideBaseColor()
| inline nodiscard noexcept |
Creates a new MaterialShaderPropertiesOverride instance with an updated base color.
This method returns a new MaterialShaderPropertiesOverride instance where only the base color has been changed to the provided value.
- Parameters
-
baseColor The new base color for the material.
- Returns
A new instance of MaterialShaderPropertiesOvrride with the updated base color.
Definition at line 105 of file MaterialShaderProperties.ixx.
withBaseColor()
| inline nodiscard noexcept |
Creates a new MaterialShaderProperties instance with an updated base color.
This method returns a new MaterialShaderProperties instance where only the base color has been changed to the provided value.
- Parameters
-
baseColor The new base color for the material.
- Returns
A new immutable instance of MaterialShaderProperties with the updated base color.
Definition at line 88 of file MaterialShaderProperties.ixx.
Reference MaterialShaderProperties.
withRoughness()
| inline nodiscard noexcept |
Creates a new MaterialShaderProperties instance with an updated roughness factor.
This method returns a new MaterialShaderProperties instance where only the roughness factor has been changed to the provided value.
- Parameters
-
roughness The new roughness factor for the material.
- Returns
A new immutable instance of MaterialShaderProperties with the updated roughness factor.
Definition at line 122 of file MaterialShaderProperties.ixx.
Reference MaterialShaderProperties.
writeUniformValues()
| inline noexcept |
Writes the current properties into the given UniformValueMap.
- Parameters
-
uniformValueMap Target map receiving the uniform values.
Definition at line 135 of file MaterialShaderProperties.ixx.
References helios::rendering::shader::MaterialBaseColor and helios::rendering::shader::MaterialRoughness.
Private Member Attributes
baseColor_
|
Base color for the material.
This value typically represents the diffuse color and includes an alpha component for potential transparency.
Definition at line 38 of file MaterialShaderProperties.ixx.
roughness_
|
The roughness factor of the material.
This value determines the microfacet distribution of the surface, influencing how light is reflected. A value of 0.0 represents a perfectly smooth, mirror-like surface. Conversely, 1.0 represents a completely rough, matte surface.
- See Also
[573-575, PJH23]
Definition at line 49 of file MaterialShaderProperties.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.