Question by
twoski · Jan 17, 2017 at 12:30 AM ·
shadershadersverticesvertex shader
Shader for alpha fading
So i want to make a shader for a mesh that allows me to somehow retrieve an alpha value from each vertex and lerp between that value from vertex to vertex.
For example, if i had 9 vertices:
. . .
. . .
. . .
and if the center vertex had 100% alpha while the rest had 10%, then the result would be a center that is opaque but fades into transparency towards all outer edges.
Is this possible or do with a shader i need to approach this problem differently?
Comment
From memory, vertex colours are interpolated by default, so all you would need to do is pass the vertex colour information into the alpha output of a transparent shader.