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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How is this / is this a particular shader technique?

Discussion in 'Editor & General Support' started by Ves, May 22, 2014.

  1. Ves

    Ves

    Joined:
    Apr 6, 2011
    Posts:
    23
    Hey there,

    I was wondering if anyone is able to describe to me how this is done: in the screenshot here from the game Cube World, a procedurally generated world of cubes, the creator has this really nice gradient color across the cubes. Is this a shader? How is this accomplished?

    I ask because I'd like to implement it in my own procedural generator (which is not necessarily cube-based) which right now only uses solid color tile sheets. Any direction or indication from those more experiences would be greatly appreciated!
     
    Last edited: May 22, 2014
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yes, it's called vertex colours. You just need to create darkness for anything which has less air. Less air blocks = more darkness.

    If performance isn't a consideration and you have pro, dump SSAO on it.
     
  3. Ves

    Ves

    Joined:
    Apr 6, 2011
    Posts:
    23
    Hippocoder: thanks for the reply!

    Just to clarify, it's not the lighting I'm interested in, it's the color gradation effect. It might be more clear with this screenshot. Mainly, there seems to be an "oscillation" of color from the lighter green to the darker green (which doesn't seem to be an effect of the lighting). In the first screenshot, the colors fade from a yellow to an orangish color. Does this fall under the vertex color shader?

    Thanks again.