EEVEE-Next: More conservative shadow LOD selection

Ensure shadow-maps at non-zero LODs cover <1 screen texel.
This still doesn't solve projective aliasing, though.
This commit is contained in:
Miguel Pozo
2024-03-05 19:06:51 +01:00
parent fe93664cef
commit c0f23e79e3

View File

@@ -132,7 +132,7 @@ void shadow_tag_usage_tilemap_punctual(
lP = shadow_punctual_local_position_to_face_local(face_id, lP);
ShadowCoordinates coord = shadow_punctual_coordinates(light, lP, face_id);
int lod = int(ceil(-log2(footprint_ratio) + tilemaps_buf[coord.tilemap_index].lod_bias));
int lod = int(floor(-log2(footprint_ratio) + tilemaps_buf[coord.tilemap_index].lod_bias));
lod += lod_bias;
lod = clamp(lod, 0, SHADOW_TILEMAP_LOD);