Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse-Z #26

Open
BearishSun opened this issue Mar 16, 2018 · 0 comments
Open

Reverse-Z #26

BearishSun opened this issue Mar 16, 2018 · 0 comments
Labels
OFFICIAL type: enhancement [MAJOR] Feature that takes a few weeks up to few months to implement
Milestone

Comments

@BearishSun
Copy link
Member

Currently the depth buffer is stored in range [0, 1], where 0 is nearest and 1 is furthest. Depth buffer loses precision the father away an object is, which can cause artifacts when depth is compared (e.g. shadow acne). If depth buffer uses a floating point type this problem is compounded as floating point format itself loses precision with larger numbers. However by reversing the depth buffer range to [1, 0], where 1 is nearest, and by using a floating point buffer, we can make these precision errors basically cancel out. This would involve adjusting projection matrix, as well as any shader that reads the depth and adjusting its usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OFFICIAL type: enhancement [MAJOR] Feature that takes a few weeks up to few months to implement
Projects
None yet
Development

No branches or pull requests

1 participant