2014-03-15 13:35:51 -04:00
|
|
|
uniform vec3 color_from;
|
|
|
|
uniform vec3 color_to;
|
2013-12-31 12:25:10 -05:00
|
|
|
|
2017-02-01 15:58:10 -05:00
|
|
|
#ifdef Explicit_Attrib_Location_Usable
|
2014-08-13 15:04:03 -04:00
|
|
|
layout(location=0) in vec3 Position;
|
|
|
|
layout(location = 1) in float lifetime;
|
|
|
|
layout(location = 2) in float size;
|
|
|
|
|
|
|
|
layout(location=3) in vec2 Texcoord;
|
|
|
|
layout(location = 4) in vec2 quadcorner;
|
2014-09-09 19:42:51 -04:00
|
|
|
#else
|
|
|
|
in vec3 Position;
|
|
|
|
in float lifetime;
|
|
|
|
in float size;
|
|
|
|
|
|
|
|
in vec2 Texcoord;
|
|
|
|
in vec2 quadcorner;
|
|
|
|
#endif
|
2013-12-31 12:25:10 -05:00
|
|
|
|
|
|
|
out float lf;
|
2013-12-31 15:39:00 -05:00
|
|
|
out vec2 tc;
|
2017-09-01 19:01:35 -04:00
|
|
|
out vec4 pc;
|
2013-12-29 13:23:36 -05:00
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
2014-08-13 15:04:03 -04:00
|
|
|
tc = Texcoord;
|
|
|
|
lf = lifetime;
|
2017-09-01 19:01:35 -04:00
|
|
|
pc = vec4(vec3(color_from + (color_to - color_from) * lf), 1.0) * smoothstep(1., 0.8, lf);
|
|
|
|
#if defined(GL_ES) && !defined(Advanced_Lighting_Enabled)
|
|
|
|
pc.rgb = pow(pc.rgb, vec3(1. / 2.2));
|
|
|
|
#endif
|
2014-08-13 15:04:03 -04:00
|
|
|
vec3 newposition = Position;
|
2014-01-08 13:34:57 -05:00
|
|
|
|
2014-01-10 12:26:57 -05:00
|
|
|
vec4 viewpos = ViewMatrix * vec4(newposition, 1.0);
|
2014-08-13 15:04:03 -04:00
|
|
|
viewpos += size * vec4(quadcorner, 0., 0.);
|
|
|
|
gl_Position = ProjectionMatrix * viewpos;
|
2013-12-29 13:23:36 -05:00
|
|
|
}
|