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

Apply polygon offset for shadows with WebGL1 #4538

Merged
merged 2 commits into from Aug 15, 2022

Conversation

GSterbrant
Copy link
Contributor

@GSterbrant GSterbrant commented Aug 15, 2022

Description

Fixes #2780

Polygon offset is enabled in GL2 when rendering shadows. However, because GL1 doesn't support polygon offset, it has to be done programatically. We supported that, but only applied polygon offset for PCF3 shadows, so to make it consistent with both GL1 and GL2, this PR applies polygon offset by default if GL1 is enabled and the device supports derivatives.

Test scene: https://playcanvas.com/editor/scene/1501582

…results identical to those of GL2 when polygon offset is applied.
@GSterbrant GSterbrant changed the title Apply polygon offset when rendering shadows for GL1. This results in … Apply polygon offset for shadows with WebGL1 Aug 15, 2022
@GSterbrant GSterbrant merged commit 5dd1cf4 into main Aug 15, 2022
@GSterbrant GSterbrant deleted the gsterbrant_fix_polygon_offset_gl1 branch August 15, 2022 13:13
@GSterbrant GSterbrant self-assigned this Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Shadow Bias give more consistent results
3 participants