Skip to main content

Material Class

Represents a parameterizable material. More...

Declaration

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

Public Constructors Index

Material (std::shared_ptr< const helios::rendering::shader::Shader > shader, std::shared_ptr< const helios::rendering::material::MaterialShaderProperties > materialProperties)

Creates a new Material. More...

Protected Constructors Index

Material ()=default

Public Destructor Index

~Material ()=default

Public Member Functions Index

const helios::rendering::material::MaterialShaderProperties &materialProperties () const noexcept

Returns a const reference to the underlying MaterialShaderProperties. More...

const helios::rendering::shader::Shader &shader () const noexcept

Returns a const ref to the shader used by this instance. More...

voidwriteUniformValues (helios::rendering::shader::UniformValueMap &uniformValueMap) const noexcept

Writes this Material's uniform values into the given map. More...

Protected Member Attributes Index

std::shared_ptr< const helios::rendering::material::MaterialShaderProperties >materialProperties_

Shared pointer for the raw, immutable MaterialShaderProperties. More...

std::shared_ptr< const helios::rendering::shader::Shader >shader_ {}

Shared pointer to the immutable Shader. More...

Protected Static Attributes Index

static const helios::util::log::Logger &logger_ = helios::util::log::LogManager::loggerForScope(HELIOS_LOG_SCOPE)

Shared logger instance for all Material objects. More...

Description

Represents a parameterizable material.

A Material contains a reference to a shared, immutable `Shader` and material properties used to configure the shader at draw time.

Definition at line 26 of file Material.ixx.

Public Constructors

Material()

helios::rendering::material::Material::Material (std::shared_ptr< const helios::rendering::shader::Shader > shader, std::shared_ptr< const helios::rendering::material::MaterialShaderProperties > materialProperties)
inline explicit

Creates a new Material.

Parameters
shader

A shared pointer to the immutable Shader used by this instance.

materialProperties

A shared pointer to the MaterialShaderProperties for this Material.

Exceptions
std::invalid_argument

if shader or materialProperties is a null shared pointer.

Definition at line 58 of file Material.ixx.

58 explicit Material(
59 std::shared_ptr<const helios::rendering::shader::Shader> shader,
60 std::shared_ptr<const helios::rendering::material::MaterialShaderProperties> materialProperties
61 ) :
62 shader_(std::move(shader)),
64 {
66 const std::string msg = !shader_ ?
67 "Material constructor received a shader nullptr." :
68 "Material constructor received a materialProperties nullptr.";
69 logger_.error(msg);
70 throw std::invalid_argument(msg);
71 }
72 }

References logger_, materialProperties, materialProperties_, shader and shader_.

Protected Constructors

Material()

helios::rendering::material::Material::Material ()
protected default

Definition at line 30 of file Material.ixx.

Public Destructor

~Material()

virtual helios::rendering::material::Material::~Material ()
virtual default

Definition at line 48 of file Material.ixx.

Public Member Functions

materialProperties()

const helios::rendering::material::MaterialShaderProperties & helios::rendering::material::Material::materialProperties ()
inline nodiscard noexcept

Returns a const reference to the underlying MaterialShaderProperties.

Returns

The const reference to this Material's MaterialShaderProperties.

Definition at line 79 of file Material.ixx.

81 }

Reference materialProperties_.

Referenced by Material.

shader()

const helios::rendering::shader::Shader & helios::rendering::material::Material::shader ()
inline nodiscard noexcept

Returns a const ref to the shader used by this instance.

Returns

A const ref to the Shader used by this Material.

Definition at line 89 of file Material.ixx.

89 [[nodiscard]] const helios::rendering::shader::Shader& shader() const noexcept {
90 return *shader_;
91 }

Reference shader_.

Referenced by Material.

writeUniformValues()

void helios::rendering::material::Material::writeUniformValues (helios::rendering::shader::UniformValueMap & uniformValueMap)
inline noexcept

Writes this Material's uniform values into the given map.

Delegates to MaterialShaderProperties::writeUniformValues().

Parameters
uniformValueMap

Target map receiving the uniform values.

Definition at line 101 of file Material.ixx.

101 void writeUniformValues(helios::rendering::shader::UniformValueMap& uniformValueMap) const noexcept {
102 materialProperties_->writeUniformValues(uniformValueMap);
103 }

Reference materialProperties_.

Protected Member Attributes

materialProperties_

std::shared_ptr<const helios::rendering::material::MaterialShaderProperties> helios::rendering::material::Material::materialProperties_
protected

Shared pointer for the raw, immutable MaterialShaderProperties.

Definition at line 35 of file Material.ixx.

35 std::shared_ptr<const helios::rendering::material::MaterialShaderProperties> materialProperties_;

Referenced by Material, materialProperties and writeUniformValues.

shader_

std::shared_ptr<const helios::rendering::shader::Shader> helios::rendering::material::Material::shader_ {}
protected

Shared pointer to the immutable Shader.

Definition at line 40 of file Material.ixx.

40 std::shared_ptr<const helios::rendering::shader::Shader> shader_{};

Referenced by Material and shader.

Protected Static Attributes

logger_

const helios::util::log::Logger& helios::rendering::material::Material::logger_ = helios::util::log::LogManager::loggerForScope(HELIOS_LOG_SCOPE)
protected static

Shared logger instance for all Material objects.

Definition at line 45 of file Material.ixx.

Referenced by Material.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.