From ad632a13d98e9d29c418a4acd5ec2848d6b71d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sun, 24 Jul 2022 19:06:12 +0200 Subject: EEVEE-Next: Decorelate Large filter spiral sampling This avoids correlation artifacts with the jitter pattern itself. Also try to reduce the visible spiral pattern. --- source/blender/draw/engines/eevee_next/eevee_film.cc | 2 +- source/blender/draw/engines/eevee_next/eevee_sampling.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/draw/engines/eevee_next/eevee_film.cc b/source/blender/draw/engines/eevee_next/eevee_film.cc index cdd753b988d..18e0452da25 100644 --- a/source/blender/draw/engines/eevee_next/eevee_film.cc +++ b/source/blender/draw/engines/eevee_next/eevee_film.cc @@ -522,7 +522,7 @@ void Film::update_sample_table() int i = 0; for (FilmSample &sample : sample_table) { /* TODO(fclem): Own RNG. */ - float2 random_2d = inst_.sampling.rng_2d_get(SAMPLING_FILTER_U); + float2 random_2d = inst_.sampling.rng_2d_get(SAMPLING_SSS_U); /* This randomization makes sure we converge to the right result but also makes nearest * neighbor filtering not converging rapidly. */ random_2d.x = (random_2d.x + i) / float(FILM_PRECOMP_SAMPLE_MAX); diff --git a/source/blender/draw/engines/eevee_next/eevee_sampling.cc b/source/blender/draw/engines/eevee_next/eevee_sampling.cc index aa62c3dd38a..1d320c75f16 100644 --- a/source/blender/draw/engines/eevee_next/eevee_sampling.cc +++ b/source/blender/draw/engines/eevee_next/eevee_sampling.cc @@ -177,7 +177,7 @@ float2 Sampling::sample_disk(const float2 &rand) float2 Sampling::sample_spiral(const float2 &rand) { /* Fibonacci spiral. */ - float omega = M_PI * (1.0f + sqrtf(5.0f)) * rand.x; + float omega = 4.0f * M_PI * (1.0f + sqrtf(5.0f)) * rand.x; float r = sqrtf(rand.x); /* Random rotation. */ omega += rand.y * 2.0f * M_PI; -- cgit v1.2.3