unity-game-engineshaderspriteshader-graph

shader graph messes up the texture (Unity 2D)


i am trying to make a glow shader but. when i add that _MainTex property this happens:- shaded

shaded wireframe

I tried changing the mesh type to full rect but when i do that this happenfull rect mesh types :-

I don't know whats the problem plzz help , i am new to shader graph and i am using "sprite shader graph unlit" i also tried with but same problem . here's my shader graph :-shader Graph


Solution

  • The Sample Texture 2D node returns a vec4, but your Fragment output only accepts a vec3 and thus ignores the alpha information.

    If you want the shader to also use the alpha values of your texture, you should plug the A output of the Sample Texture 2D node into the Alpha input of the Fragment.

    You are currently returning the color values of the texture for all pixels and not filtering by alpha.

    If this does not work, check if you have to enable translucency for the shader.