Search Unity

Showcase Pixel art colour changer shader tutorial

Discussion in 'Shader Graph' started by Kiwasi, Apr 24, 2019.

  1. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I made a thing. Here is the video tutorial if you want to watch it.



    It came out of a late night at a game jam. Our producer decided we needed to have different coloured crabs, and was driving the artist insane with requests to redo the sprites in different colours. To save time (and possibly the life of the producer), we developed this shader. It lets the artist change the palette colours on existing pixel art via the inspector.

    How it works
    - The SpiteRenderer component feeds in the main texture as normal
    - The texture is sampled
    - A series of step and subtraction nodes to break the texture up into its component palette colours.
    - Each step node is multiplied by a colour from the inspector
    - The colours are added back together and sent to the master node
     
    NeatWolf, mvinc006 and Fainth like this.
  2. mvinc006

    mvinc006

    Joined:
    Jan 1, 2018
    Posts:
    91
    Awesome overview, I really liked how you clearly explain everything you are doing so we understand how to tweak it in the future.
     
    Kiwasi likes this.