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>2018-11-08 21:17:41 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-08 21:20:40 +0300
commit4f114419137e76acde2d60d256d470c5a7a4232b (patch)
tree2ebba925659d9e4ece39cdcc5ff68f5908751e91 /source/blender/draw/engines/eevee/eevee_lights.c
parent9d12a5aa9e20c33c49bd86e956d0b3d5fbf6fd46 (diff)
Eevee: Add partial support for the Light Path Node
This makes it possible to tweak indirect lighting in the shader. Only a subset of the outputs is supported and the ray depth has not exactly the same meaning: Is Camera : Supported. Is Shadow : Supported. Is Diffuse : Supported. Is Glossy : Supported. Is Singular : Not supported. Same as Is Glossy. Is Reflection : Not supported. Same as Is Glossy. Is Transmission : Not supported. Same as Is Glossy. Ray Length : Not supported. Defaults to 1.0. Ray Depth : Indicate the current bounce when baking the light cache. Diffuse Depth : Same as Ray Depth but only when baking diffuse light. Glossy Depth : Same as Ray Depth but only when baking specular light. Transparent Depth : Not supported. Defaults to 0. Transmission Depth : Not supported. Same as Glossy Depth. Caveat: Is Glossy does not work with Screen Space Reflections but does work with reflection planes (when used with SSR or not). We have to render the world twice for that to work.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lights.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_lights.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c
index 5c82eadcbd1..d5badab1254 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -1182,6 +1182,11 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
int i;
DRWMatrixState saved_mats;
+ int saved_ray_type = sldata->common_data.ray_type;
+
+ /* TODO: make it optionnal if we don't draw shadows. */
+ sldata->common_data.ray_type = EEVEE_RAY_SHADOW;
+ DRW_uniformbuffer_update(sldata->common_ubo, &sldata->common_data);
/* Precompute all shadow/view test before rendering and trashing the culling cache. */
bool cube_visible[MAX_SHADOW_CUBE];
@@ -1420,6 +1425,9 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
DRW_uniformbuffer_update(sldata->light_ubo, &linfo->light_data);
DRW_uniformbuffer_update(sldata->shadow_ubo, &linfo->shadow_data); /* Update all data at once */
+
+ sldata->common_data.ray_type = saved_ray_type;
+ DRW_uniformbuffer_update(sldata->common_ubo, &sldata->common_data);
}
void EEVEE_lights_free(void)