How to fix URP's Shader Graph Shader displaying PNG texture with artifacts where alpha is zero?

What happens is I have a texture of a building I made with transparency around it however when I’m using this .png in the shader graph there are some artifacts visible in the texture itself. The original image has a clear outline however as you can see in the screenshot there are some random deep blue things around the entire building. This is messing everything I want to do up completely. I’m fairly new to making shaders so sorry if this has an easy fix. I couldn’t find anything and am about to go crazy.


Ok. Solved it. There are two approaches you can take here!

One is you can accept fate and move on. If you feed the original Alpha of your Main Texture’s Sample Texture 2D node to the Fragment Alpha then the artifacts are gone. (A user on twitter told me about this. Thanks again!) I did need to do some fancy stuff beforehand that so keep reading for a better solution.

My other solution is a bit convoluted but it works. Here we go:


Using this method you can clear the alpha completely and do other things to your texture!