Commit 6cb17fe7 authored by Jan Möbius's avatar Jan Möbius

Remaining scollections

parent 038bdf45
Pipeline #4773 failed with stage
in 2 seconds
......@@ -222,3 +222,15 @@
path = PluginCollection-FilePlugins
url = https://www.graphics.rwth-aachen.de:9000/OpenFlipper-Free/PluginCollection-FilePlugins
branch = master
[submodule "PluginCollection-PostProcessors"]
path = PluginCollection-PostProcessors
url = https://www.graphics.rwth-aachen.de:9000/OpenFlipper-Free/PluginCollection-PostProcessors
branch = master
[submodule "PluginCollection-Renderers"]
path = PluginCollection-Renderers
url = https://www.graphics.rwth-aachen.de:9000/OpenFlipper-Free/PluginCollection-Renderers
branch = master
[submodule "PluginCollection-Selection"]
path = PluginCollection-Selection
url = https://www.graphics.rwth-aachen.de:9000/OpenFlipper-Free/PluginCollection-Selection
branch = master
Subproject commit 2b0ed74a10c42fb225521254b2e47d8291f50afb
include (plugin)
openflipper_plugin ( INSTALLDATA Shaders )
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 19248 $ *
* $LastChangedBy: moebius $ *
* $Date: 2014-07-21 14:27:08 +0200 (Mon, 21 Jul 2014) $ *
* *
\*===========================================================================*/
#include "PostProcessorAnaglyphPlugin.hh"
#include <ACG/GL/ScreenQuad.hh>
#include <ACG/GL/ShaderCache.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
PostProcessorAnaglyphPlugin::PostProcessorAnaglyphPlugin()
{
}
PostProcessorAnaglyphPlugin::~PostProcessorAnaglyphPlugin()
{
}
QString PostProcessorAnaglyphPlugin::checkOpenGL() {
if (!ACG::openGLVersion(3, 0))
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
return QString("");
}
QString PostProcessorAnaglyphPlugin::postProcessorName() {
return QString("AnaglyphStereo");
}
void PostProcessorAnaglyphPlugin::postProcess(ACG::GLState* _glstate, const std::vector<const PostProcessorInput*>& _input, const PostProcessorOutput& _output) {
if (_input.size() != 2) {
std::cerr << "PostProcessorAnaglyphPlugin: two input images required!" << std::endl;
return;
}
// ======================================================================================================
// Fetch shader from cache
// ======================================================================================================
QStringList macros;
if (OpenFlipper::Options::stereoMode () == OpenFlipper::Options::AnaglyphCustom)
macros.push_back("#define ANAGLYPH_CUSTOM");
GLSL::Program* shader = ACG::ShaderCache::getInstance()->getProgram("ScreenQuad/screenquad.glsl", "AnaglyphStereo/anaglyph.glsl", &macros);
// ======================================================================================================
// Bind input texture
// ======================================================================================================
_input[1]->bindColorTex(1);
_input[0]->bindColorTex(0);
// ======================================================================================================
// Bind output FBO
// ======================================================================================================
_output.bind();
// ======================================================================================================
// Setup render states
// ======================================================================================================
glDepthMask(1);
glColorMask(1,1,1,1);
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
// ======================================================================================================
// Setup shader
// ======================================================================================================
shader->use();
shader->setUniform("SceneLeft", 0);
shader->setUniform("SceneRight", 1);
if (OpenFlipper::Options::stereoMode () == OpenFlipper::Options::AnaglyphCustom)
{
// column major
std::vector<float> le = OpenFlipper::Options::anaglyphLeftEyeColorMatrix();
std::vector<float> re = OpenFlipper::Options::anaglyphRightEyeColorMatrix();
ACG::GLMatrixf ml, mr;
for (int r = 0; r < 3; ++r)
{
for (int c = 0; c < 3; ++c)
{
ml(r,c) = le[c*3 + r];
mr(r,c) = re[c*3 + r];
}
}
shader->setUniformMat3("EyeColMatrixLeft", ml);
shader->setUniformMat3("EyeColMatrixRight", mr);
}
// ======================================================================================================
// Execute
// ======================================================================================================
ACG::ScreenQuad::draw(shader);
shader->disable();
}
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2( postprocessoranaglyphstereoplugin , PostProcessorAnaglyphPlugin );
#endif
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 18127 $ *
* $LastChangedBy: moebius $ *
* $Date: 2014-02-05 10:12:54 +0100 (Wed, 05 Feb 2014) $ *
* *
\*===========================================================================*/
#include <QObject>
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/PostProcessorInterface.hh>
#include <ACG/GL/globjects.hh>
#include <ACG/ShaderUtils/GLSLShader.hh>
class PostProcessorAnaglyphPlugin : public QObject, BaseInterface, PostProcessorInterface
{
Q_OBJECT
Q_INTERFACES(BaseInterface)
Q_INTERFACES(PostProcessorInterface)
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-PostProcessorGrayscale")
#endif
public:
PostProcessorAnaglyphPlugin();
~PostProcessorAnaglyphPlugin();
public :
QString name() { return (QString("Anaglyph Stereo Postprocessor Plugin")); };
QString description( ) { return (QString(tr("Resolves left,right stereo buffer to an anaglyph"))); };
public slots:
QString version() { return QString("1.0"); };
private slots:
void postProcess(ACG::GLState* _glstate, const std::vector<const PostProcessorInput*>& _input, const PostProcessorOutput& _output);
QString postProcessorName();
QString checkOpenGL();
};
#version 130
// resolve left and right stereo buffer
// define ANAGLYPH_CUSTOM for custom color matrix transforms
uniform sampler2D SceneLeft;
uniform sampler2D SceneRight;
uniform mat3 EyeColMatrixLeft;
uniform mat3 EyeColMatrixRight;
in vec2 vTexCoord;
out vec4 outColor;
void main(void)
{
vec4 colLeft = texture2D( SceneLeft, vTexCoord );
vec4 colRight = texture2D( SceneRight, vTexCoord );
#ifndef ANAGLYPH_CUSTOM
outColor = vec4(colLeft.x, colRight.yzw);
#else
outColor = vec4(EyeColMatrixLeft * colLeft.xyz + EyeColMatrixRight * colRight.xyz, 1.0);
#endif
}
\ No newline at end of file
include (plugin)
openflipper_plugin ( INSTALLDATA Shaders )
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include <ACG/GL/acg_glew.hh>
#include "PostProcessorDepthImagePlugin.hh"
#include <ACG/GL/ScreenQuad.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
PostProcessorDepthImagePlugin::PostProcessorDepthImagePlugin()
: shader_(0)
{
}
PostProcessorDepthImagePlugin::~PostProcessorDepthImagePlugin()
{
delete shader_;
}
QString PostProcessorDepthImagePlugin::postProcessorName() {
return QString("Show Depth Image");
}
QString PostProcessorDepthImagePlugin::checkOpenGL()
{
if ( ! ACG::openGLVersion(3, 0) )
return QString("Insufficient OpenGL Version! OpenGL 3.0 or higher required");
return QString("");
}
void PostProcessorDepthImagePlugin::postProcess(ACG::GLState* _glstate, const std::vector<const PostProcessorInput*>& _input, const PostProcessorOutput& _output) {
// ======================================================================================================
// Load shader if needed
// ======================================================================================================
if (!shader_)
shader_ = GLSL::loadProgram("ShowDepth/screenquad.glsl", "ShowDepth/depth.glsl");
// ======================================================================================================
// Bind input texture
// ======================================================================================================
_input[0]->bindDepthTex(0);
// ======================================================================================================
// Bind output FBO
// ======================================================================================================
_output.bind();
// ======================================================================================================
// Setup shader
// ======================================================================================================
shader_->use();
shader_->setUniform("textureSampler", 0);
// ======================================================================================================
// Execute
// ======================================================================================================
ACG::ScreenQuad::draw(shader_);
shader_->disable();
}
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2( postprocessordepthimageplugin , PostProcessorDepthImagePlugin );
#endif
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include <QObject>
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/PostProcessorInterface.hh>
#include <ACG/GL/globjects.hh>
class PostProcessorDepthImagePlugin : public QObject, BaseInterface, PostProcessorInterface
{
Q_OBJECT
Q_INTERFACES(BaseInterface)
Q_INTERFACES(PostProcessorInterface)
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-PostProcessorDepthImage")
#endif
public:
PostProcessorDepthImagePlugin();
~PostProcessorDepthImagePlugin();
public :
QString name() { return (QString("Depth Image Postprocessor Plugin")); };
QString description( ) { return (QString(tr("Takes the rendered Image and renders the correspoding depth image to the screen"))); };
public slots:
QString version() { return QString("1.0"); };
private slots:
void postProcess(ACG::GLState* _glstate, const std::vector<const PostProcessorInput*>& _input, const PostProcessorOutput& _output);
QString postProcessorName();
QString checkOpenGL();
private:
/// shader
GLSL::Program* shader_;
};
#version 150
uniform sampler2D textureSampler;
in vec2 vTexCoord;
out vec4 oColor;
void main()
{
oColor = texture2D(textureSampler, vTexCoord);
}
#version 150
in vec4 inPosition;
out vec2 vTexCoord;
void main()
{
gl_Position = inPosition;
vTexCoord = inPosition.xy * 0.5 + vec2(0.5, 0.5);
}
\ No newline at end of file
include (plugin)
openflipper_plugin ( INSTALLDATA Shaders )
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*