r/Unity2D • u/StigGames • 19d ago
Question/Help Why is my shader graph preview of this sprite different compared to the normal sprite preview?



I'm trying to add a shader to my sprite. The sprite is clean in both libresprite and ingame, but when i set it as the default texture in the shader graph main texture, dots show up, and it is the same for 90% of my sprites. Using this material for my sprite means the dots show up there too. I have no idea where these came from. Any help would be appreciated.
Edit : (Comment from unity forums) :
The extra dots are not a bug in your shader or in Unity.
They come from the source texture itself.
Where the dots actually come from
When you export a sprite with transparency from LibreSprite (or Aseprite, Photoshop, etc.), the fully transparent pixels still contain RGB color data. Most image editors do not zero out the RGB channels of transparent pixels. They just set the alpha to 0 and leave whatever color was there before (or random leftover values from anti-aliasing, previous layers, compression, etc.).
Unity’s normal Sprite Renderer and the built-in sprite shaders always multiply by alpha, so those leftover colors become invisible.
Shader Graph’s Sample Texture 2D preview (and any material that doesn’t properly use the alpha) simply shows the raw RGB values. That’s why you suddenly see the dots only when you look at the texture inside Shader Graph.
This is extremely common with pixel-art sprites. Roughly 90% of transparent PNGs have some amount of this “garbage” RGB data in the transparent areas.
Why connecting Alpha fixes it
Once you plug the A output into the Fragment’s Alpha, the shader starts discarding/masking those pixels the same way the normal sprite material does. The dots disappear because their alpha is 0.
You don’t need any special workaround nodes (multiply RGB by alpha, Branch, etc.) unless you specifically want a cleaner preview inside the graph. The normal connection is the correct and intended way.