From fde970652beb2832d1fbdad7bde9172454c65eb9 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 2 Aug 2020 14:44:56 +0300 Subject: [PATCH] Use correct shader variable names for PBR materials --- shaderlib/cooktorrance.glsl | 2 +- source/pbrmaterial.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shaderlib/cooktorrance.glsl b/shaderlib/cooktorrance.glsl index 1e00e1f5..e23f1219 100644 --- a/shaderlib/cooktorrance.glsl +++ b/shaderlib/cooktorrance.glsl @@ -49,7 +49,7 @@ vec3 get_emission_color() if(use_emission_map) return texture(emission_map, texcoord.xy).rgb; else - return basic_material.emission.rgb; + return pbr_material.emission.rgb; } /* Computes the diffuse reflection of the macrosurface */ diff --git a/source/pbrmaterial.cpp b/source/pbrmaterial.cpp index 130c4bf3..8406d4e2 100644 --- a/source/pbrmaterial.cpp +++ b/source/pbrmaterial.cpp @@ -51,7 +51,7 @@ void PbrMaterial::attach_textures_to(Texturing &texturing, ProgramData &tex_shda void PbrMaterial::set_base_color(const Color &color) { base_color.value = color; - shdata.uniform("material.base_color", color); + shdata.uniform("pbr_material.base_color", color); } void PbrMaterial::set_base_color_map(const Texture *tex) @@ -67,7 +67,7 @@ void PbrMaterial::set_normal_map(const Texture *tex) void PbrMaterial::set_metalness(float value) { metalness.value = value; - shdata.uniform("material.metalness", value); + shdata.uniform("pbr_material.metalness", value); } void PbrMaterial::set_metalness_map(const Texture *tex) @@ -78,7 +78,7 @@ void PbrMaterial::set_metalness_map(const Texture *tex) void PbrMaterial::set_roughness(float value) { roughness.value = value; - shdata.uniform("material.roughness", value); + shdata.uniform("pbr_material.roughness", value); } void PbrMaterial::set_roughness_map(const Texture *tex) @@ -94,7 +94,7 @@ void PbrMaterial::set_occlusion_map(const Texture *tex) void PbrMaterial::set_emission(const Color &color) { emission.value = color; - shdata.uniform("material.emission", color); + shdata.uniform("pbr_material.emission", color); } void PbrMaterial::set_emission_map(const Texture *tex) -- 2.43.0