Skip to main content

MaterialShaderProperties Class

Represents a Value Object for an immutable set of material properties. More...

Declaration

class helios::rendering::material::MaterialShaderProperties { ... }

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

MaterialShaderPropertieswithBaseColor (helios::math::vec4f baseColor) const noexcept
MaterialShaderPropertiesOverrideoverrideBaseColor (helios::math::vec4f baseColor) const noexcept
MaterialShaderPropertieswithRoughness (float roughness) const noexcept
voidwriteUniformValues (shader::UniformValueMap &uniformValueMap) const noexcept

Writes the current properties into the given UniformValueMap. More...

Private Member Attributes Index

const helios::math::vec4fbaseColor_ = {1.0f, 1.0f, 1.0f, 1.0f}

Base color for the material. More...

const floatroughness_ = 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()

helios::rendering::material::MaterialShaderProperties::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()

helios::rendering::material::MaterialShaderProperties::MaterialShaderProperties (helios::math::vec4f baseColor, float roughness=0.0f)
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.

73 helios::math::vec4f baseColor,
74 float roughness = 0.0f
75 ) noexcept : baseColor_(baseColor), roughness_(roughness){}

Public Destructor

~MaterialShaderProperties()

helios::rendering::material::MaterialShaderProperties::~MaterialShaderProperties ()
default

Default destructor for MaterialShaderProperties.

Definition at line 57 of file MaterialShaderProperties.ixx.

Public Member Functions

overrideBaseColor()

MaterialShaderPropertiesOverride helios::rendering::material::MaterialShaderProperties::overrideBaseColor (helios::math::vec4f baseColor)
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.

107 baseColor,
108 roughness_
109 );
110 }

withBaseColor()

MaterialShaderProperties helios::rendering::material::MaterialShaderProperties::withBaseColor (helios::math::vec4f baseColor)
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.

88 [[nodiscard]] MaterialShaderProperties withBaseColor(helios::math::vec4f baseColor) const noexcept {
90 baseColor,
91 roughness_
92 );
93 }

Reference MaterialShaderProperties.

withRoughness()

MaterialShaderProperties helios::rendering::material::MaterialShaderProperties::withRoughness (float roughness)
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.

122 [[nodiscard]] MaterialShaderProperties withRoughness(float roughness) const noexcept {
124 baseColor_,
125 roughness
126 );
127 }

Reference MaterialShaderProperties.

writeUniformValues()

void helios::rendering::material::MaterialShaderProperties::writeUniformValues (shader::UniformValueMap & uniformValueMap)
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.

135 void writeUniformValues(shader::UniformValueMap& uniformValueMap) const noexcept {
138 }

References helios::rendering::shader::MaterialBaseColor and helios::rendering::shader::MaterialRoughness.

Private Member Attributes

baseColor_

const helios::math::vec4f helios::rendering::material::MaterialShaderProperties::baseColor_ = {1.0f, 1.0f, 1.0f, 1.0f}

Base color for the material.

This value typically represents the diffuse color and includes an alpha component for potential transparency.

See Also

https://docs.omniverse.nvidia.com/materials-and-rendering/latest/templates/parameters/OmniPBR_Albedo.html

Definition at line 38 of file MaterialShaderProperties.ixx.

38 const helios::math::vec4f baseColor_ = {1.0f, 1.0f, 1.0f, 1.0f};

roughness_

const float helios::rendering::material::MaterialShaderProperties::roughness_ = 0.0f

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.

49 const float roughness_ = 0.0f;

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.