2014-04-27 02:50:11 -04:00
|
|
|
$input a_position, a_texcoord0
|
|
|
|
$output v_position, v_texcoord0
|
|
|
|
|
2014-04-29 22:52:42 -04:00
|
|
|
#include "../common.sh"
|
|
|
|
|
|
|
|
#define NEED_HALF_TEXEL (BGFX_SHADER_LANGUAGE_HLSL < 4)
|
|
|
|
|
2015-05-28 18:27:00 -04:00
|
|
|
uniform vec4 u_viewSize;
|
2014-04-27 02:50:11 -04:00
|
|
|
|
2014-04-29 22:52:42 -04:00
|
|
|
#if NEED_HALF_TEXEL
|
|
|
|
uniform vec4 u_halfTexel;
|
|
|
|
#endif // NEED_HALF_TEXEL
|
|
|
|
|
2014-04-27 02:50:11 -04:00
|
|
|
void main()
|
|
|
|
{
|
2014-04-29 22:52:42 -04:00
|
|
|
#if !NEED_HALF_TEXEL
|
|
|
|
const vec4 u_halfTexel = vec4_splat(0.0);
|
|
|
|
#endif // !NEED_HALF_TEXEL
|
|
|
|
|
2014-04-27 02:50:11 -04:00
|
|
|
v_position = a_position;
|
2014-04-29 22:52:42 -04:00
|
|
|
v_texcoord0 = a_texcoord0+u_halfTexel.xy;
|
2014-04-27 02:50:11 -04:00
|
|
|
gl_Position = vec4(2.0*v_position.x/u_viewSize.x - 1.0, 1.0 - 2.0*v_position.y/u_viewSize.y, 0.0, 1.0);
|
|
|
|
}
|