50 #include <ACG/GL/acg_glew.hh> 52 #include "PostProcessorSobelPlugin.hh" 54 #include <ACG/GL/ScreenQuad.hh> 58 PostProcessorSobelPlugin::PostProcessorSobelPlugin() :
63 PostProcessorSobelPlugin::~PostProcessorSobelPlugin()
69 QString PostProcessorSobelPlugin::postProcessorName() {
70 return QString(
"Sobel");
73 void PostProcessorSobelPlugin::postProcess(
ACG::GLState* _glstate,
const std::vector<const PostProcessorInput*>& _input,
const PostProcessorOutput& _output) {
85 _input[0]->bindColorTex(0);
98 shader_->setUniform(
"textureSampler", 0);
100 ACG::Vec2f texcoordOffset(1.0f /
float(_input[0]->width), 1.0f /
float(_input[0]->height));
101 shader_->setUniform(
"texcoordOffset", texcoordOffset);
114 #if QT_VERSION < 0x050000
static void draw(GLSL::Program *_prog=0)
Draw the screen quad.
GLSL::PtrProgram loadProgram(const char *vertexShaderFile, const char *tessControlShaderFile, const char *tessEvaluationShaderFile, const char *geometryShaderFile, const char *fragmentShaderFile, const GLSL::StringList *macros, bool verbose)