本文整理汇总了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();
}
示例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++;
}
}
}
示例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++;
}
}
}
}