heremaps / harp.gl

3D web map rendering engine written in TypeScript using three.js
Apache License 2.0
1.29k stars 197 forks source link

Shadows show obvious jitter when shadows are turned on #2238

Closed datouzhan closed 3 years ago

datouzhan commented 3 years ago

Describe the bug Shadows show obvious jitter when shadows are turned on, but there is no such phenomenon in Threejs.The same phenomenon occurred in the extruded buildings added to mapanchor. https://user-images.githubusercontent.com/20176393/126254069-3ba96545-fc41-4b9b-bfbd-dadbfbcb281f.mp4

nzjony commented 3 years ago

@datouzhan , try increasing the resolution of the shadow map.

I changed the example with the shadows to change it at run time, see: https://github.com/heremaps/harp.gl/pull/2239

That should show you how to change it at runtime.

datouzhan commented 3 years ago

I set 4096.This is the perfect solution to my problem.

nzjony commented 3 years ago

thanks @datouzhan

Note, a 4K shadow texture is going to eat up your memory if you are restricted

datouzhan commented 3 years ago

It may also be a good thing to exchange a certain amount of memory for the clarity of the scene.

nzjony commented 3 years ago

@datouzhan yes! Look forward to see your final product!

datouzhan commented 3 years ago

I can show you some of the results so far. image image

nzjony commented 3 years ago

@datouzhan Wow! Very cool! Thanks for sharing.