本文整理汇总了C++中FrameBufferObject::deactivate方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameBufferObject::deactivate方法的具体用法?C++ FrameBufferObject::deactivate怎么用?C++ FrameBufferObject::deactivate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameBufferObject
的用法示例。
在下文中一共展示了FrameBufferObject::deactivate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: postProcess
void DepthPeelingStage::postProcess(DrawEnv *pEnv, bool isPing)
{
Window *win = pEnv->getWindow();
if(win->hasExtOrVersion(_uiFramebufferObjectExt, 0x0300, 0x0200) == false)
{
FNOTICE(("Framebuffer objects not supported on Window %p!\n", win));
return;
}
DepthPeelingStageData *pData =
pEnv->getData<DepthPeelingStageData *>(_iDataSlotId);
if(!pData)
return;
FrameBufferObject *pBlendFBO = pData->getBlendFBO();
pBlendFBO->activate(pEnv);
ChunkMaterial *pMaterial;
if (isPing)
pMaterial = pData->getPeelPingMaterial();
else
pMaterial = pData->getPeelPongMaterial();
pEnv->activateState(pMaterial->getState(), NULL);
drawQuad();
pEnv->deactivateState();
pBlendFBO->deactivate(pEnv);
}
示例2: postProcess
void HDRStage::postProcess(DrawEnv *pEnv)
{
Window *win = pEnv->getWindow();
if(win->hasExtension(_uiFramebuffer_object_extension) == false)
{
FNOTICE(("Framebuffer objects not supported on Window %p!\n", win));
return;
}
GLDrawBuffersEXTProcT glDrawBuffersEXTProc =
reinterpret_cast<GLDrawBuffersEXTProcT>(
win->getFunction(_uiFuncDrawBuffers));
glColor3f(1.f, 1.f, 1.f);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
HDRStageData *pData = pEnv->getData<HDRStageData *>(_iDataSlotId);
if(pData == NULL)
{
return;
}
if((pData->getWidth () != pEnv->getPixelWidth() ) ||
(pData->getHeight() != pEnv->getPixelHeight()) )
{
resizeStageData(pData,
pEnv->getPixelWidth(),
pEnv->getPixelHeight());
}
// Shrink to w/2 h/2
FrameBufferObject *pShrinkTarget = pData->getShrinkRenderTarget();
ChunkMaterial *pSHM = pData->getShrinkMaterial();
pShrinkTarget->activate(pEnv);
glViewport(0,
0,
pEnv->getPixelWidth () / 2,
pEnv->getPixelHeight() / 2);
State *pShrinkState = pSHM->getState();
pEnv->activateState(pShrinkState, NULL);
glBegin(GL_QUADS);
{
glTexCoord2f(0.00, 0.00);
glVertex2f (0.00, 0.00);
glTexCoord2f(1.00, 0.00);
glVertex2f (1.00, 0.00);
glTexCoord2f(1.00, 1.00);
glVertex2f (1.00, 1.00);
glTexCoord2f(0.00, 1.00);
glVertex2f (0.00, 1.00);
}
glEnd();
pShrinkTarget->deactivate(pEnv);
// Shrink to w/4 h/4
FrameBufferObject *pBlurTarget = pData->getBlurRenderTarget();
pBlurTarget->editMFDrawBuffers()->clear();
pBlurTarget->editMFDrawBuffers()->push_back(GL_COLOR_ATTACHMENT0_EXT);
pBlurTarget->activate(pEnv);
glViewport(0,
0,
pEnv->getPixelWidth () / 4,
pEnv->getPixelHeight() / 4);
ChunkMaterial *pBLM = pData->getBlurMaterial();
State *pBlurState = pBLM->getState();
pEnv->activateState(pBlurState, NULL);
glBegin(GL_QUADS);
{
glTexCoord2f(0.00, 0.00);
glVertex2f (0.00, 0.00);
//.........这里部分代码省略.........
示例3: postProcess
void HDRStage::postProcess(DrawEnv *pEnv)
{
UInt32 uiActiveFBO = pEnv->getActiveFBO();
Window *win = pEnv->getWindow();
if(win->hasExtOrVersion(_uiFramebufferObjectExt, 0x0300, 0x0200) == false)
{
FNOTICE(("Framebuffer objects not supported on Window %p!\n",
static_cast<void *>(win)));
return;
}
OSGGETGLFUNCBYID_GL3( glDrawBuffers,
osgGlDrawBuffers,
_uiFuncDrawBuffers,
win);
glColor3f(1.f, 1.f, 1.f);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
HDRStageData *pData = pEnv->getData<HDRStageData *>(_iDataSlotId);
if(pData == NULL)
{
return;
}
// Shrink to w/2 h/2
FrameBufferObject *pShrinkTarget = pData->getShrinkRenderTarget();
ChunkMaterial *pSHM = pData->getShrinkMaterial();
pShrinkTarget->activate(pEnv);
glViewport(0,
0,
pEnv->getPixelWidth () / 2,
pEnv->getPixelHeight() / 2);
State *pShrinkState = pSHM->getState();
pEnv->activateState(pShrinkState, NULL);
this->renderQuad();
pShrinkTarget->deactivate(pEnv);
// Shrink to w/4 h/4
FrameBufferObject *pBlurTarget = pData->getBlurRenderTarget();
pBlurTarget->editMFDrawBuffers()->clear();
pBlurTarget->editMFDrawBuffers()->push_back(GL_COLOR_ATTACHMENT0_EXT);
pBlurTarget->activate(pEnv);
glViewport(0,
0,
pEnv->getPixelWidth () / 4,
pEnv->getPixelHeight() / 4);
ChunkMaterial *pBLM = pData->getBlurMaterial();
State *pBlurState = pBLM->getState();
pEnv->activateState(pBlurState, NULL);
this->renderQuad();
GLenum aDrawBuffers[] = { GL_COLOR_ATTACHMENT0_EXT };
// HBlur
pBlurTarget->activate(pEnv);
glViewport(0,
0,
pEnv->getPixelWidth () / 4,
pEnv->getPixelHeight() / 4);
#define OVERSHADER 1
#if OVERSHADER
//.........这里部分代码省略.........