I just wrote an Ogre3D demo, in witch I create a RenderQueueListener to implement the stencil effect(the main code is below). I found the codes works well on Sumsung glaxy 4(I9500),but it cannot work on Nexus 5.
Any suggestion or would u please tell me why did this happen .
Code: Select all
Ogre::RenderSystem * rendersys = Ogre::Root::getSingleton().getRenderSystem();
if (queueGroupId == DRAW_STENCIL_SHAPE)
{
maskMaterial->getTechnique(0)->getPass(0)->setColourWriteEnabled(false);
rendersys->clearFrameBuffer(Ogre::FBT_STENCIL);
rendersys->setStencilCheckEnabled(true);
rendersys->setStencilBufferParams(Ogre::CMPF_ALWAYS_PASS,1, 0xFFFFFFFF, 0xFFFFFFFF,Ogre::SOP_KEEP,Ogre::SOP_KEEP,Ogre::SOP_REPLACE,false);
}
if (queueGroupId == USE_STENCIL_SHAPE)
{
rendersys->setStencilCheckEnabled(true);
rendersys->setStencilBufferParams(Ogre::CMPF_NOT_EQUAL,1, 0xFFFFFFFF, 0xFFFFFFFF,Ogre::SOP_KEEP,Ogre::SOP_KEEP,Ogre::SOP_KEEP,false);
}