Search Unity

Question Applying texture based on color

Discussion in 'Shader Graph' started by PvTGreg, Apr 30, 2021.

  1. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    Hi,

    So i have been fiddling around with urp and am trying to create a map generator(tell me if i should not be doing this with shadergraph) i currently have it generating noise and a falloff to create islands.
    i am looking to apply texture based on the level of color black to white.
    so where its most black it will apply water and slowly go from that to sand then grass then rock.
    how would i sample the color generated and apply texture based on that? im not really sure where to start i messed around with color replace but couldnt get it to work right. this is what i have so far
    urp.PNG
     
  2. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    Forgot to add but ive already tried this but its missing lots of the daker bits inside
    Capture1.PNG
     
  3. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    I have now managed to get a texture to change based on a float value 0-1.
    next step would be to check the color color and replace texture based on that.
    bit lost now though
     

    Attached Files:

    • www.PNG
      www.PNG
      File size:
      163.7 KB
      Views:
      272