Skip to content

Instantly share code, notes, and snippets.

@lukaspj
Last active August 29, 2015 14:09
Show Gist options
  • Save lukaspj/af869d011458bc061c4e to your computer and use it in GitHub Desktop.
Save lukaspj/af869d011458bc061c4e to your computer and use it in GitHub Desktop.
while ( mat->setupPass( state, sgData ) )
{
if (alternateCache) {
activeTarget->attachTexture(GFXTextureTarget::RenderSlot::Color1, opacityCache2);
if (mat->isCurrentPassValid() && mat->getCurrentPass().opacityMapConst->isValid())
GFX->setTexture(mat->getCurrentPass().opacityMapConst->getSamplerRegister(), opacityCache1);
}
else {
activeTarget->attachTexture(GFXTextureTarget::RenderSlot::Color1, opacityCache1);
if (mat->isCurrentPassValid() && mat->getCurrentPass().opacityMapConst->isValid())
GFX->setTexture(mat->getCurrentPass().opacityMapConst->getSamplerRegister(), opacityCache2);
}
alternateCache = !alternateCache;
++smDrawCalls;
GFX->drawPrimitive( (*inst)->prim );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment