#Sprite Lit Shadergraph with working preview doesn't show in-game

1 messages · Page 1 of 1 (latest)

waxen niche
#

I'm making a Shadergraph to show a ripple effect around an island. I've made a simple setup where I take the outline of the island, slowly grow it, and fade it out, hooked up to a Fraction over Time to repeat it. It shows perfectly fine in the ShaderGraph preview and the Material preview. However, when I attach it to a sprite in my Scene, nothing happens. I've played around with thickness of the ripple, time, size of the sprite and order in layer, but for some reason it just doesn't show in Scene view or Play Mode.
Does anyone know why this could be happening? See screenshots for the shadergraph, material and sprite settings.

unique heron
waxen niche
jade finch
#

Is sprite field set to the default Square sprite intended? The SpriteRenderer will pass that sprite texture into the _MainTex reference, overriding what is set on the material.

The Replace Color node usage here is quite specific to that island sprite and likely won't work as intended for others. (And a bit of a strange setup. If the sprite has transparency/alpha channel you should just be able to use the A output from the texture sample)

(You also might end up drawing outside the mesh generated by the sprite. Under the texture asset you can change the type to Full Rect or edit the "outline" to adjust that mesh if needed)
.

#

Another potential issue I can see is that a Vector (3) is connected to the Alpha (1) port in the master stack. That will cause it to use the first/red channel. Currently okay but if you were to change the colour to green/blue/etc it would fade/disappear. Multiplying by the color property will also darken the colours at the edge.

Instead I'd recommend connecting the color property directly to the Base Color and keep the other calculations as Float (1) to use in the Alpha port.

waxen niche
waxen niche
waxen niche
jade finch
waxen niche
#

Thanks for the documentation link, interesting!