From 31ad86884cb1b9257f8958cd50942e76aefbd705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 14 Feb 2020 12:17:06 +0100 Subject: EEVEE: Shadow: Fix cascade shadowmap bias multiplicator This fixes the issue where sun shadowmaps needs a very big bias value to make any difference. The bias is now in world space and not dependant on shadow bounds. Unfortunatelly this breaks compatibility with previous version and old scene are likely to need user intervention to fix. Also fixes the property range. Fix T71661 EEVEE shadow from sun on incorrect face --- source/blender/blenloader/intern/versioning_280.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/blenloader/intern') diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index dd67a4d72cb..b14ffa9d0b0 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -4461,5 +4461,14 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + + /* EEVEE: Cascade shadow bias fix */ + LISTBASE_FOREACH (Light *, light, &bmain->lights) { + if (light->type == LA_SUN) { + /* Should be 0.0004 but for practical reason we make it bigger. + * Correct factor is scene dependent. */ + light->bias *= 0.002f; + } + } } } -- cgit v1.2.3