44 #include <ACG/GL/acg_glew.hh> 46 #include "DepthPeeling.hh" 52 #include <ACG/GL/ShaderCache.hh> 53 #include <ACG/GL/GLError.hh> 54 #include <ACG/GL/ScreenQuad.hh> 77 _code->push_back(
"float dp_prevDepth = texture(g_DepthLayer, sg_vScreenPos).x;");
78 _code->push_back(
"if (gl_FragCoord.z <= dp_prevDepth) discard;");
83 _code->push_back(
"outFragment = vec4(sg_cColor.rgb * sg_cColor.a, sg_cColor.a);");
84 _code->push_back(
"outDepth = gl_FragCoord.z;");
102 _code->push_back(
"outFragment = vec4(sg_cColor.rgb * sg_cColor.a, 1.0 - sg_cColor.a);");
103 _code->push_back(
"outDepth = gl_FragCoord.z;");
116 _shader->
addUniform(
"sampler2D g_DepthLayer");
117 _shader->
addUniform(
"sampler2D g_FrontLayer");
126 _code->push_back(
"float fragDepth = gl_FragCoord.z;");
132 _code->push_back(
"vec2 depthLayer = texture(g_DepthLayer, sg_vScreenPos).xy;");
133 _code->push_back(
"vec4 forwardTemp = texture(g_FrontLayer, sg_vScreenPos);");
138 _code->push_back(
"vec2 depthLayer = texture2D(g_DepthLayer, sg_vScreenPos).xy;");
139 _code->push_back(
"vec4 forwardTemp = texture2D(g_FrontLayer, sg_vScreenPos);");
141 _code->push_back(
"outDepth = vec4(depthLayer, 0, 0);");
142 _code->push_back(
"outFragment = forwardTemp;");
143 _code->push_back(
"outBackColor = vec4(0,0,0,0);");
146 _code->push_back(
"float nearestDepth = -depthLayer.x;");
147 _code->push_back(
"float farthestDepth = depthLayer.y;");
148 _code->push_back(
"float alphaMultiplier = 1.0 - forwardTemp.w;");
151 _code->push_back(
"if (fragDepth < nearestDepth || fragDepth > farthestDepth) {");
152 _code->push_back(
"outDepth = vec4(-1,-1,-1,-1);");
153 _code->push_back(
"return;");
154 _code->push_back(
"}");
156 _code->push_back(
"if (fragDepth > nearestDepth && fragDepth < farthestDepth) {");
157 _code->push_back(
"outDepth = vec4(-fragDepth, fragDepth, 0, 0);");
158 _code->push_back(
"return;");
159 _code->push_back(
"}");
165 _code->push_back(
"outDepth = vec4(-1,-1,-1,-1);");
166 _code->push_back(
"outFragment = forwardTemp;");
168 _code->push_back(
"if (fragDepth == nearestDepth) {");
169 _code->push_back(
"outFragment.xyz += sg_cColor.rgb * sg_cColor.a * alphaMultiplier;");
170 _code->push_back(
"outFragment.w = 1.0 - alphaMultiplier * (1.0 - sg_cColor.a);");
174 _code->push_back(
"} else {");
175 _code->push_back(
"outBackColor += sg_cColor;");
176 _code->push_back(
"}");
187 _code->push_back(
"outFragment = vec4(-gl_FragCoord.z, gl_FragCoord.z, 0, 0);");
201 #define RENDERFLAG_ALLOW_PEELING 1 206 DepthPeeling::DepthPeeling()
207 : peelMode_(1), copyFrontDepth_(1), maxPeelCount_(20), peelBlend_(0), peelFinal_(0), peelQueryID_(0),
208 peelBlendDual_(0), peelFinalDual_(0)
213 DepthPeeling::~DepthPeeling()
219 QString DepthPeeling::checkOpenGL()
224 return QString(
"Insufficient OpenGL Version! OpenGL 3.2 or higher required");
232 void DepthPeeling::initializePlugin()
237 void DepthPeeling::exit()
245 delete peelBlendDual_;
248 delete peelFinalDual_;
252 glDeleteQueries(1, &peelQueryID_);
258 void DepthPeeling::slotModeChanged( QAction * _action)
261 if ( _action->text() ==
"Front to Back") {
263 }
else if ( _action->text() ==
"Dual") {
266 std::cerr <<
"Error : optionHandling unable to find peeling mode!!! " << _action->text().toStdString() << std::endl;
283 renderFrontPeeling(_glState, _properties);
285 renderDualPeeling(_glState, _properties);
289 finishRenderingPipeline();
299 const int numRenderObjects = getNumRenderObjects();
303 int lastPeeledObject = -1;
305 for (
int i = numRenderObjects - 1; i > lastPeeledObject; --i)
307 if ((sortedObjects_[i]->internalFlags_ & RENDERFLAG_ALLOW_PEELING) && sortedObjects_[i]->alpha < 0.99f)
308 lastPeeledObject = i;
311 if (lastPeeledObject == -1)
314 for (
int i = 0; i < numRenderObjects; ++i)
315 renderObject(sortedObjects_[i]);
332 const GLenum depthTarget = GL_COLOR_ATTACHMENT0;
333 const GLenum colorTarget = GL_COLOR_ATTACHMENT1;
334 const GLenum colorBlendTarget = GL_COLOR_ATTACHMENT4;
335 GLenum peelLayerTargets[2] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1};
337 const float clearDepth = 1.0f;
343 glBindFramebuffer(GL_FRAMEBUFFER, viewRes->singleFbo_->
getFboID());
347 glColorMask(1,1,1,1);
350 glDrawBuffer(colorBlendTarget);
352 glClear(GL_COLOR_BUFFER_BIT);
355 glDrawBuffer(colorTarget);
356 glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
357 glClear(GL_COLOR_BUFFER_BIT);
360 glDrawBuffer(depthTarget);
361 glClearColor(clearDepth, 0.0f, 0.0f, 0.0f);
362 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
367 peelLayerTargets[0] = colorBlendTarget;
368 peelLayerTargets[1] = depthTarget;
369 glDrawBuffers(2, peelLayerTargets);
372 glDisable(GL_ALPHA_TEST);
374 glEnable(GL_DEPTH_TEST);
375 glDepthFunc(GL_LESS);
376 glDisable(GL_CULL_FACE);
378 for (
int i = 0; i < numRenderObjects; ++i)
391 renderObject(sortedObjects_[i], initProg,
true);
397 copyDepthToBackBuffer(viewRes->singleDepthTex_[0], 1.0f);
403 for (
int pass = 1; pass < maxPeelCount_; ++pass)
405 const int currID = pass & 1;
406 const int prevID = 1 - currID;
407 const int bufID = currID * 2;
412 const GLenum targetBuffer[2] = {colorTarget + bufID, depthTarget + bufID};
418 glDrawBuffer(targetBuffer[0]);
419 glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
420 glClear(GL_COLOR_BUFFER_BIT);
422 glDrawBuffer(targetBuffer[1]);
423 glClearColor(clearDepth, 0.0f, 0.0f, 0.0f);
424 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
427 glDrawBuffers(2, targetBuffer);
431 glEnable(GL_DEPTH_TEST);
434 glBeginQuery(GL_SAMPLES_PASSED, peelQueryID_);
438 glActiveTexture(GL_TEXTURE4);
439 glBindTexture(GL_TEXTURE_2D, viewRes->singleDepthTex_[prevID]);
442 for (
int k = 0; k < numRenderObjects; ++k)
444 if ((sortedObjects_[k]->internalFlags_ & RENDERFLAG_ALLOW_PEELING) && sortedObjects_[k]->alpha < 0.99f)
458 renderObject(sortedObjects_[k], peelProg,
true);
462 glEndQuery(GL_SAMPLES_PASSED);
469 glDrawBuffer(colorBlendTarget);
472 glColorMask(1,1,1,1);
474 glDisable(GL_DEPTH_TEST);
477 glBlendEquation(GL_FUNC_ADD);
479 GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
483 peelBlend_->setUniform(
"BlendTex", 0);
485 glActiveTexture(GL_TEXTURE0);
486 glBindTexture(GL_TEXTURE_2D, viewRes->singleFrontTex_[currID]);
495 GLuint passedSamples;
496 glGetQueryObjectuiv(peelQueryID_, GL_QUERY_RESULT, &passedSamples);
497 if (passedSamples == 0)
506 glColorMask(1,1,1,1);
508 glDisable(GL_DEPTH_TEST);
518 peelFinal_->setUniform(
"BkgColor", bkgColor);
520 peelFinal_->setUniform(
"SceneTex", 0);
522 glActiveTexture(GL_TEXTURE0);
523 glBindTexture(GL_TEXTURE_2D, viewRes->singleBlendTex_);
533 glEnable(GL_DEPTH_TEST);
546 const int numRenderObjects = getNumRenderObjects();
550 int lastPeeledObject = -1;
552 for (
int i = numRenderObjects - 1; i > lastPeeledObject; --i)
554 if ((sortedObjects_[i]->internalFlags_ & RENDERFLAG_ALLOW_PEELING) && sortedObjects_[i]->alpha < 0.99f)
555 lastPeeledObject = i;
561 for (
int i = 0; i < numRenderObjects; ++i)
562 renderObject(sortedObjects_[i]);
569 initDualDepthPeeling();
578 glColorMask(1,1,1,1);
584 glBindFramebuffer(GL_FRAMEBUFFER, viewRes->dualFbo_->
getFboID());
586 const GLenum depthTarget = GL_COLOR_ATTACHMENT0;
587 const GLenum colorTargets[] = {GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2};
588 const GLenum colorBlendTarget = GL_COLOR_ATTACHMENT6;
591 glDrawBuffers(2, colorTargets);
592 glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
593 glClear(GL_COLOR_BUFFER_BIT);
596 glDrawBuffer(colorBlendTarget);
598 glClear(GL_COLOR_BUFFER_BIT);
601 glDrawBuffer(depthTarget);
602 glClearColor(-1.0f, -1.0f, 0.0f, 0.0f);
603 glClear(GL_COLOR_BUFFER_BIT);
609 glBlendEquation(GL_MAX_EXT);
611 if(_glState->compatibilityProfile())
612 glDisable(GL_ALPHA_TEST);
614 glEnable(GL_DEPTH_TEST);
615 glDepthFunc(GL_LESS);
616 glDisable(GL_CULL_FACE);
618 for (
int i = 0; i < numRenderObjects; ++i)
622 renderObject(sortedObjects_[i], initProg,
true);
630 copyDepthToBackBuffer(viewRes->dualDepthTex_[0], -1.0f);
641 for (
int pass = 1; 1 && pass < maxPeelCount_; ++pass)
644 const int prevID = 1 - currID;
645 const int bufID = currID * 3;
647 GLenum targetBuffer[3];
648 targetBuffer[0] = GL_COLOR_ATTACHMENT0 + bufID;
649 targetBuffer[1] = GL_COLOR_ATTACHMENT1 + bufID;
650 targetBuffer[2] = GL_COLOR_ATTACHMENT2 + bufID;
654 glDrawBuffers(2, targetBuffer + 1);
655 glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
656 glClear(GL_COLOR_BUFFER_BIT);
659 glDrawBuffer(targetBuffer[0]);
660 glClearColor(-1.0f, -1.0f, 0.0f, 0.0f);
661 glClear(GL_COLOR_BUFFER_BIT);
668 glBlendEquation(GL_MAX_EXT);
669 glDrawBuffers(3, targetBuffer);
675 glActiveTexture(GL_TEXTURE5);
676 glBindTexture(GL_TEXTURE_2D, viewRes->dualFrontTex_[prevID]);
678 glActiveTexture(GL_TEXTURE4);
679 glBindTexture(GL_TEXTURE_2D, viewRes->dualDepthTex_[prevID]);
682 glActiveTexture(GL_TEXTURE0);
685 for (
int i = 0; i < numRenderObjects; ++i)
702 if (locOutFrag != 1 ||
704 locOutBackColor != 2)
716 renderObject(sortedObjects_[i], peelProg,
true);
737 glDrawBuffer(colorBlendTarget);
739 glBlendEquation(GL_FUNC_ADD);
743 glActiveTexture(GL_TEXTURE0);
744 glBindTexture(GL_TEXTURE_2D, viewRes->dualBackTex_[currID]);
747 glBeginQuery(GL_SAMPLES_PASSED_ARB, peelQueryID_);
749 peelBlendDual_->use();
750 peelBlendDual_->setUniform(
"BlendTex", 0);
754 glEndQuery(GL_SAMPLES_PASSED_ARB);
759 GLuint passedSamples;
760 glGetQueryObjectuiv(peelQueryID_, GL_QUERY_RESULT, &passedSamples);
761 if (passedSamples == 0)
771 glColorMask(1,1,1,1);
773 glDisable(GL_DEPTH_TEST);
777 peelFinalDual_->use();
785 peelFinalDual_->setUniform(
"BkgColor", bkgColor);
790 peelFinalDual_->setUniform(
"FrontSceneTex", 0);
791 peelFinalDual_->setUniform(
"BackSceneTex", 1);
793 glActiveTexture(GL_TEXTURE1);
794 glBindTexture(GL_TEXTURE_2D, viewRes->dualBlendTex_);
796 glActiveTexture(GL_TEXTURE0);
797 glBindTexture(GL_TEXTURE_2D, viewRes->dualFrontTex_[currID]);
803 peelFinalDual_->disable();
842 std::cout <<
"error: missing vertex declaration" << std::endl;
845 renderObjects_.push_back(*_renderObject);
861 if (p->alpha < 1.0f &&
863 p->depthWrite && (p->
depthFunc == GL_LESS ||
877 DepthPeeling::ViewerResources::ViewerResources()
878 : width_(0), height_(0), singleBlendTex_(0), singleFbo_(0), dualBlendTex_(0), dualFbo_(0)
880 memset(singleDepthTex_, 0,
sizeof(singleDepthTex_));
881 memset(singleFrontTex_, 0,
sizeof(singleFrontTex_));
883 memset(dualDepthTex_, 0,
sizeof(dualDepthTex_));
884 memset(dualFrontTex_, 0,
sizeof(dualFrontTex_));
885 memset(dualBackTex_, 0,
sizeof(dualBackTex_));
889 DepthPeeling::ViewerResources::~ViewerResources()
896 void DepthPeeling::ViewerResources::resize(
bool _dualPeeling,
unsigned int _width,
unsigned int _height)
898 if (!_width || !_height)
918 wrapmode = GL_CLAMP_TO_EDGE;
922 singleFbo_->attachTexture2D(GL_COLOR_ATTACHMENT0, width_, height_, GL_R32F, GL_RGB, wrapmode, GL_NEAREST, GL_NEAREST);
923 singleFbo_->attachTexture2D(GL_COLOR_ATTACHMENT1, width_, height_, GL_RGBA, GL_RGBA, wrapmode, GL_NEAREST, GL_NEAREST);
925 singleFbo_->attachTexture2D(GL_COLOR_ATTACHMENT2, width_, height_, GL_R32F, GL_RGB, wrapmode, GL_NEAREST, GL_NEAREST);
926 singleFbo_->attachTexture2D(GL_COLOR_ATTACHMENT3, width_, height_, GL_RGBA, GL_RGBA, wrapmode, GL_NEAREST, GL_NEAREST);
928 singleFbo_->attachTexture2D(GL_COLOR_ATTACHMENT4, width_, height_, GL_RGBA, GL_RGBA, wrapmode, GL_NEAREST, GL_NEAREST);
930 singleFbo_->attachTexture2DDepth(width_, height_);
932 singleDepthTex_[0] = singleFbo_->getAttachment(GL_COLOR_ATTACHMENT0);
933 singleDepthTex_[1] = singleFbo_->getAttachment(GL_COLOR_ATTACHMENT2);
935 singleFrontTex_[0] = singleFbo_->getAttachment(GL_COLOR_ATTACHMENT1);
936 singleFrontTex_[1] = singleFbo_->getAttachment(GL_COLOR_ATTACHMENT3);
938 singleBlendTex_ = singleFbo_->getAttachment(GL_COLOR_ATTACHMENT4);
941 singleFbo_->checkFramebufferStatus();
946 singleFbo_->resize(_width, _height);
967 wrapmode = GL_CLAMP_TO_EDGE;
971 dualFbo_->attachTexture2D(GL_COLOR_ATTACHMENT0, width_, height_, GL_RG32F, GL_RGB, wrapmode, GL_NEAREST, GL_NEAREST);
972 dualFbo_->attachTexture2D(GL_COLOR_ATTACHMENT1, width_, height_, GL_RGBA, GL_RGBA, wrapmode, GL_NEAREST, GL_NEAREST);
973 dualFbo_->attachTexture2D(GL_COLOR_ATTACHMENT2, width_, height_, GL_RGBA, GL_RGBA, wrapmode, GL_NEAREST, GL_NEAREST);
975 dualFbo_->attachTexture2D(GL_COLOR_ATTACHMENT3, width_, height_, GL_RG32F, GL_RGB, wrapmode, GL_NEAREST, GL_NEAREST);
976 dualFbo_->attachTexture2D(GL_COLOR_ATTACHMENT4, width_, height_, GL_RGBA, GL_RGBA, wrapmode, GL_NEAREST, GL_NEAREST);
977 dualFbo_->attachTexture2D(GL_COLOR_ATTACHMENT5, width_, height_, GL_RGBA, GL_RGBA, wrapmode, GL_NEAREST, GL_NEAREST);
979 dualFbo_->attachTexture2D(GL_COLOR_ATTACHMENT6, width_, height_, GL_RGB, GL_RGB, wrapmode, GL_NEAREST, GL_NEAREST);
981 dualDepthTex_[0] = dualFbo_->getAttachment(GL_COLOR_ATTACHMENT0);
982 dualDepthTex_[1] = dualFbo_->getAttachment(GL_COLOR_ATTACHMENT3);
984 dualFrontTex_[0] = dualFbo_->getAttachment(GL_COLOR_ATTACHMENT1);
985 dualFrontTex_[1] = dualFbo_->getAttachment(GL_COLOR_ATTACHMENT4);
987 dualBackTex_[0] = dualFbo_->getAttachment(GL_COLOR_ATTACHMENT2);
988 dualBackTex_[1] = dualFbo_->getAttachment(GL_COLOR_ATTACHMENT5);
990 dualBlendTex_ = dualFbo_->getAttachment(GL_COLOR_ATTACHMENT6);
993 dualFbo_->checkFramebufferStatus();
998 dualFbo_->resize(_width, _height);
1003 glBindFramebuffer(GL_FRAMEBUFFER, 0);
1011 if (peelBlend_ && peelFinal_ && peelQueryID_)
1023 peelBlend_ =
GLSL::loadProgram(
"DepthPeeling/screenquad_330.glsl",
"DepthPeeling/blend_330.glsl");
1026 peelFinal_ =
GLSL::loadProgram(
"DepthPeeling/screenquad_330.glsl",
"DepthPeeling/final_330.glsl");
1032 peelBlend_ =
GLSL::loadProgram(
"DepthPeeling/screenquad.glsl",
"DepthPeeling/blend.glsl");
1035 peelFinal_ =
GLSL::loadProgram(
"DepthPeeling/screenquad.glsl",
"DepthPeeling/final.glsl");
1040 glGenQueries(1, &peelQueryID_);
1048 if (peelBlendDual_ && peelFinalDual_ && peelQueryID_)
1056 #ifdef __APPLE__ //this is fugly, pimpl pattern would be much appreciated 1060 peelBlendDual_ =
GLSL::loadProgram(
"DepthPeeling/screenquad_330.glsl",
"DepthPeeling/blend_dual_330.glsl");
1061 if (!peelFinalDual_)
1062 peelFinalDual_ =
GLSL::loadProgram(
"DepthPeeling/screenquad_330.glsl",
"DepthPeeling/final_dual_330.glsl");
1068 peelBlendDual_ =
GLSL::loadProgram(
"DepthPeeling/screenquad.glsl",
"DepthPeeling/blend_dual.glsl");
1069 if (!peelFinalDual_)
1070 peelFinalDual_ =
GLSL::loadProgram(
"DepthPeeling/screenquad.glsl",
"DepthPeeling/final_dual.glsl");
1075 glGenQueries(1, &peelQueryID_);
1086 &PeelInitModifier::instance, &PeelLayerModifier::instance,
1087 &PeelDualInitModifier::instance, &PeelDualLayerModifier::instance
1093 infoString +=
"PeelInit:\n\n\n";
1095 std::vector<ACG::ShaderModifier*> mods;
1096 mods.push_back(availableMods[peelMode_*2]);
1098 infoString += dumpCurrentRenderObjectsToString(&sortedObjects_[0],_outputShaderInfo, &mods);
1101 infoString +=
"\n\n-----------------------------------------------\n\n\n\n";
1102 infoString +=
"PeelLayer:\n\n\n";
1104 mods[0] = availableMods[peelMode_*2 + 1];
1106 infoString += dumpCurrentRenderObjectsToString(&sortedObjects_[0],_outputShaderInfo, &mods);
static void blendFuncSeparate(GLenum _srcRGB, GLenum _dstRGB, GLenum _srcAlpha, GLenum _dstAlpha)
replaces glBlendFuncSeparate, supports locking
void modifyFragmentIO(ShaderGenerator *_shader)
Add your own inputs/outputs to the fragment shader.
void addOutput(const QString &_output)
Add one GLSL output specifier.
static void draw(GLSL::Program *_prog=0)
Draw the screen quad.
void use()
Enables the program object for using.
int viewport_width() const
get viewport width
Namespace providing different geometric functions concerning angles.
void initDepthPeeling()
Allocate framebuffers and load shaders for depth-peeling.
GLenum depthFunc
GL_LESS, GL_LEQUAL, GL_GREATER ..
ACG::SceneGraph::BaseNode * getSceneGraphRootNode()
get scenegraph root node
void drawMode(ACG::SceneGraph::DrawModes::DrawMode _mode)
set draw mode (No test if this mode is available!)
void modifyFragmentEndCode(QStringList *_code)
Append code the the fragment shader.
ShaderGenDesc shaderDesc
Drawmode and other shader params.
int getFragDataLocation(const char *_name)
Get location of the fragment data output.
GLuint getFboID()
return opengl id
unsigned int internalFlags_
may be used internally by the renderer
unsigned int width_
viewer window width
void modifyFragmentBeginCode(QStringList *_code)
Append code the the fragment shader.
void modifyFragmentEndCode(QStringList *_code)
Append code the the fragment shader.
GLSL::PtrProgram loadProgram(const char *vertexShaderFile, const char *tessControlShaderFile, const char *tessEvaluationShaderFile, const char *geometryShaderFile, const char *fragmentShaderFile, const GLSL::StringList *macros, bool verbose)
void initDualDepthPeeling()
Allocate framebuffers and load shaders for dual-depth-peeling.
static void setShaderDir(QString _dir)
static ShaderCache * getInstance()
Return instance of the ShaderCache singleton.
Collection of framebuffers for each viewport.
QString renderObjectsInfo(bool _outputShaderInfo)
Return a qstring of the current render objects.
int viewport_height() const
get viewport height
GLSL::Program * getProgram(const ShaderGenDesc *_desc, const std::vector< unsigned int > &_mods)
Query a dynamically generated program from cache.
void setUniform(const char *_name, GLint _value)
Set int uniform to specified value.
bool openGLVersion(const int _major, const int _minor, bool _verbose)
const VertexDeclaration * vertexDecl
Defines the vertex buffer layout, ignored if VAO is provided.
void modifyFragmentIO(ShaderGenerator *_shader)
Add your own inputs/outputs to the fragment shader.
void addUniform(QString _uniform, QString _comment="")
Add one GLSL uniform specifier.
ACG::Vec4f backgroundColor()
Get current background color.
static void blendFunc(GLenum _sfactor, GLenum _dfactor)
replaces glBlendFunc, supports locking
unsigned int height_
viewer window height
void bindFragDataLocation(unsigned int _index, const char *_name)
Bind fragment output data to name.
void modifyFragmentIO(ShaderGenerator *_shader)
Add your own inputs/outputs to the fragment shader.
static unsigned int registerModifier(ShaderModifier *_modifier)
Shader modifiers have to be registered before they can be used. They also must remain allocated for t...
int viewerId()
Get the id of the viewer this viewerproperties belongs to.
void modifyFragmentBeginCode(QStringList *_code)
Append code the the fragment shader.
void renderDualPeeling(ACG::GLState *_glState, Viewer::ViewerProperties &_properties)
peel the scene with dual depth peeling, two layers per pass
Interface class between scenegraph and renderer.
void link()
Links the shader objects to the program.
void addRenderObject(ACG::RenderObject *_renderObject)
overide addRenderObject function to include OIT check
void modifyFragmentEndCode(QStringList *_code)
Append code the the fragment shader.
const Vec4f & clear_color() const
get background color
void modifyFragmentEndCode(QStringList *_code)
Append code the the fragment shader.
void renderFrontPeeling(ACG::GLState *_glState, Viewer::ViewerProperties &_properties)
peel the scene from front to back, one layer per pass