2015-04-15 13:37:00 -04:00
|
|
|
$input a_position, i_data0
|
2014-12-20 00:09:58 -05:00
|
|
|
$output v_texCoord
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2014 Stanlo Slasinski. All rights reserved.
|
2016-01-01 03:11:04 -05:00
|
|
|
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
|
2014-12-20 00:09:58 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "../common/common.sh"
|
|
|
|
#include "uniforms.sh"
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2015-04-15 13:37:00 -04:00
|
|
|
vec3 eye = mul(u_view, vec4(i_data0.xyz, 1.0) ).xyz;
|
2014-12-20 00:09:58 -05:00
|
|
|
vec3 up = normalize(cross(eye, vec3(1.0, 0.0, 0.0) ) );
|
|
|
|
vec3 right = normalize(cross(up, eye));
|
|
|
|
float size = u_particleSize;
|
|
|
|
vec3 position = eye + size * right * a_position.x + size * up * a_position.y;
|
|
|
|
|
|
|
|
v_texCoord.xy = a_position;
|
2015-04-15 13:37:00 -04:00
|
|
|
v_texCoord.z = i_data0.w;
|
2014-12-20 00:09:58 -05:00
|
|
|
gl_Position = mul(u_proj, vec4(position, 1.0) );
|
|
|
|
}
|