[Solved]Ogre stencil doesn't work on Nexus5

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
fallout1018
Gnoblar
Posts: 9
Joined: Fri Nov 21, 2014 4:24 am

[Solved]Ogre stencil doesn't work on Nexus5

Post by fallout1018 »

Hi, All
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);
		}
Last edited by fallout1018 on Thu May 21, 2015 2:30 am, edited 1 time in total.
fallout1018
Gnoblar
Posts: 9
Joined: Fri Nov 21, 2014 4:24 am

Re: [Help]Ogre stencil doesn't work on Nexus5

Post by fallout1018 »

Hi All,
I had solved the problem. The reason is, on Nexus5, Ogre3D use the "minAttribs" witch does not config the EGL_STENCIL_SIZE for the glcontext. Thanks for your attetion . :D