Commit 3dcda576 authored by Christopher Tenter's avatar Christopher Tenter

make fxaa compatible on non shader_model5 gpus

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free-Staging@20492 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e87b8f29
......@@ -73,9 +73,6 @@ QString PostProcessorFXAAPlugin::checkOpenGL() {
if (!ACG::openGLVersion(3, 0))
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
if (!ACG::checkExtensionSupported("ARB_texture_gather"))
return QString("Missing extension: ARB_texture_gather");
return QString("");
}
......@@ -98,10 +95,7 @@ void PostProcessorFXAAPlugin::postProcess(ACG::GLState* _glstate, const std::vec
// Bind input texture
// ======================================================================================================
glActiveTexture(GL_TEXTURE0);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, _input[0]->colorTex_);
_input[0]->bindColorTex(0);
// ======================================================================================================
// Put luma in alpha channel
......@@ -125,18 +119,7 @@ void PostProcessorFXAAPlugin::postProcess(ACG::GLState* _glstate, const std::vec
// Bind output FBO
// ======================================================================================================
glBindFramebuffer(GL_FRAMEBUFFER, _output.fbo_);
glDrawBuffer(_output.drawBuffer_);
// ======================================================================================================
// Setup render states
// ======================================================================================================
glDepthMask(1);
glColorMask(1,1,1,1);
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
_output.bind();
// ======================================================================================================
// Setup shader
......
#version 130
#extension GL_ARB_texture_gather : enable
// http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf
......@@ -32,6 +30,15 @@ uniform vec4 fxaaConsole360ConstDir = vec4(0,0,0,0);
#define FXAA_QUALITY__PRESET 39
#ifdef GL_ARB_gpu_shader5
#extension GL_ARB_gpu_shader5 : enable
#define FXAA_GATHER4_ALPHA 1
#else
#define FXAA_GATHER4_ALPHA 0
#endif
#include "Fxaa3_11.h"
void main()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment