deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

[Bug] Shadows degrade with increase in camera pitch

Open SudevKiyadaTR opened this issue 9 months ago • 10 comments

Description

Hi, I have noticed that the quality of shadows tend to get worse with the increase in camera pitch. It looks like the size of shadow map is getting altered with camera pitch. At higher pitch, it just completely turns black. Also, not sure but looks like the shadows are getting obstructed by camera plane?

Image

Image

Image

Flavors

  • [ ] Script tag
  • [ ] React
  • [ ] Python/Jupyter notebook
  • [ ] MapboxOverlay
  • [ ] GoogleMapsOverlay
  • [ ] CARTO
  • [ ] ArcGIS

Expected Behavior

I would expect the shadows to remain consistent at all angles.

Steps to Reproduce

I have setup a quick demo over here

Environment

Logs

No errors

SudevKiyadaTR avatar Feb 18 '25 17:02 SudevKiyadaTR

I am on a MBP M3 Pro, and do not see the issue. Can you test in other browsers? Also what does https://webglreport.com/?v=2 report?

felixpalmer avatar Feb 20 '25 08:02 felixpalmer

I am on 2021 M1 Pro and just had a look on Chrome, Firefox and Safari. The bug's persistent for me on all of em.

Doesn't show up any errors on webGL report Image

SudevKiyadaTR avatar Feb 20 '25 08:02 SudevKiyadaTR

I just tried with a 2021 M1 Pro, which gives the same webglreport output and again I don't see the bug. Best thing you could do is pinpoint exactly the version of deck in which this occurs for you, I can't really help if I cannot reproduce it

felixpalmer avatar Feb 20 '25 12:02 felixpalmer

I am using

"@deck.gl/core": "^9.1.2", "@deck.gl/geo-layers": "^9.1.2", "@deck.gl/layers": "^9.1.2", "maplibre-gl": "^5.1.0"

Just checking in case you saw this - https://stackblitz.com/edit/vitejs-vite-xey397or?file=src%2Flib%2FMap.svelte

SudevKiyadaTR avatar Feb 20 '25 12:02 SudevKiyadaTR

I've noticed this too. Macbook Pro M1 Chrome.

When I have extreme pitch down it seems particularly prominent.

https://drive.google.com/file/d/1oETO_B8oc3oXNCcOoQxjqq3nBTucwqyD/view?usp=sharing

grahambates-code avatar Feb 20 '25 21:02 grahambates-code

I meant, check old versions of deck and find the first version where this bug occurs

felixpalmer avatar Feb 21 '25 08:02 felixpalmer

I gave it a try and it shows up even on 8.0.0. Anything before that throws 'module is not defined'.

Makes me think if the shadow issue was like this ever since the first build? I tried cloning the repo and running the geojson example locally and increasing maxPitch to 90 also yields the same buggy result.

SudevKiyadaTR avatar Feb 21 '25 10:02 SudevKiyadaTR

Yeah agreed, I think its always been a issue for shadows with certain pitches.

grahambates-naturealpha avatar Feb 21 '25 10:02 grahambates-naturealpha

Stumbling upon the same issue with pitches from ~72 degrees.

yaras-phoenix avatar Jun 06 '25 16:06 yaras-phoenix

Can confirm the issue. My shadows start degrading at around 70 degrees. It's still an experimental feature. Personally I think shadows add a lot of aesthetic value to the visualization.

sychiu avatar Nov 13 '25 14:11 sychiu