EEVEE-Next: Irradiance Grid smooth transitions #112842

Merged
Miguel Pozo merged 10 commits from pragma37/blender:pull-eevee-next-irradiance-grid-smooth-transitions into main 2023-12-18 16:25:29 +01:00
1 changed files with 5 additions and 3 deletions
Showing only changes of commit 7877645d1b - Show all commits

View File

@ -134,6 +134,9 @@ SphericalHarmonicL1 lightprobe_irradiance_sample(
int i = 0;
#ifdef IRRADIANCE_GRID_UPLOAD
i = grid_start_index;
#endif
#ifdef IRRADIANCE_GRID_SAMPLING
float sampling_random = sampling_rng_1D_get(SAMPLING_LIGHTPROBE);
#endif
for (; i < IRRADIANCE_GRID_MAX; i++) {
/* Last grid is tagged as invalid to stop the iteration. */
pragma37 marked this conversation as resolved Outdated

I don't think a blue noise fetch here is acceptable for performance reason. Use Interlieved Gradient Noise.

I don't think a blue noise fetch here is acceptable for performance reason. Use Interlieved Gradient Noise.
@ -148,9 +151,8 @@ SphericalHarmonicL1 lightprobe_irradiance_sample(
index = i;
#ifdef IRRADIANCE_GRID_SAMPLING
float distance_to_border = reduce_min(min(lP, vec3(grids_infos_buf[i].grid_size) - lP));
float noise = interlieved_gradient_noise(
UTIL_TEXEL, float(i), sampling_rng_1D_get(SAMPLING_VOLUME_U));
if (distance_to_border < fract(noise + sampling_rng_1D_get(SAMPLING_VOLUME_V))) {
float sampling_noise = interlieved_gradient_noise(UTIL_TEXEL, float(i), 0.0);
if (distance_to_border < fract(sampling_noise + sampling_random)) {
/* Try to sample another grid to get smooth transitions at borders. */
continue;
}