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:
authorJeroen Bakker <j.bakker@atmind.nl>2018-05-25 09:06:36 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-05-28 18:07:39 +0300
commit765fd29d6855d098d8fcdd72ba595dfd1e4e4e17 (patch)
treef1877bfcaf5f4a309f294e2fb516a61c9d6f01aa /source/blender/draw/engines/eevee/eevee_lightprobes.c
parentce5fa2decad115f023e2f5591255078768b4fa5e (diff)
EEvEE: LookDev
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lightprobes.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightprobes.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index d2faeb6ed39..c7a2951a670 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -71,6 +71,7 @@
static struct {
struct GPUShader *probe_default_sh;
+ struct GPUShader *probe_default_studiolight_sh;
struct GPUShader *probe_filter_glossy_sh;
struct GPUShader *probe_filter_diffuse_sh;
struct GPUShader *probe_filter_visibility_sh;
@@ -214,6 +215,9 @@ static void lightprobe_shaders_init(void)
e_data.probe_default_sh = DRW_shader_create(
datatoc_background_vert_glsl, NULL, datatoc_default_world_frag_glsl, NULL);
+ e_data.probe_default_studiolight_sh = DRW_shader_create(
+ datatoc_background_vert_glsl, NULL, datatoc_default_world_frag_glsl, "#define LOOKDEV\n");
+
MEM_freeN(shader_str);
shader_str = BLI_string_joinN(
@@ -411,7 +415,11 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
World *wo = scene->world;
float *col = ts.colorBackground;
- if (wo) {
+
+ /* LookDev */
+ EEVEE_lookdev_cache_init(vedata, &grp, e_data.probe_default_studiolight_sh, psl->probe_background, pinfo);
+ /* END */
+ if (!grp && wo) {
col = &wo->horr;
bool wo_sh_compiled = true;
@@ -445,6 +453,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
if (wo->update_flag != 0 || pinfo->prev_world != wo || pinfo->prev_wo_sh_compiled != wo_sh_compiled) {
pinfo->update_world |= PROBE_UPDATE_ALL;
+ pinfo->studiolight_index = 0;
pinfo->prev_wo_sh_compiled = wo_sh_compiled;
pinfo->prev_world = wo;
}
@@ -452,6 +461,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
}
else if (pinfo->prev_world) {
pinfo->update_world |= PROBE_UPDATE_ALL;
+ pinfo->studiolight_index = 0;
pinfo->prev_wo_sh_compiled = false;
pinfo->prev_world = NULL;
}
@@ -1830,6 +1840,7 @@ void EEVEE_lightprobes_free(void)
MEM_SAFE_FREE(e_data.format_probe_display_cube);
MEM_SAFE_FREE(e_data.format_probe_display_planar);
DRW_SHADER_FREE_SAFE(e_data.probe_default_sh);
+ DRW_SHADER_FREE_SAFE(e_data.probe_default_studiolight_sh);
DRW_SHADER_FREE_SAFE(e_data.probe_filter_glossy_sh);
DRW_SHADER_FREE_SAFE(e_data.probe_filter_diffuse_sh);
DRW_SHADER_FREE_SAFE(e_data.probe_filter_visibility_sh);