diff --git a/source/blender/draw/engines/eevee_next/eevee_film.cc b/source/blender/draw/engines/eevee_next/eevee_film.cc index 0e06c64e6d4..36725b1c83b 100644 --- a/source/blender/draw/engines/eevee_next/eevee_film.cc +++ b/source/blender/draw/engines/eevee_next/eevee_film.cc @@ -432,8 +432,6 @@ void Film::init(const int2 &extent, const rcti *output_rect) cryptomatte_tx_.clear(float4(0.0f)); } } - - force_disable_reprojection_ = (scene_eevee.flag & SCE_EEVEE_TAA_REPROJECTION) == 0; } void Film::sync() @@ -518,7 +516,7 @@ void Film::end_sync() use_reprojection_ = inst_.sampling.interactive_mode(); /* Just bypass the reprojection and reset the accumulation. */ - if (inst_.is_viewport() && force_disable_reprojection_ && inst_.sampling.is_reset()) { + if (!use_reprojection_ && inst_.sampling.is_reset()) { use_reprojection_ = false; data_.use_history = false; } diff --git a/source/blender/draw/engines/eevee_next/eevee_film.hh b/source/blender/draw/engines/eevee_next/eevee_film.hh index 40f7ace5b6c..8584f3b4e63 100644 --- a/source/blender/draw/engines/eevee_next/eevee_film.hh +++ b/source/blender/draw/engines/eevee_next/eevee_film.hh @@ -69,8 +69,6 @@ class Film { SwapChain combined_tx_; /** Weight buffers. Double buffered to allow updating it during accumulation. */ SwapChain weight_tx_; - /** User setting to disable reprojection. Useful for debugging or have a more precise render. */ - bool force_disable_reprojection_ = false; PassSimple accumulate_ps_ = {"Film.Accumulate"}; PassSimple cryptomatte_post_ps_ = {"Film.Cryptomatte.Post"}; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tracing_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tracing_lib.glsl index f23085718cc..1de716a7b56 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tracing_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tracing_lib.glsl @@ -376,7 +376,7 @@ float shadow_texel_radius_at_position(LightData light, const bool is_directional uniform_buf.shadow.film_pixel_radius); /* This gives the size of pixels at Z = 1. */ scale = 1.0 / scale; - scale = min(scale, float(1 << (SHADOW_TILEMAP_LOD - 1))); + scale = min(scale, float(1 << SHADOW_TILEMAP_LOD)); /* Now scale by distance to the light. */ scale *= reduce_max(abs(lP)); } @@ -396,13 +396,8 @@ float shadow_texel_radius_at_position(LightData light, const bool is_directional float shadow_normal_offset(vec3 Ng, vec3 L) { /* Attenuate depending on light angle. */ - /* TODO: Should we take the light shape into consideration? */ float cos_theta = abs(dot(Ng, L)); - float sin_theta = sqrt(saturate(1.0 - square(cos_theta))); - /* Note that we still bias by one pixel anyway to fight quantization artifacts. - * This helps with self intersection of slopped surfaces and gives softer soft shadow (?! why). - * FIXME: This is likely to hide some issue, and we need a user facing bias parameter anyway. */ - return sin_theta + 3.0; + return sin_from_cos(cos_theta); } /**