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:
parent
442d5fc75c
commit
c09a3a52ac
10 changed files with 230 additions and 17 deletions
27
client/shaders/fxaa/opengl_vertex.glsl
Normal file
27
client/shaders/fxaa/opengl_vertex.glsl
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue