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.
Answer by tuncOfGrayLake · Apr 09, 2021 at 08:19 AM
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!
Your answer
Follow this Question
Related Questions
FPS shader fixing 1 Answer
Need help to make a color replace shader 0 Answers
How to access shader graph property values through C# script? 0 Answers
Is it possible to blend 2 different materials via the shader graph? 0 Answers
Is it possible to apply a dissolve shader created with shader graph to a UI button? 0 Answers