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>2017-06-14 11:35:28 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-06-15 01:53:41 +0300
commit4a83f3e2a573fbaeee18898e3acb35e59c3965d5 (patch)
treecd8ed1fd023d249237b5f8a1188a2d66dfd2e155 /source/blender/draw/engines/eevee/eevee_lightprobes.c
parentfbd05d3b6afd207c4de763cfe4341a4da48e55e4 (diff)
Eevee: Disable specular when rendering probes.
This prevents weird reflections and really strong indirect lighting.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lightprobes.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightprobes.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index 53cd49abf78..7776a9f938f 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -153,6 +153,7 @@ void EEVEE_lightprobes_init(EEVEE_SceneLayerData *sldata)
if (!sldata->probes) {
sldata->probes = MEM_callocN(sizeof(EEVEE_LightProbesInfo), "EEVEE_LightProbesInfo");
+ sldata->probes->specular_toggle = true;
sldata->probe_ubo = DRW_uniformbuffer_create(sizeof(EEVEE_LightProbe) * MAX_PROBE, NULL);
sldata->grid_ubo = DRW_uniformbuffer_create(sizeof(EEVEE_LightGrid) * MAX_GRID, NULL);
}
@@ -589,6 +590,9 @@ static void render_scene_to_probe(
/* Move to capture position */
negate_v3_v3(posmat[3], pos);
+ /* Disable specular lighting when rendering probes to avoid feedback loops (looks bad). */
+ sldata->probes->specular_toggle = false;
+
/* 1 - Render to each cubeface individually.
* We do this instead of using geometry shader because a) it's faster,
* b) it's easier than fixing the nodetree shaders (for view dependant effects). */
@@ -644,6 +648,9 @@ static void render_scene_to_probe(
DRW_viewport_matrix_override_unset(DRW_MAT_VIEW);
DRW_viewport_matrix_override_unset(DRW_MAT_VIEWINV);
DRW_viewport_matrix_override_unset(DRW_MAT_WIN);
+
+ /* Restore */
+ sldata->probes->specular_toggle = true;
}
static void render_world_to_probe(EEVEE_SceneLayerData *sldata, EEVEE_PassList *psl)