Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Help writing a shader that converts one color to another

Discussion in 'Shaders' started by unity_2nq5pY_3AHF6WQ, May 14, 2024.

  1. unity_2nq5pY_3AHF6WQ

    unity_2nq5pY_3AHF6WQ

    Joined:
    Aug 10, 2022
    Posts:
    1
    I'm trying to write a shader that sort of acts as a lens that changes the color of whatever is behind it. So it would be transparent, but any pixels in a green range would be rendered as yellow, for example. I haven't had any luck getting this to work. Any help would be greatly appreciated!
     
  2. donutdude246

    donutdude246

    Joined:
    Oct 18, 2017
    Posts:
    8
    You can use shader graph to create a screen space (post processing) shader that does this. Or you can create a shader in shader graph that samples the scene color (opaque texture) and do it that way!