-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lichdom: Accurate fix for CryEngine directional shadows!!!
Achievement unlocked: World first fix for CryEngine shadows ;-) These were tricky to solve, but at the end of the day the pattern is actually not that hard. The far clipping plane and screen resolution needs to be copied from the vertex shader, as the variable in the PS that suggests it might have the far clipping plane is not the right one - seems to be for the shadow map? The SV_Position v0 is adjusted in the pixel shader based on the information from the depth buffer. This is scaled back to world Z by multiplying by the far clipping plane, then the stereo correction formula (with perspective divide) is applied and finally multiplied by the screen resolution.
- Loading branch information
1 parent
436a5df
commit 0680548
Showing
2 changed files
with
41 additions
and
16 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