Search Unity

Question Get darkest color of a given texture

Discussion in 'Shader Graph' started by Allbee, May 27, 2020.

  1. Allbee

    Allbee

    Joined:
    Feb 10, 2020
    Posts:
    4
    Anyone have any idea how to get the darkest/lightest point in 2d Texture? In shader graph.

    I'm trying to use this for a Remap node. All I want to achieve is that my darkest color remaps to black, and my lightest color remaps to white.

    While I can manually input the "min max" in the remap, I need it to be sourced from the texture, since I'll be using hundreds of different textures, each with different darkest/lightest points.

    An alternative way of asking this is: how do I extract a grey scale gradient from a gray scale texture?