Use UBO in MLAA

This commit is contained in:
vlj 2014-05-25 03:21:08 +02:00
parent 5ce3a6221a
commit 2cf9bb6d2c

View File

@ -1,4 +1,12 @@
uniform vec2 PIXEL_SIZE;
layout (std140) uniform MatrixesData
{
mat4 ViewMatrix;
mat4 ProjectionMatrix;
mat4 InverseViewMatrix;
mat4 InverseProjectionMatrix;
mat4 ShadowViewProjMatrixes[4];
vec2 screen;
};
in vec2 Position;
in vec2 Texcoord;
@ -12,6 +20,6 @@ void main() {
// invy.y = 1.0 - invy.y;
uv = invy.st;
offset[0] = invy.xyxy + PIXEL_SIZE.xyxy * vec4(-1.0, 0.0, 0.0, 1.0);
offset[1] = invy.xyxy + PIXEL_SIZE.xyxy * vec4( 1.0, 0.0, 0.0, -1.0);
offset[0] = invy.xyxy + screen.xyxy * vec4(-1.0, 0.0, 0.0, 1.0);
offset[1] = invy.xyxy + screen.xyxy * vec4( 1.0, 0.0, 0.0, -1.0);
}