Page 1 of 1

How can I create a lit sprite shader?

PostPosted: Tue Dec 04, 2018 1:46 pm
by virtush
I've created a sprite shader with a wind effect for 2D foliage, and I need it to react to lighting.

Obviously there are lit sprite shaders out there in the wild, but from what I gather, I need surface shading to enable lighting and I have no idea how I can do that through amplify while retaining the sprite functionality. :?

Re: How can I create a lit sprite shader?

PostPosted: Mon Dec 10, 2018 12:13 pm
by Amplify_Borba
Hello! If you want your sprite template shader to react to lighting, you'll need to manually set up those calculations in the shader, and we do provide some Light specific nodes for such endeavours.

As an alternative, you could also consider using a Surface shader since it already has the lighting calculations set up for you, in this case you'd have to create a Texture Sample node called MainTex, or at least make sure that its Property Name is called _MainTex, so that it can be used with Unity's Sprites.