From 34ca3cb2262b1f3fc0b03f04397ae2c1ff2ee7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 3 Oct 2025 16:28:59 +0200 Subject: [PATCH] Fix: EEVEE: Irradiance validity loading The loading step of the irradiance validity was left unfinished for some reason. It was loading the same validity for all 8 corners and copying the same value for all 4 Z slices. There is another bug, which is that the default backface validity of surfels is wrong. This means that the tests are passing because of this bug as the validity is always 1 everywhere. Pull Request: https://projects.blender.org/blender/blender/pulls/147200 --- .../eevee/shaders/eevee_lightprobe_volume_load_comp.glsl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/draw/engines/eevee/shaders/eevee_lightprobe_volume_load_comp.glsl b/source/blender/draw/engines/eevee/shaders/eevee_lightprobe_volume_load_comp.glsl index 07f3166aa9f..59926aa047f 100644 --- a/source/blender/draw/engines/eevee/shaders/eevee_lightprobe_volume_load_comp.glsl +++ b/source/blender/draw/engines/eevee/shaders/eevee_lightprobe_volume_load_comp.glsl @@ -152,9 +152,11 @@ void main() /* Encode validity of each samples in the grid cell. */ for (int cell = 0; cell < 4; cell++) { for (int i = 0; i < 8; i++) { - int3 coord_input = clamp(texel_coord, int3(0), grid_size - 1); + int3 sample_position = lightprobe_volume_grid_cell_corner(i); + int3 coord_texel = texel_coord + int3(0, 0, cell) + sample_position; + int3 coord_input = clamp(coord_texel, int3(0), grid_size - 1); float validity = texelFetch(validity_tx, coord_input, 0).r; - bool is_padding_voxel = !all(equal(texel_coord, input_coord)); + bool is_padding_voxel = !all(equal(coord_texel, coord_input)); if ((validity > validity_threshold) || is_padding_voxel) { cell_validity_bits[cell] |= (1 << i); }