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

GLES2, Cast Shadow=Off breaks receiving shadow, HTML5 #28444

Closed
wombatstampede opened this issue Apr 26, 2019 · 7 comments · Fixed by #33093
Closed

GLES2, Cast Shadow=Off breaks receiving shadow, HTML5 #28444

wombatstampede opened this issue Apr 26, 2019 · 7 comments · Fixed by #33093

Comments

@wombatstampede
Copy link
Contributor

Godot version:
3.1 and 3.1.1RC1, GLES2

OS/device including version:
HTML5 export, (on some Android devices as well)
(Tested with Firefox)

Issue description:
If a MeshInstance is set "Cast Shadow=Off" (Geometry Instance) it only reives completely messed up Shadows.

(Green floor is split in half, left one has Cast Shadow = On, right one has CastShadow = Off)
Imgur
(The odd moving of the yellow bar is due to some strange effect in the 6dof y-motor, not topic of this issue.)

Steps to reproduce:
Set up a directional light. Put a Meshinstance with Cast Shadow=Off and another MeshInstance (naturally with CastShadow = on) to cast shadow on the first one. Export to HTML5.

Minimal reproduction project:
shadow_error.zip

@Toshiwoz
Copy link
Contributor

Toshiwoz commented May 16, 2019

Got a similar issue, GLES3 GLES 2.0, Windows 10 + Android, too (Godot 3.1.1)

To be noted, the effect looks bad in Orthogonal mode, not PSSM4 neither PSSM2 (they have a nicer fade effect).
image
as seen from atop
image
same scene, lower angle.

Another example project to work with.
ShadowOccluded.zip

@Toshiwoz
Copy link
Contributor

If you enable cast shadows on the large mesh you'll see why I want it disabled, apart from the fact that without performs much faster.
If anyone can suggest a workaround in the meantime it's very welcome.

@Toshiwoz
Copy link
Contributor

Toshiwoz commented Jun 5, 2019

issue_with_shadows_cast_off
Here another example that may help better understand the issue.
Looks like if there's no object casting shadow behind the last one then the shadow is cut off by some invisible bounding box.

@clayjohn
Copy link
Member

clayjohn commented Jun 5, 2019

@Toshiwoz The issue you are posting about is unrelated to the original post. In your test scene turning ShadowDepthRange to stable instead of optimized fixes your issue.

The above issue is related to turning "Cast Shadows" on and off in a GeometryInstance.

@Toshiwoz
Copy link
Contributor

Toshiwoz commented Jun 6, 2019

image
@clayjohn , then, how do you explain the fact that when I turn on cast shadow it works? (shadow is pixelated because I'm using very large mesh)

If you still think it's not related I can open another issue, just let me know.

@clayjohn
Copy link
Member

clayjohn commented Jun 6, 2019

Ah, I didn't see you mention it before. It must be related then.

Confirmed on Ubuntu 16.04 intel integrated graphics. In both GLES2 and GLES3 using @Toshiwoz's MRP.

@jesperkondrup
Copy link

We might have a smiliar issue: Using GLES2, tested in 3.1.1 stable and 3.2 alpha 3. This issue is present on both Linux and Windows in Chrome, Safari and Edge.

LightingIssue

Project files:
LightingShadowIssue.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants