2012-12-04 03:05:34 +00:00
|
|
|
attribute vec4 attr_Position;
|
|
|
|
attribute vec4 attr_TexCoord0;
|
|
|
|
|
2016-03-11 12:37:50 +00:00
|
|
|
uniform vec4 u_ViewInfo; // zfar / znear, zfar, 1/width, 1/height
|
|
|
|
|
2012-12-04 03:05:34 +00:00
|
|
|
varying vec2 var_ScreenTex;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
gl_Position = attr_Position;
|
2016-04-05 09:37:05 +00:00
|
|
|
vec2 wh = vec2(1.0) / u_ViewInfo.zw - vec2(1.0);
|
|
|
|
var_ScreenTex = (floor(attr_TexCoord0.xy * wh) + vec2(0.5)) * u_ViewInfo.zw;
|
2016-03-11 12:37:50 +00:00
|
|
|
|
2012-12-04 03:05:34 +00:00
|
|
|
//vec2 screenCoords = gl_Position.xy / gl_Position.w;
|
|
|
|
//var_ScreenTex = screenCoords * 0.5 + 0.5;
|
|
|
|
}
|