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:
authorClément Foucault <foucault.clem@gmail.com>2019-10-29 17:05:07 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-10-29 17:16:47 +0300
commit883e22a92ca5b2b22bd441bedc6bdd1626980f35 (patch)
treec031fc40200bf63b65f899ec25e9a4a14ab3f839 /source/blender/draw/engines/eevee/shaders
parentd758a79557c05487a2b0014f2851597738ea6ef0 (diff)
Fix T71050 EEVEE: Light Path Node broken in 2.81
Also fixes the sampling of hashed shadows.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders')
-rw-r--r--source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/prepass_frag.glsl7
2 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl b/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl
index c7ae2417904..7f255b0859d 100644
--- a/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl
@@ -43,6 +43,10 @@ layout(std140) uniform common_block
int hizMipOffset;
int rayType;
float rayDepth;
+ float alphaHashOffset;
+ float alphaHashScale;
+ float pad7;
+ float pad8;
};
/* rayType (keep in sync with ray_type) */
diff --git a/source/blender/draw/engines/eevee/shaders/prepass_frag.glsl b/source/blender/draw/engines/eevee/shaders/prepass_frag.glsl
index dea6bc020ec..b49dbfceba2 100644
--- a/source/blender/draw/engines/eevee/shaders/prepass_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/prepass_frag.glsl
@@ -12,14 +12,11 @@ float hash3d(vec3 a)
return hash(vec2(hash(a.xy), a.z));
}
-uniform float hashAlphaOffset;
-uniform float hashAlphaScale = 1.0; /* Roughly in pixel */
-
float hashed_alpha_threshold(vec3 co)
{
/* Find the discretized derivatives of our coordinates. */
float max_deriv = max(length(dFdx(co)), length(dFdy(co)));
- float pix_scale = 1.0 / (hashAlphaScale * max_deriv);
+ float pix_scale = 1.0 / (alphaHashScale * max_deriv);
/* Find two nearest log-discretized noise scales. */
float pix_scale_log = log2(pix_scale);
@@ -52,7 +49,7 @@ float hashed_alpha_threshold(vec3 co)
threshold = clamp(threshold, 1.0e-6, 1.0);
/* Jitter the threshold for TAA accumulation. */
- return fract(threshold + hashAlphaOffset);
+ return fract(threshold + alphaHashOffset);
}
#endif