Texture flickering in Android

Hi! I am currently facing a problem that model texture flickers only on android browser. It works fine on PC and IOS.
All the materials are using URP Lit shader. I have tried changing the clipping planes of the camera in case if this is something related to z-fighting but unfortunately it did not work
So far I found out that if I remove the normal map, the flicker disappear. This workaround works fine in this case but it will be a problem if I need using normal map in the future, so I would like to identify the reason.

Any ideas would be appreciated!


Original Post on Discord

by user 66936191118737408

Hi, this looks very odd, I haven’t seen this before.

Can you share your scene scale and clipping plane settings? near far
And did you modify the directional light shadow settings by any chance?
image.png

Sure. Here are my settings. Am I not supposed to change the values in Light Shadow Data?
Also I am not sure what “scene scale” means so I took a screenshot showing the size of the camera, the light and the models, is this what you want?


image.png

by user 66936191118737408

Yes you are, my guess would just be that a huge size might lead to the issue that you’re seeing. 500x500 seems pretty large (especially for the 2k texture).
Can you try with a smaller shadow size (50x50 for testing) and setting the near plane of your camera to something like 1 or 10?

Tried 50x50 with both near plane 1 and 10 but unfortunately the flickering still exists.

by user 66936191118737408

It does really look like zfighting as you said. Are you sure you don’t have overlapping geometry in the scene?

The issue only appearing on mobile could mean it has to do with a lower shader precicion being used on weaker devices. But that’s just a wild guess.

Yes, I am sure.
I have done a little experiment and found that only surfaces in certain direction seems to have this problem. In the video, I used a red/blue sphere to identify the problematic surfaces. Then keeps rotating the building.
The first video shows that the surfaces keeps flickering while the other video shows the surfaces remains totally black.
The only change I did was rotating the building in 90 degree at start.
Also, I have tried in several android devices with opera/chrome/firefox, all of them have shown this problem.
So I am guessing if this is an Android problem instead of Chromium since the build on IOS works perfectly either in Chrome or Safari.


by user 66936191118737408

Interesting. Thanks for the update. Do you think you could send us parts of that scene that show the problem? Maybe one or two buildings with your current setup?

You can use the Needle Engine Bugreporter (via Needle Engine/Report a bug), it’ll only send what is currently being used in the scene (so you could copy your current scene and strip out most of the content but only keep a few models for the bugreport)

Done. Please check. I guess this should be the report ID? => 230627-124017

by user 66936191118737408

Thanks, got it

@ByeByeParuai I’ve opened the scene on chrome desktop + android with and without rotation but don’t see any shadow flickering. Can you tell me how to reproduce the issue with the scene you sent?

Nothing special. Just hit the play button.
Then it starts flickering when I move the scene camera on android.

by user 66936191118737408

mmmh that’s what I did

BTW I have done a little research and guessing if it is the same issue in this post

by user 66936191118737408

What android device are you using??

I’ll try again

FYI my tested androids are all using Adreno GPUs

by user 66936191118737408

Ok very interesting. I’ll try again and if I can’t repro I think I can send you some code that you can add on your side to test if the suggested answer fixes the issue (or did you try that already?)