demotool/shaders/fxaa.f.glsl

44 lines
1.2 KiB
Text
Raw Normal View History

2017-10-05 18:35:35 +02:00
#version 450 core
//! type fragment
#define FXAA_PC 1
#define FXAA_GLSL_130 1
#define FXAA_FAST_PIXEL_OFFSET 1
#define FXAA_GATHER4_ALPHA 1
#define FXAA_QUALITY__PRESET 39
//! include chunks/fxaa-3.11.glsl
layout( location = 0 ) uniform sampler2D u_Input;
layout( location = 1 ) uniform vec2 u_Resolution;
layout( location = 2 ) uniform vec3 u_Parameters;
#define uSPQuality (u_Parameters.x)
#define uEdgeThreshold (u_Parameters.y)
#define uEdgeThresholdMin (u_Parameters.z)
layout( location = 0 ) out vec4 o_Color;
void main( void )
{
o_Color = FxaaPixelShader(
( gl_FragCoord.xy / u_Resolution ) , // 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)
vec4( 0 ) , // unused (vec4)
vec4( 0 ) , // unused (vec4)
vec4( 0 ) , // unused (vec4)
uSPQuality , // sub-pixel quality (float in [0;1])
uEdgeThreshold , // edge threshold (float, [.063;.333], lower = better)
uEdgeThresholdMin , // edge threshold min (float, [0.0312;0.0833],
// higher = better)
0 , // unused (float)
0 , // unused (float)
0 , // unused (float)
vec4( 0 ) ); // unused (vec4)
}