Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Custom Sprite Shader that works similar to Standard.

Discussion in 'Shaders' started by Nichotine, Jul 17, 2020.

  1. Nichotine

    Nichotine

    Joined:
    Jul 30, 2017
    Posts:
    18
    I'm having some trouble, here's where I'm at.

    I want a shader where, when attached to sprites, the hue, saturation and lightness/brightness can be shifted dependent on a input vector3/float3. I have the code for doing this basically ready to go.

    My problem is in trying to get a custom shader that does what I need it to do for sprites. Unity's standard shader works perfectly for what I need, if only I could add this HSV code to it. When I've tried to make custom shaders based on what you can find on google, the best I can do is a transparent cutout shader, but it doesn't play nice with other forms of transparency. For instance, if the sprite using the custom shader is submerged in a transparent material, it'll still draw above it.

    How do I accomplish what I'm looking for? Do I need to figure out how to modify the standard shader? because I've tried to do that but it's incredibly complex. Or is there a way of writing this shader where you can still have a transparent cutout removing the alpha, but without bugging out when involving other forms of transparency.

    Help appreciated