Strange lighting on iOS

hi
we have a project that works fine on android but in ios devices the lighting creates a weird effect on surfaces

it appears on surfaces facing the light only

these are the light settings, just one direct light

*edit forgot to mention this is the compiled version using basis compression and glb meshes

Thanks for reporting this. Are you able to reproduce this problem in a small test project? If you can, I can get one of the graphics engineers on the team to investigate.

ill give it a try

Your issue may be related to this topic.

1 Like

thanks saif, this does look like its the same issue

https://playcanvas.com/editor/scene/1077196

i made a new project with the same lighting setup, not had chance to compile it but hopefully the effect is the same

if you need me to compile it let me know how i can share it with you

Saif´s solution is correct, thank you Saif.

after testing i can confirm that it is the “shadow type” that is the problem.
IOS devices have this problem if the lighting is set to any of the “variance shadow map” type shadows, we had our project to the 32bit version and it looks good in editor and android but ios doesnt like it.

switching it to he shadow map PCF 5x5 and tweeking bias / normal offset fixed the issue.

i did play with the bias settings in the variance type but you have to set it very high for the issue to go away and at that point small object shadows have totally gone.

these are the new settings we are using if anyone else has this problem

3 Likes

@Will_Viewtek @saif - I took a look into this, and the issue arises because iOS uses WebGL1, and unfortunately the shadow implementation in the engine differs between WebGL2 and WebGL1. A workaround that should work, is to launch your app using WebGL1 as shown in this picture:


and then increase your shadow bias so that the artifacts are no longer visible when running in WebGL1. In the example provided I had to increase the bias quite a lot: from 0.05 to 0.3

4 Likes

thankyou