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

shadow of OmniLight and SpotLight not working on Android mobile #54343

Closed
norrath-hero-cn opened this issue Oct 28, 2021 · 6 comments
Closed

Comments

@norrath-hero-cn
Copy link

norrath-hero-cn commented Oct 28, 2021

Godot version

Godot Engine v3.4.rc2.official.23955fc28 and Godot Engine v3.3.4.stable.official

System information

Android 9, Adreno (TM) 616, GLES2 and GLES3

Issue description

Godot Engine v3.4.rc2.official.23955fc28 - https://godotengine.org
OpenGL ES 2.0 Renderer: Adreno (TM) 616
OpenGL ES Batching: ON

Shadow of OmniLight and SpotLight not working on Android mobile
image

Works fine on windows
image

Steps to reproduce

  1. create a empty scene
  2. add csg cube to make a ground
  3. add two meshinstance
  4. add OmniLight and SpotLight, enable shadow
  5. export apk
  6. test run on an android mobile

Minimal reproduction project

shadow.zip

@Calinou
Copy link
Member

Calinou commented Oct 28, 2021

Vertex shading is forced by default on mobile, which is likely why it doesn't work there (your ground plane lacks subdivision).

To resolve this (at a performance cost), disable Force Vertex Shading.mobile in the Project Settings and export to Android again. That said, the better solution to preserve performance is to subdivide your ground place to a reasonable level to allow individual vertices to be lit by the SpotLight.

Or, better, use fully baked lightmaps to get the both of both worlds 🙂

@norrath-hero-cn
Copy link
Author

Vertex shading is forced by default on mobile, which is likely why it doesn't work there (your ground plane lacks subdivision).

To resolve this (at a performance cost), disable Force Vertex Shading.mobile in the Project Settings and export to Android again. That said, the better solution to preserve performance is to subdivide your ground place to a reasonable level to allow individual vertices to be lit by the SpotLight.

Or, better, use fully baked lightmaps to get the both of both worlds 🙂

After disable Force Vertex Shading.mobile, shadow of OmniLight works fine, but when enable SpotLight shadow the SpotLight are complete ignoired, is this a design or a bug? I confirm this by "Deploy with Remote Debug" and manually enable/disable SpotLight shadow multiple times

@Calinou
Copy link
Member

Calinou commented Oct 28, 2021

Duplicate of #25526.

@norrath-hero-cn
Copy link
Author

norrath-hero-cn commented Dec 8, 2022

After flipping around some options in the Project Settings->Rendering->Quality page, I find some interesting things

  1. restore all options to default value
  2. disable "Force Vertex Shading.Mobile"
  3. set "Filter Mode.Modile" to PCF5 or PCF13

Spotlight with shadow work fine on my device, blow picture are captured on same android device
capture

here are some extra tests:

disable "Force Vertex Shading.Mobile", but set "Filter Mode.Modile" to disable
disable_pcf

enable "Force Vertex Shading.Mobile", but set "Filter Mode.Modile" to pcf5
vertex_pcf

enable "Force Vertex Shading.Mobile", but set "Filter Mode.Modile" to disable
vertex_disab

it seems the logical related to "Filter Mode.Mobile" is critical to this issue, some things related to "Filter Mode.Mobile" is broken Spotlight and shadow

@Calinou

shadow.zip
this project works fine on my device, please compare the difference to find what real issue is, wish you can fix this, many thanks!
maybe #25526 is the same issue

this is a long time issue on the wild, after this I feel Godot 3.x is perfect!

@norrath-hero-cn
Copy link
Author

New founds on PC, set renderer to gles2, then set Shadows->"Filter Mode" to disable, spotlight with shadow not working on pc too

I will report as a new issue

@norrath-hero
Copy link

Just confirmed this fixed by #69826

akien-mga pushed a commit that referenced this issue Dec 13, 2022
Fixes #69759
Fixes #54343
Fixes #25526

(cherry picked from commit aca8999)
Relintai pushed a commit to Relintai/pandemonium_engine that referenced this issue Dec 22, 2022
Riordan-DC pushed a commit to Riordan-DC/godot that referenced this issue Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants