![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
#include <material.hpp>
Public Member Functions | |
Material (std::string name="material") | |
Material (const Material &material)=default | |
Material (Material &&material) noexcept=default | |
~Material ()=default | |
Material & | operator= (const Material &material)=default |
Material & | operator= (Material &&material) noexcept=default |
RGBA & | GetBaseColor () noexcept |
const RGBA & | GetBaseColor () const noexcept |
TexturePtr | GetBaseColorTexture () const noexcept |
ID3D11ShaderResourceView * | GetBaseColorSRV () const noexcept |
void | SetBaseColorTexture (TexturePtr base_color_texture) noexcept |
F32 | GetRoughness () const noexcept |
void | SetRoughness (F32 roughness) noexcept |
F32 | GetMetalness () const noexcept |
void | SetMetalness (F32 metalness) noexcept |
const RGBA | GetMaterialRGBA () const noexcept |
TexturePtr | GetMaterialTexture () const noexcept |
ID3D11ShaderResourceView * | GetMaterialSRV () const noexcept |
void | SetMaterialTexture (TexturePtr material_texture) noexcept |
TexturePtr | GetNormalTexture () const noexcept |
ID3D11ShaderResourceView * | GetNormalSRV () const noexcept |
void | SetNormalTexture (TexturePtr normal_texture) |
bool | IsOpaque () const noexcept |
bool | IsTransparant () const noexcept |
void | SetOpaque () noexcept |
void | SetTransparent (bool transparent=true) noexcept |
F32 | GetRadiance () const noexcept |
void | SetRadiance (F32 radiance) noexcept |
const RGB | GetRadianceSpectrum () const noexcept |
bool | IsEmissive () const noexcept |
const std::string_view | GetName () const noexcept |
void | SetName (std::string name) noexcept |
Private Attributes | |
RGBA | m_base_color |
TexturePtr | m_base_color_texture |
F32 | m_roughness |
F32 | m_metalness |
TexturePtr | m_material_texture |
TexturePtr | m_normal_texture |
bool | m_transparent |
F32 | m_radiance |
std::string | m_name |
A class of materials.
|
explicit |
Constructs a material.
[in] | name | The name of the material. |
|
default |
Constructs a material from the given material.
[in] | material | A reference to the material to copy. |
|
defaultnoexcept |
Constructs a material by moving the given material.
[in] | material | A reference to the material to move. |
|
default |
Destructs this material.
|
noexcept |
Returns the (linear) base color of this material.
|
noexcept |
Returns the (linear) base color of this material.
|
noexcept |
Returns the shader resource view of the base color texture of this material.
nullptr
, if this material has no base color texture.
|
noexcept |
Returns the base color texture of this material.
|
noexcept |
|
noexcept |
Returns the shader resource view of the material texture of this material.
nullptr
, if this material has no material texture.
|
noexcept |
Returns the material texture of this material.
|
noexcept |
Returns the metalness of this material.
|
noexcept |
Returns the name of this material.
|
noexcept |
Returns the shader resource view of the normal texture of this material.
nullptr
, if this material has no normal texture.
|
noexcept |
Returns the normal texture of this material.
|
noexcept |
Returns the radiance of this material.
|
noexcept |
Returns the radiance spectrum of this material.
|
noexcept |
Returns the roughness of this material.
|
noexcept |
Checks whether this material is emissive and acts as a black body.
true
if this material is emissive and acts as a black body. false
otherwise.
|
noexcept |
Checks whether this material is opaque (i.e. contains alpha channel equal to 1.0).
true
if and only if this material is opaque. false
otherwise.
|
noexcept |
Checks whether this material is transparent (i.e. contains alpha channel not equal to 1.0).
true
if and only if this material is transparent. false
otherwise. Copies the given material to this material.
[in] | material | A reference to the material to copy. |
Moves the given material to this material.
[in] | material | A reference to the material to move. |
|
noexcept |
Sets the base color texture of this material to the given base color texture.
[in] | base_color_texture | A pointer to the base color texture. |
|
noexcept |
Sets the material texture of this material to the given material texture.
[in] | material_texture | A pointer to the material texture. |
|
noexcept |
Sets the metalness of this material to the given value.
[in] | metalness | The metalness. |
|
noexcept |
Sets the name of this material to the given name.
[in] | name | The name. |
void mage::rendering::Material::SetNormalTexture | ( | TexturePtr | normal_texture | ) |
Sets the normal texture of this material to the given normal texture.
[in] | normal_texture | The normal texture. |
|
noexcept |
Makes this material opaque.
|
noexcept |
Sets the radiance of this material to the given radiance.
[in] | radiance | The radiance in watts per square meter per steradians. |
|
noexcept |
Sets the roughness of this material to the given value.
[in] | roughness | The roughness. |
|
noexcept |
Makes this material transparent.
[in] | transparent | true if and only if this material is transparent. false otherwise. |
|
private |
The (linear) base color of this material.
|
private |
A pointer to the base color texture of this material.
|
private |
A pointer to the material texture of this material.
The red channel contains the roughness of this material. The blue channel contains the metalness of this material.
|
private |
The metalness of this material.
|
private |
The name of this material.
|
private |
A pointer to the normal texture of this material.
|
private |
The radiance in watts per square meter per steradians of this material.
|
private |
The roughness of this material.
|
private |
Flag indicating whether this material is transparent. This flag is true
if this material could contain transparent parts. false
otherwise.