当前位置: 首页>>代码示例>>C++>>正文


C++ ofFbo::getDepthTexture方法代码示例

本文整理汇总了C++中ofFbo::getDepthTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ ofFbo::getDepthTexture方法的具体用法?C++ ofFbo::getDepthTexture怎么用?C++ ofFbo::getDepthTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ofFbo的用法示例。


在下文中一共展示了ofFbo::getDepthTexture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: draw

        void draw(){
            wc.begin();
            if(!switchVideo){
                wc.setUniformTexture("colorMap", img.getTexture(),  1);
                wc.setUniformTexture("heightMap",gray.getTexture(), 2);
            }
            else{
                wc.setUniformTexture("colorMap", player.getTexture(), 1);
                fboDepth.begin();
                player.draw(0,0);
                fboDepth.end();
                wc.setUniformTexture("heightMap",fboDepth.getDepthTexture(),2);
            }
            wc.setUniform1f("time", ofGetElapsedTimef()*time);
            wc.setUniform1f("gradientStep", stepGradient);
            wc.setUniform1f("advectStep",   advectStep);
            wc.setUniform1f("flipHeightMap",flipHeightMap);
            wc.setUniform4f("advectMatrix",advectMatrix->w,advectMatrix->x,advectMatrix->y,advectMatrix->z);

            fbo.draw(0,0);

            wc.end();
            img.draw(0,0,img.getWidth()/4,img.getHeight()/4);
            player.draw(img.getWidth()/4,0,img.getWidth()/4,img.getHeight()/4);
            gui.draw();
        }
开发者ID:ReallyRad,项目名称:WaterColor,代码行数:26,代码来源:main.cpp

示例2: process

 // need to have depth enabled for some fx
 void PostProcessing::process(ofFbo& raw)
 {
     numPasses = 0;
     for (int i = 0; i < passes.size(); ++i)
     {
         if (passes[i]->getEnabled())
         {
             if (numPasses == 0) passes[i]->render(raw, pingPong[1 - currentReadFbo], raw.getDepthTexture());
             else passes[i]->render(pingPong[currentReadFbo], pingPong[1 - currentReadFbo], raw.getDepthTexture());
             currentReadFbo = 1 - currentReadFbo;
             numPasses++;
         }
     }
 }
开发者ID:imclab,项目名称:ofxPostProcessing,代码行数:15,代码来源:PostProcessing.cpp

示例3: process

 // need to have depth enabled for some fx
 void PostProcessing::process(ofFbo& raw, bool hasDepthAsTexture)
 {
     numProcessedPasses = 0;
     for (int i = 0; i < passes.size(); ++i)
     {
         if (passes[i]->getEnabled())
         {
             if (arb && !passes[i]->hasArbShader()) ofLogError() << "Arb mode is enabled but pass " << passes[i]->getName() << " does not have an arb shader.";
             else
             {
                 if (hasDepthAsTexture)
                 {
                     if (numProcessedPasses == 0) passes[i]->render(raw, pingPong[1 - currentReadFbo], raw.getDepthTexture());
                     else passes[i]->render(pingPong[currentReadFbo], pingPong[1 - currentReadFbo], raw.getDepthTexture());
                 }
                 else
                 {
                     if (numProcessedPasses == 0) passes[i]->render(raw, pingPong[1 - currentReadFbo]);
                     else passes[i]->render(pingPong[currentReadFbo], pingPong[1 - currentReadFbo]);
                 }
                 currentReadFbo = 1 - currentReadFbo;
                 numProcessedPasses++;
             }
         }
     }
 }
开发者ID:satcy,项目名称:ofxPostProcessing,代码行数:27,代码来源:PostProcessing.cpp


注:本文中的ofFbo::getDepthTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。