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>2021-05-23 03:42:46 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-05-23 03:42:46 +0300
commitf7f1ee9e990b2d85c3ad55af041a9120c0250e60 (patch)
tree724b5711d1099c4bce61235dd97441aafbdfd1d5 /source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl
parente91df656f5bc2ec9c80915fd029127920172733d (diff)
EEVEE: Add back split sum BSDF approximation
This improves the surface appearance of most bsdf.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl b/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl
index e739961fb93..9f05006210e 100644
--- a/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl
@@ -2,6 +2,7 @@
#pragma BLENDER_REQUIRE(common_view_lib.glsl)
#pragma BLENDER_REQUIRE(common_math_lib.glsl)
#pragma BLENDER_REQUIRE(eevee_surface_lib.glsl)
+#pragma BLENDER_REQUIRE(eevee_bsdf_lib.glsl)
#pragma BLENDER_REQUIRE(eevee_gbuffer_lib.glsl)
#pragma BLENDER_REQUIRE(eevee_nodetree_eval_lib.glsl)
#pragma BLENDER_REQUIRE(eevee_sampling_lib.glsl)
@@ -12,6 +13,11 @@ layout(std140) uniform sampling_block
SamplingData sampling;
};
+uniform sampler2DArray utility_tx;
+
+utility_tx_fetch_define(utility_tx);
+utility_tx_sample_define(utility_tx);
+
layout(location = 0) out uvec4 out_diffuse_data; /* Diffuse BSDF, BSSSDF, Translucency. */
layout(location = 1) out uvec2 out_reflection_data; /* Glossy BSDF. */
layout(location = 2) out uvec4 out_refraction_data; /* Refraction BSDF. */
@@ -24,7 +30,8 @@ void main(void)
g_data = init_globals();
float noise_offset = sampling_rng_1D_get(sampling, SAMPLING_CLOSURE);
- g_data.closure_rand = interlieved_gradient_noise(gl_FragCoord.xy, 0, noise_offset);
+ float noise = utility_tx_fetch(gl_FragCoord.xy, UTIL_BLUE_NOISE_LAYER).r;
+ g_data.closure_rand = fract(noise + noise_offset);
nodetree_surface();