diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-11-23 23:24:00 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-12-04 00:41:37 +0300 |
commit | 1b00ca35758dacf7ece7b95275ea3c41e53bec6c (patch) | |
tree | b587d29f39a3cffd5c88ab86ceea674a1aaeb1b4 /source/blender/draw/engines/eevee/shaders/eevee_light_eval_lib.glsl | |
parent | 68b0195bf3e27ee687eb87e37257891a3a7f4e78 (diff) |
EEVEE: Light: Port light culling to GPU
This removes the light count limit for the forward shaded object. This
also provides a more efficient way of computing the culling directly on
the GPU. Moreover, this avoids doing multiple lighting passes for high
light counts in the deferred pipeline, improving performance.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/eevee_light_eval_lib.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/eevee_light_eval_lib.glsl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/eevee_light_eval_lib.glsl b/source/blender/draw/engines/eevee/shaders/eevee_light_eval_lib.glsl index 448e5b54886..d3d5f859174 100644 --- a/source/blender/draw/engines/eevee/shaders/eevee_light_eval_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/eevee_light_eval_lib.glsl @@ -4,9 +4,10 @@ * A prototype needs to be declared before main in order to use it. * * The resources expected to be defined are: - * - light_culling - * - lights_culling_tx * - lights + * - lights_zbins + * - light_culling + * - lights_culling_words * - shadows * - shadow_atlas_tx * - shadow_tilemaps_tx @@ -33,7 +34,7 @@ void light_eval(ClosureDiffuse diffuse, vec4 ltc_mat = utility_tx_sample(uv, UTIL_LTC_MAT_LAYER); float ltc_mag = utility_tx_sample(uv, UTIL_LTC_MAG_LAYER).x; - ITEM_FOREACH_BEGIN (light_culling, lights_culling_tx, vP_z, l_idx) { + ITEM_FOREACH_BEGIN (light_culling, lights_zbins, lights_culling_words, vP_z, l_idx) { LightData light = lights[l_idx]; vec3 L; float dist; |