Search Unity

Smooth Vertex Gradients

Discussion in 'Shaders' started by Sock Puppet, Nov 20, 2012.

  1. Sock Puppet

    Sock Puppet

    Joined:
    Jan 9, 2011
    Posts:
    77
    I'm looking at using a simple vertex color shader for a gradient background effect for my game. I tend to get to quite jarring color banding though.

    Is there anything way of influencing how the fragment shader blends the vertex colors to possibly get smoother gradients?

    Thanks.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I haven't seen any color banding with vertex colors (are you using mobile publishing with 16-bit color maybe?), but you don't actually need vertex colors anyway, you can just use a 2-pixel texture and bilinear filtering will take care of the gradient that way.

    --Eric