ZeroZero Game Engine  v0.0
A 3D game engine using Vulkan & Jolt
Classes | Public Member Functions | List of all members
StandardMaterial Class Reference

Detailed Description

Simple albedo/specular/normal material

Inheritance diagram for StandardMaterial:
Material Resource Object

Classes

struct  TextureInfo
 

Public Member Functions

 StandardMaterial (const string &name="StandardMaterial")
 
const auto & getAlbedoColor () const
 
void setAlbedoColor (const vec4 &color)
 
const auto & getAlbedoTexture () const
 
void setAlbedoTexture (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
 
vec3 getEmissiveFactor () const
 
void setEmissiveFactor (const vec3 &emissive)
 
void setEmissiveTexture (const TextureInfo &texture)
 
auto getEmissiveStrength () const
 
void setEmissiveStrength (float emissive)
 
auto getNormalScale () const
 
void setNormalScale (float scale)
 
- Public Member Functions inherited from Material
auto getCullMode () const
 
void setCullMode (const CullMode mode)
 
auto getTransparency () const
 
void setTransparency (const Transparency transparencyMode)
 
auto getAlphaScissor () const
 
void setAlphaScissor (const float scissor)
 
- Public Member Functions inherited from Resource
auto getId () const
 
const auto & getName () const
 
string toString () const override
 
virtual 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 function< void ()> &handler)
 
void emit (const Signal::signal &name, void *params=nullptr)
 

Constructor & Destructor Documentation

StandardMaterial ( const string &  name = "StandardMaterial")
explicit

Creates a StandardMaterial with default parameters

Member Function Documentation

const auto& getAlbedoColor ( ) const
nodiscardinline

Returns the material's base color.

const auto& getAlbedoTexture ( ) const
nodiscardinline

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

vec3 getEmissiveFactor ( ) const
nodiscardinline

Return the emmisive colors factor

auto getEmissiveStrength ( ) const
nodiscardinline

Returns the emmisibe colors strength

const auto& getEmissiveTexture ( ) const
nodiscardinline

Returns the emmisive colors image texture

auto getMetallicFactor ( ) const
nodiscardinline

Returns the metallic factor

const auto& getMetallicTexture ( ) const
nodiscardinline

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

auto getNormalScale ( ) const
nodiscardinline

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
nodiscardinline

Return the normal texture

float getRoughnessFactor ( ) const
nodiscardinline

Returns the roughness factor

const auto& getRoughnessTexture ( ) const
nodiscardinline

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

void setAlbedoColor ( const vec4 &  color)
inline

Sets the material's base color.

void setAlbedoTexture ( const TextureInfo texture)

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

void setEmissiveFactor ( const vec3 &  emissive)

Sets the emmisive colors factore

void setEmissiveStrength ( float  emissive)

Sets the emmisibe colors strength

void setEmissiveTexture ( const TextureInfo texture)

Sets the emmisive 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.