From 277b4f4b9377b7d43e730aa3219ee1a82f9885d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Sch=C3=B6n?= Date: Mon, 22 Feb 2021 17:50:13 +0100 Subject: Fix Principled BSDF specular color for black base color Specular color is set to black instead of white inside the Principled BSDF when the base color is set to fully black. This is contradictory to the sample code of the Disney BRDF in BRDF Explorer. This patch aligns both implementations. Differential Revision: https://developer.blender.org/D10448 --- source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl index 40fe83a3616..49c8973a8ce 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl @@ -2,7 +2,7 @@ vec3 tint_from_color(vec3 color) { float lum = dot(color, vec3(0.3, 0.6, 0.1)); /* luminance approx. */ - return (lum > 0.0) ? color / lum : vec3(0.0); /* normalize lum. to isolate hue+sat */ + return (lum > 0.0) ? color / lum : vec3(1.0); /* normalize lum. to isolate hue+sat */ } float principled_sheen(float NV) -- cgit v1.2.3