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

Fix shadow mapping with RGBA textures on html #33093

Merged
merged 1 commit into from Oct 26, 2019

Conversation

@clayjohn
Copy link
Contributor

clayjohn commented Oct 26, 2019

Fixes: #28444

@Toshiwoz This doesn't address the GLES3 issue you were facing in that thread. If you can still reproduce that issue with orthogonal directional lights, please open another issue.

This fix has two pieces.

  1. On WebGL 91% of devices support depth textures with an extension. However, we were only polling for the GL ES 2.0 extension so it was never used on Web export. Accordingly HTML fell back on RGBA shadows. For most devices it was enough to just enable the extension.

  2. RGBA shadows were completely broken in 3D in GLES2. The color buffer was never cleared. Additionally, all lights were using the directional light shadow atlas to store shadow maps, which likely lead to some pretty odd results. We never caught this earlier because all desktop and the overwhelming majority of mobile devices supported and used depth textures.

Code graciously donated by Gamblify. :)

CC: @jesperkondrup

@Toshiwoz

This comment has been minimized.

Copy link
Contributor

Toshiwoz commented Oct 26, 2019

EDIT: Thanks @clayjohn I'll probably do so, although now I'm not using GLES 3.0 and neither orthogonal projection/shadows on my project.

@akien-mga akien-mga merged commit 3556876 into godotengine:master Oct 26, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Oct 26, 2019

Thanks!

@akien-mga akien-mga added this to the 3.2 milestone Oct 26, 2019
@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Nov 8, 2019

Cherry-picked for 3.1.2.

@clayjohn clayjohn deleted the clayjohn:GLES2-HTML-shadows branch Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.