forked from jdgleaver/ppsspp_shaders
-
Notifications
You must be signed in to change notification settings - Fork 1
/
4xhqglsl.vsh
32 lines (30 loc) · 923 Bytes
/
4xhqglsl.vsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
attribute vec4 a_position;
attribute vec2 a_texcoord0;
uniform vec2 u_texelDelta;
uniform vec2 u_pixelDelta;
varying vec4 v_texcoord0;
varying vec4 v_texcoord1;
varying vec4 v_texcoord2;
varying vec4 v_texcoord3;
varying vec4 v_texcoord4;
varying vec4 v_texcoord5;
varying vec4 v_texcoord6;
void main()
{
float x = u_pixelDelta.x*((u_texelDelta.x/u_pixelDelta.x)/2.0);
float y = u_pixelDelta.y*((u_texelDelta.y/u_pixelDelta.y)/2.0);
vec2 dg1 = vec2( x,y);
vec2 dg2 = vec2(-x,y);
vec2 sd1 = dg1*0.5;
vec2 sd2 = dg2*0.5;
gl_Position = a_position;
v_texcoord0=a_texcoord0.xyxy;
v_texcoord1.xy = v_texcoord0.xy - sd1;
v_texcoord2.xy = v_texcoord0.xy - sd2;
v_texcoord3.xy = v_texcoord0.xy + sd1;
v_texcoord4.xy = v_texcoord0.xy + sd2;
v_texcoord5.xy = v_texcoord0.xy - dg1;
v_texcoord6.xy = v_texcoord0.xy + dg1;
v_texcoord5.zw = v_texcoord0.xy - dg2;
v_texcoord6.zw = v_texcoord0.xy + dg2;
}