Commit cb10c858 authored by Christopher Tenter's avatar Christopher Tenter
Browse files

removed unused code in depth peeling plugin refs #2027

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18247 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f1a764cf
...@@ -157,7 +157,7 @@ PeelDualInitModifier PeelDualInitModifier::instance; ...@@ -157,7 +157,7 @@ PeelDualInitModifier PeelDualInitModifier::instance;
DepthPeeling::DepthPeeling() DepthPeeling::DepthPeeling()
: peelMode_(1), copyFrontDepth_(1), maxPeelCount_(20), peelBlend_(0), peelFinal_(0), peelQueryID_(0), : peelMode_(1), copyFrontDepth_(1), maxPeelCount_(20), peelBlend_(0), peelFinal_(0), peelQueryID_(0),
peelBlendDual_(0), peelFinalDual_(0), depthCopy_(0) peelBlendDual_(0), peelFinalDual_(0)
{ {
} }
...@@ -965,7 +965,7 @@ void DepthPeeling::ViewerResources::resize(bool _dualPeeling, unsigned int _widt ...@@ -965,7 +965,7 @@ void DepthPeeling::ViewerResources::resize(bool _dualPeeling, unsigned int _widt
void DepthPeeling::initDepthPeeling() void DepthPeeling::initDepthPeeling()
{ {
// check if already initialized // check if already initialized
if (peelBlend_ && peelFinal_ && peelQueryID_ && depthCopy_) if (peelBlend_ && peelFinal_ && peelQueryID_)
return; return;
// register shader modifiers // register shader modifiers
...@@ -983,16 +983,13 @@ void DepthPeeling::initDepthPeeling() ...@@ -983,16 +983,13 @@ void DepthPeeling::initDepthPeeling()
if (!peelQueryID_) if (!peelQueryID_)
glGenQueries(1, &peelQueryID_); glGenQueries(1, &peelQueryID_);
if (!depthCopy_)
depthCopy_ = GLSL::loadProgram("DepthPeeling/screenquad.glsl", "DepthPeeling/depth_copy.glsl");
ACG::glCheckErrors(); ACG::glCheckErrors();
} }
void DepthPeeling::initDualDepthPeeling() void DepthPeeling::initDualDepthPeeling()
{ {
// check if already initialized // check if already initialized
if (peelBlendDual_ && peelFinalDual_ && peelQueryID_ && depthCopy_) if (peelBlendDual_ && peelFinalDual_ && peelQueryID_)
return; return;
// register shader modifiers // register shader modifiers
...@@ -1010,37 +1007,9 @@ void DepthPeeling::initDualDepthPeeling() ...@@ -1010,37 +1007,9 @@ void DepthPeeling::initDualDepthPeeling()
if (!peelQueryID_) if (!peelQueryID_)
glGenQueries(1, &peelQueryID_); glGenQueries(1, &peelQueryID_);
if (!depthCopy_)
depthCopy_ = GLSL::loadProgram("DepthPeeling/screenquad.glsl", "DepthPeeling/depth_copy.glsl");
ACG::glCheckErrors(); ACG::glCheckErrors();
} }
void DepthPeeling::copyDepthsToInput( GLuint _depthTex, float _sign )
{
restoreInputFbo();
depthCopy_->use();
depthCopy_->setUniform("DepthTex", 0);
depthCopy_->setUniform("DepthSign", _sign);
// write to depth buffer only
glColorMask(0,0,0,0);
glDepthMask(1);
// depth test enabled + pass always
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_ALWAYS);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, _depthTex);
ACG::ScreenQuad::draw(depthCopy_);
glBindTexture(GL_TEXTURE_2D, 0);
}
// //
// void DepthPeeling::dbgDrawTex( GLuint _texID ) // void DepthPeeling::dbgDrawTex( GLuint _texID )
......
...@@ -108,9 +108,6 @@ private: ...@@ -108,9 +108,6 @@ private:
/// peel the scene with dual depth peeling, two layers per pass /// peel the scene with dual depth peeling, two layers per pass
void renderDualPeeling(ACG::GLState* _glState, Viewer::ViewerProperties& _properties); void renderDualPeeling(ACG::GLState* _glState, Viewer::ViewerProperties& _properties);
/// copies a texture containing depth values to the back buffer depth channel
void copyDepthsToInput(GLuint _depthTex, float _sign = 1.0f);
/// mode: 0 -> front to back peeling, 1 -> dual peeling /// mode: 0 -> front to back peeling, 1 -> dual peeling
int peelMode_; int peelMode_;
...@@ -134,10 +131,6 @@ private: ...@@ -134,10 +131,6 @@ private:
GLSL::Program* peelFinalDual_; GLSL::Program* peelFinalDual_;
/// shader copies depth of the first front layer to the back buffer
GLSL::Program* depthCopy_;
/// Collection of framebuffers for each viewport /// Collection of framebuffers for each viewport
struct ViewerResources struct ViewerResources
{ {
......
Supports Markdown
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