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/eevee_shaders.c
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/eevee_shaders.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_shaders.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_shaders.c b/source/blender/draw/engines/eevee/eevee_shaders.c
index 34a3e723161..2d91e4bb4bd 100644
--- a/source/blender/draw/engines/eevee/eevee_shaders.c
+++ b/source/blender/draw/engines/eevee/eevee_shaders.c
@@ -44,6 +44,7 @@ static struct {
/* Probes */
struct GPUShader *probe_default_sh;
struct GPUShader *probe_default_studiolight_sh;
+ struct GPUShader *probe_background_studiolight_sh;
struct GPUShader *probe_grid_display_sh;
struct GPUShader *probe_cube_display_sh;
struct GPUShader *probe_planar_display_sh;
@@ -191,6 +192,27 @@ GPUShader *EEVEE_shaders_default_studiolight_sh_get(void)
return e_data.probe_default_studiolight_sh;
}
+GPUShader *EEVEE_shaders_background_studiolight_sh_get(void)
+{
+ if (e_data.probe_background_studiolight_sh == NULL) {
+ char *frag_str = BLI_string_joinN(datatoc_octahedron_lib_glsl,
+ datatoc_common_uniforms_lib_glsl,
+ datatoc_bsdf_common_lib_glsl,
+ datatoc_lightprobe_lib_glsl,
+ datatoc_default_world_frag_glsl);
+
+ e_data.probe_background_studiolight_sh = DRW_shader_create_with_lib(
+ datatoc_background_vert_glsl,
+ NULL,
+ frag_str,
+ datatoc_common_view_lib_glsl,
+ "#define LOOKDEV_BG\n" SHADER_DEFINES);
+
+ MEM_freeN(frag_str);
+ }
+ return e_data.probe_background_studiolight_sh;
+}
+
GPUShader *EEVEE_shaders_probe_cube_display_sh_get(void)
{
if (e_data.probe_cube_display_sh == NULL) {
@@ -299,6 +321,7 @@ void EEVEE_shaders_free(void)
DRW_SHADER_FREE_SAFE(e_data.probe_grid_fill_sh);
DRW_SHADER_FREE_SAFE(e_data.probe_planar_downsample_sh);
DRW_SHADER_FREE_SAFE(e_data.probe_default_studiolight_sh);
+ DRW_SHADER_FREE_SAFE(e_data.probe_background_studiolight_sh);
DRW_SHADER_FREE_SAFE(e_data.probe_grid_display_sh);
DRW_SHADER_FREE_SAFE(e_data.probe_cube_display_sh);
DRW_SHADER_FREE_SAFE(e_data.probe_planar_display_sh);