- Home /
Shader not working properly on Android
Hi! So I'm starting to use Shadergraph and it's being fantastic so far, or at least only on the editor.
I've made this shader to add an inner glow to a 2D Sprite.
So far is looking good!
However, when I build and run the game on Android, it looks like this:
I can see that the blue glow is working, but those alpha 0 pixels are killing me.
I've been trying to fix this for about 8 hours with no success.
What's going on?
I've tried changing a couple of settings to see if I can fix that, but the only thing that did something was changing the precision of the Shader from Single to Half, but made it worse.
Regarding the URP Asset, is the default 2D one, I haven't made any change to it.
Here is the compiled shader: https://pastebin.com/dZnGtnX8
Thank you in advance.
Answer by pablo_leban · Nov 30, 2021 at 08:16 AM
The problem seems to be a Shader Graph + Unity UI issue as the shader was working fine with a sprite renderer I've fixed it with noahabannister's solution here https://forum.unity.com/threads/shader-graph-ui-image-shader.628111/
I had to get the shader code of the shader graph, and edit the Blend and the ZTest to fix it as stated on that post.