Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-03-10 18:09:22 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-03-10 20:05:01 +0300
commit7613ffc944ebc133f1f906ea737ab55718434cc4 (patch)
treee2c54a4b971fe955f4c7538db1fc086a997b8702 /source/blender/gpu
parent8a76f8dac3475b1d24956e0d384d65295f15c76a (diff)
Cycles: switch to squared roughness convention for all nodes.
This was already done for the Principled BSDF to be compatible with typical baked roughness maps in PBR workflows.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 1f5ffbdcc7e..a0ca719e207 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -2599,7 +2599,8 @@ void node_bsdf_glossy(vec4 color, float roughness, vec3 N, out vec4 result)
vec3 light_specular = gl_LightSource[i].specular.rgb;
/* we mix in some diffuse so low roughness still shows up */
- float bsdf = 0.5 * pow(max(dot(N, H), 0.0), 1.0 / roughness);
+ float r2 = roughness * roughness;
+ float bsdf = 0.5 * pow(max(dot(N, H), 0.0), 1.0 / r2);
bsdf += 0.5 * max(dot(N, light_position), 0.0);
L += light_specular * bsdf;
}