Lysa  0.0
Lysa 3D Engine
StandardMaterial Class Reference

Detailed Description

Simple albedo/specular/normal material

+ Inheritance diagram for StandardMaterial:

Classes

struct  TextureInfo
 

Public Member Functions

 StandardMaterial (const std::string &name="StandardMaterial")
 
const auto & getAlbedoColor () const
 
void setAlbedoColor (const float4 &color)
 
const auto & getDiffuseTexture () const
 
void setDiffuseTexture (const TextureInfo &texture)
 
const auto & getNormalTexture () const
 
void setNormalTexture (const TextureInfo &texture)
 
auto getMetallicFactor () const
 
void setMetallicFactor (float metallic)
 
const auto & getMetallicTexture () const
 
void setMetallicTexture (const TextureInfo &texture)
 
float getRoughnessFactor () const
 
void setRoughnessFactor (float roughness)
 
const auto & getRoughnessTexture () const
 
void setRoughnessTexture (const TextureInfo &texture)
 
const auto & getEmissiveTexture () const
 
float3 getEmissiveFactor () const
 
void setEmissiveFactor (const float3 &emissive)
 
float getEmissiveStrength () const
 
void setEmissiveStrength (float strength)
 
void setEmissiveTexture (const TextureInfo &texture)
 
auto getNormalScale () const
 
void setNormalScale (float scale)
 
MaterialData getMaterialData () const override
 
pipeline_id getPipelineId () const override
 
- Public Member Functions inherited from Material
auto getCullMode () const
 
void setCullMode (const vireo::CullMode mode)
 
auto getTransparency () const
 
void setTransparency (const Transparency transparencyMode)
 
auto getAlphaScissor () const
 
void setAlphaScissor (const float scissor)
 
auto isUploaded () const
 
void upload ()
 
const auto & getMaterialIndex () const
 
auto getType () const
 
void setBypassUpload (const bool bypass)
 
- Public Member Functions inherited from Resource
 Resource (const std::string &name)
 
auto getId () const
 
const auto & getName () const
 
bool operator== (const Resource &other) const
 
bool operator< (const Resource &other) const
 
bool operator> (const Resource &other) const
 
virtual std::shared_ptr< Resource > duplicate () const
 
- Public Member Functions inherited from Object
void connect (const Signal::signal &name, const Signal::Handler &handler)
 
void connect (const Signal::signal &name, const std::function< void ()> &handler)
 
void emit (const Signal::signal &name, void *params=nullptr)
 
virtual std::string toString () const
 
 Object () = default
 
virtual ~Object () = default
 

Additional Inherited Members

- Public Types inherited from Material
enum  Type { STANDARD, SHADER }
 
- Protected Member Functions inherited from Material
 Material (Type type, const std::string &name)
 

Constructor & Destructor Documentation

StandardMaterial ( const std::string &  name = "StandardMaterial")

Creates a StandardMaterial with default parameters

Member Function Documentation

const auto& getAlbedoColor ( ) const
inline

Returns the material's base color.

const auto& getDiffuseTexture ( ) const
inline

Returns the diffuse texture (texture to multiply by albedo color. Used for basic texturing of objects).

float3 getEmissiveFactor ( ) const
inline

Return the emissive colors factor

float getEmissiveStrength ( ) const
inline

Return the emissive colors strength

const auto& getEmissiveTexture ( ) const
inline

Returns the emissive colors image texture

MaterialData getMaterialData ( ) const
overridevirtual
auto getMetallicFactor ( ) const
inline

Returns the metallic factor

const auto& getMetallicTexture ( ) const
inline

Return the metallic image texture. Only the BLUE channel is used by the default shader.

auto getNormalScale ( ) const
inline

Returns the scale applied to the normal image texture. See https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_material_normaltextureinfo_scale

const auto& getNormalTexture ( ) const
inline

Returns the normal texture

pipeline_id getPipelineId ( ) const
overridevirtual
float getRoughnessFactor ( ) const
inline

Returns the roughness factor

const auto& getRoughnessTexture ( ) const
inline

Returns the roughness image texture. Only the RED channel is used by the default shader.

void setAlbedoColor ( const float4 &  color)

Sets the material's base color.

void setDiffuseTexture ( const TextureInfo texture)

Sets the diffuse texture (texture to multiply by albedo color. Used for basic texturing of objects).

void setEmissiveFactor ( const float3 &  emissive)

Sets the emissive colors factor

void setEmissiveStrength ( float  strength)

Sets the emissive colors strength

void setEmissiveTexture ( const TextureInfo texture)

Sets the emissive colors image texture. Used as a linear RGB texture by the default shader.

void setMetallicFactor ( float  metallic)

Sets the metallic factor

void setMetallicTexture ( const TextureInfo texture)

Sets the metallic image texture. Only the BLUE channel is used by the default shader.

void setNormalScale ( float  scale)
void setNormalTexture ( const TextureInfo texture)

Sets the normal texture

void setRoughnessFactor ( float  roughness)

Sets the roughness factor

void setRoughnessTexture ( const TextureInfo texture)

Sets the roughness image texture. Only the RED channel is used by the default shader.