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:
authorDalai Felinto <dfelinto@gmail.com>2019-02-20 00:33:46 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-02-20 00:51:14 +0300
commit0e7409d466f25f70674151b5fe62177104938729 (patch)
tree23818db535d435e87b7da2b7c66bbfceec19f941 /source/blender/draw
parenta10dc319ca069a16ca103b867e96d2fb2c40c387 (diff)
EEVEE Shader comments: Explain why material gets darkened when using mix shader
We are still ditching the specular intensity of SSR (ssr_data.xyz). But at least now there is some comment about it. See T61704 for user reports on that matter. Comments with the blessing of Clément Foucault.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
index 28ffe37abf1..64473d93054 100644
--- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
@@ -741,16 +741,23 @@ Closure closure_mix(Closure cl1, Closure cl2, float fac)
# endif
# endif
}
+
+ /* When mixing SSR don't blend roughness.
+ *
+ * It makes no sense to mix them really, so we take either one of them and
+ * tone down its specularity (ssr_data.xyz) while keeping its roughness (ssr_data.w).
+ */
if (cl1.ssr_id == outputSsrId) {
- cl.ssr_data = mix(cl1.ssr_data.xyzw, vec4(vec3(0.0), cl1.ssr_data.w), fac); /* do not blend roughness */
+ cl.ssr_data = mix(cl1.ssr_data.xyzw, vec4(vec3(0.0), cl1.ssr_data.w), fac);
cl.ssr_normal = cl1.ssr_normal;
cl.ssr_id = cl1.ssr_id;
}
else {
- cl.ssr_data = mix(vec4(vec3(0.0), cl2.ssr_data.w), cl2.ssr_data.xyzw, fac); /* do not blend roughness */
+ cl.ssr_data = mix(vec4(vec3(0.0), cl2.ssr_data.w), cl2.ssr_data.xyzw, fac);
cl.ssr_normal = cl2.ssr_normal;
cl.ssr_id = cl2.ssr_id;
}
+
cl.opacity = mix(cl1.opacity, cl2.opacity, fac);
cl.radiance = mix(cl1.radiance * cl1.opacity, cl2.radiance * cl2.opacity, fac);
cl.radiance /= max(1e-8, cl.opacity);