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 <fclem>2020-02-25 15:25:49 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-02-25 15:26:01 +0300
commit6e23433c1a747660d582bfe0d15179a9c7bed51c (patch)
treeef03fea63450d6977d5ff5550b299b812d364255 /source/blender/draw/engines/eevee/shaders
parent7e7c9276022f44495d9c7f9b3e09a2bd592aeab5 (diff)
EEVEE: Lookdev: Add support for partially blurred background
This is using the GGX probe as background. This has the drawback of having the resolution choosed in the indirect lighting setting. The blurring is not really high-quality. The pros is that it has a simple implementation and is fast to evaluate. This patch also fades the background alpha to make overlay engine draw the default background color in the correct color space. Removing one colorspace hack. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6895
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders')
-rw-r--r--source/blender/draw/engines/eevee/shaders/default_world_frag.glsl15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/default_world_frag.glsl b/source/blender/draw/engines/eevee/shaders/default_world_frag.glsl
index 41e103609f3..1faa02fd354 100644
--- a/source/blender/draw/engines/eevee/shaders/default_world_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/default_world_frag.glsl
@@ -4,11 +4,12 @@ uniform vec3 color;
out vec4 FragColor;
-#ifdef LOOKDEV
+#if defined(LOOKDEV_BG) || defined(LOOKDEV)
+
uniform mat3 StudioLightMatrix;
uniform sampler2D image;
-uniform float studioLightBackground = 1.0;
uniform float studioLightIntensity = 1.0;
+uniform float studioLightBlur = 0.0;
in vec3 viewPosition;
# define M_PI 3.14159265358979323846
@@ -49,11 +50,17 @@ vec4 node_tex_environment_equirectangular(vec3 co, sampler2D ima)
void main()
{
vec3 background_color;
-#ifdef LOOKDEV
+
+#if defined(LOOKDEV_BG)
+ vec3 worldvec = background_transform_to_world(viewPosition);
+ background_color = probe_evaluate_world_spec(worldvec, studioLightBlur).rgb;
+ background_color *= studioLightIntensity;
+
+#elif defined(LOOKDEV)
vec3 worldvec = background_transform_to_world(viewPosition);
background_color = node_tex_environment_equirectangular(StudioLightMatrix * worldvec, image).rgb;
background_color *= studioLightIntensity;
- background_color = mix(color, background_color, studioLightBackground);
+
#else
background_color = color;
#endif