Skip to content

Commit 2931004

Browse files
committed
tr_backend: fix FXAA sampling by using GL_LINEAR on currentRender
- fix FXAA by using GL_LINEAR on currentRender, - restore GL_NEAREST after that to not break other effects.
1 parent a02cb5e commit 2931004

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/engine/renderer/tr_backend.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,11 +1625,19 @@ void RB_FXAA()
16251625
GL_BindToTMU( 0, tr.currentRenderImage[backEnd.currentMainFBO] )
16261626
);
16271627

1628+
// The framebuffer should use GL_LINEAR for FXAA to work.
1629+
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
1630+
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
1631+
16281632
// This shader is run last, so let it render to screen.
16291633
R_BindNullFBO();
16301634

16311635
Tess_InstantScreenSpaceQuad();
16321636

1637+
// Restore GL_NEAREST to not break other effects.
1638+
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
1639+
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
1640+
16331641
GL_CheckErrors();
16341642
}
16351643

0 commit comments

Comments
 (0)