Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How To Make Hard Height Effect?

Discussion in 'Shaders' started by gdosu, Aug 13, 2021.

  1. gdosu

    gdosu

    Joined:
    Aug 24, 2020
    Posts:
    13
    Hey all.

    I wanna make hard height effect while using shader with map.
    Is there any sample or video or article or hint that I can follow? (even googling keyword would be okay.)
    I just assuming it gonna need vertex shader. (I'm still new to shader.)

    [Before]
    before.png

    [After]
    after.png
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    There's not really a good way to achieve that particular effect with shaders. Generally you'd do that with 4 cube meshes that you directly manipulate. Though you could have a grid of cube meshes that sample a texture to set position / height offsets based on a UV calculated from their world space pivot position or a unique UV baked into each cube.
     
  3. gdosu

    gdosu

    Joined:
    Aug 24, 2020
    Posts:
    13
    Thanks for the clear answer!