diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-02-14 14:17:06 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-02-14 14:26:49 +0300 |
commit | 31ad86884cb1b9257f8958cd50942e76aefbd705 (patch) | |
tree | cf724719a49dcd4fc24a6f653ae766428097901c /source/blender/blenloader/intern | |
parent | 38ced52d34328adf97ec30880ab49fbf53c13d46 (diff) |
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
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 9 |
1 files changed, 9 insertions, 0 deletions
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; + } + } } } |