1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Add antialiasing filters (FXAA, SSAA) (#13253)

This commit is contained in:
x2048 2023-06-28 05:30:08 +02:00 committed by GitHub
parent 442d5fc75c
commit c09a3a52ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 230 additions and 17 deletions

View file

@ -0,0 +1,27 @@
uniform vec2 texelSize0;
#ifdef GL_ES
varying mediump vec2 varTexCoord;
#else
centroid varying vec2 varTexCoord;
#endif
varying vec2 sampleNW;
varying vec2 sampleNE;
varying vec2 sampleSW;
varying vec2 sampleSE;
/*
Based on
https://github.com/mattdesl/glsl-fxaa/
Portions Copyright (c) 2011 by Armin Ronacher.
*/
void main(void)
{
varTexCoord.st = inTexCoord0.st;
sampleNW = varTexCoord.st + vec2(-1.0, -1.0) * texelSize0;
sampleNE = varTexCoord.st + vec2(1.0, -1.0) * texelSize0;
sampleSW = varTexCoord.st + vec2(-1.0, 1.0) * texelSize0;
sampleSE = varTexCoord.st + vec2(1.0, 1.0) * texelSize0;
gl_Position = inVertexPosition;
}