Fixes Material defaults being suboptimal for material-less objects

This commit is contained in:
2025-07-09 08:08:54 -04:00
parent 2448fd39b6
commit e0e4206056
4 changed files with 11 additions and 11 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -45,7 +45,7 @@ namespace fgl::engine
struct struct
{ {
std::shared_ptr< Texture > m_color_tex {}; std::shared_ptr< Texture > m_color_tex {};
glm::vec4 m_color_factors { 0.0f }; glm::vec4 m_color_factors { 1.0f };
std::shared_ptr< Texture > m_metallic_roughness_tex; std::shared_ptr< Texture > m_metallic_roughness_tex;
float m_metallic_factor { 0.0f }; float m_metallic_factor { 0.0f };
@@ -54,19 +54,19 @@ namespace fgl::engine
struct struct
{ {
float m_scale { 0.0f }; float m_scale { 1.0f };
std::shared_ptr< Texture > m_texture; std::shared_ptr< Texture > m_texture;
} m_normal; } m_normal;
struct struct
{ {
float m_strength { 0.0f }; float m_strength { 1.0f };
std::shared_ptr< Texture > m_texture; std::shared_ptr< Texture > m_texture;
} m_occlusion; } m_occlusion;
struct struct
{ {
glm::vec3 m_factors { 0.0f }; glm::vec3 m_factors { 1.0f };
std::shared_ptr< Texture > m_texture; std::shared_ptr< Texture > m_texture;
} m_emissive; } m_emissive;
@@ -85,7 +85,7 @@ namespace fgl::engine
alignas( 16 ) struct Albedo alignas( 16 ) struct Albedo
{ {
TextureID color_texture_id { constants::INVALID_TEXTURE_ID }; TextureID color_texture_id { constants::INVALID_TEXTURE_ID };
alignas( 4 * 4 ) glm::vec4 color_factors {}; alignas( 4 * 4 ) glm::vec4 color_factors { 1.0f, 1.0f, 1.0f, 1.0f };
} color; } color;
alignas( 16 ) struct Metallic alignas( 16 ) struct Metallic