-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix shadow stability when eye is far from world origin
in stable mode the scale was ever so slightly varying with the camera position, because it was calculated from the camera frustum in world-space, this variation was amplified when the camera is far from the origin, which eventually caused the modulo needed for snapping the shadowmap projection to widely vary, leading to the instability. We now calculate the camera frustum sphere in view space, which is guaranteed to be constant. If "shadow caster mode" is chosen, we quantize the scale a little bit so it stays constant. The snapping code itself has been cleaned.
- Loading branch information
1 parent
4f11a02
commit 6fd5d45
Showing
5 changed files
with
119 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters