I made a Sprite lit shader graph that draws an outline around a sprite, but for some reason it creates these extruded edges around the sprite. How do I solve that? The default shader Sprite-Lit-Default doesn’t seem to have the same issue.
This is the Sprite-Lit-Default shader
My custom shader
Any help would be greatly appreciated. Thanks in advance
Hi, thanks for the reply. I also thought it might be that. I am passing the alpha from the _MainTex though. There are a few ways to achieve the outline. All of the methods I tried have that same jagged mesh effect. Here is a screenshot of the URP
The alpha is a separate node on the Fragment output, which from the pic is locked at value of 1 for all pixels. Use a split node and connect the alpha directly.
It looks like you’re interpreting the semi-alpha pixels to get an outline, which may not be possible unless you were to carefully tune the alpha of those pixels so that they’re not too transparent along the edge of the rgb.
@Lo-renzo Oh yes of course. Thank you. That fixed it!
The tutorials I was following were using an older version of shader graph, which didn’t have the alpha node exposed on the Fragment section. It is fixed by connecting the alpha of the sample with the alpha of the fragment. Thanks again