Search Unity

Shader Graph with 2D Sprites

Discussion in '2D' started by cgraf1, Nov 21, 2019.

  1. cgraf1

    cgraf1

    Joined:
    Jan 11, 2015
    Posts:
    35
    Hey everyone,

    I am just learning Shader Graph and I was wondering how I can use it to make shaders for 2D sprites.

    I followed this Unity page, which gives the basic setup, but it simply ends with "You can now assign new materials to the newly built Shader." When I try to Multiply in other effect nodes on the Color, Mask, or Normal, the sprite disappears.

    So where do I add new nodes for effects? I have also seen tutorials online where people use a PBR graph, but then they have to specify the sprite or sprite sheet in the graph. I want to make a shader I can add to any 2D sprite and it will take effect.

    If anyone could help me out with this, I would greatly appreciate it.

    Screen Shot 2019-11-21 at 12.18.55 PM.png
     
    OG_oliver likes this.
  2. OG_oliver

    OG_oliver

    Joined:
    Aug 11, 2019
    Posts:
    15
    If I'm not wrong you just need to specify the colour and the rest is done by the Master node itself. You should be able to find tutorials on youtube but you have to add the effects between the "Simple Texture 2D" node and the "Sprite Lit Master" Color input (or at least for the most part of the effects since some can require to modify the mask or the normals). I'm new to the Shader Grah too but I know there are some good tutorials on youtube. A tutorial that taught me the basics in just 15 minutes is this video from the channel Breackeys :


    Like everything, you may need to try things by yourself since there are not lots of tutorials for this for now. I'm interested in learning how to make effects for sprites in the Shader Graph so, please share any good tutorial for this if you find something interesting.

    I'm also trying to make a shader to mix sprites with 3D objects and now I'm trying to do it with the Shader Graph so if you can give any help I would really appreciate that you check it's progress or just if you want to see how it is made: https://forum.unity.com/threads/sri...-in-the-universal-render-pipeline-urp.803517/
     
    cgraf1 likes this.
  3. cgraf1

    cgraf1

    Joined:
    Jan 11, 2015
    Posts:
    35
    Thanks a lot. This Brackey's tutorial has come out since I originally asked the question. Appreciate you posting it here. I will most likely watch it soon and play around a bit more. Thanks again and best of luck to you on your projects as well
     
  4. FredMoreau

    FredMoreau

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    168