Ops - Auto-reload + resize support

This commit is contained in:
Emmanuel BENOîT 2017-11-15 23:09:52 +01:00
parent c3171aba94
commit e0e7ab5441
11 changed files with 201 additions and 128 deletions

View file

@ -11,7 +11,7 @@
//! include chunks/fxaa-3.11.glsl
layout( location = 0 ) uniform sampler2D u_Input;
layout( location = 1 ) uniform vec2 u_Resolution;
layout( location = 1 ) uniform vec4 u_Viewport;
layout( location = 2 ) uniform vec3 u_Parameters;
#define uSPQuality (u_Parameters.x)
@ -22,13 +22,14 @@ layout( location = 0 ) out vec4 o_Color;
void main( void )
{
vec2 coords = gl_FragCoord.xy - u_Viewport.xy;
o_Color = FxaaPixelShader(
( gl_FragCoord.xy / u_Resolution ) , // pos (vec2)
( coords / u_Viewport.zw ) , // pos (vec2)
vec4( 0 ) , // unused (vec4)
u_Input , // input texture
u_Input , // (unused) input texture
u_Input , // (unused) input texture
vec2( 1 ) / u_Resolution , // 1/resolution (vec2)
vec2( 1 ) / u_Viewport.zw , // 1/resolution (vec2)
vec4( 0 ) , // unused (vec4)
vec4( 0 ) , // unused (vec4)
vec4( 0 ) , // unused (vec4)