Can not enable Stencil test in compositor?

Problems building or running the engine, queries about how to use features etc.
Post Reply
jy00849707
Gnoblar
Posts: 1
Joined: Thu Nov 18, 2010 2:58 am

Can not enable Stencil test in compositor?

Post by jy00849707 »

I always get following error in Ogre.log

Code: Select all

18:35:37: Compiler error: unknown error in CompoFuncTest.compositor(11): token "check" is not recognized
18:35:37: Compiler error: unknown error in CompoFuncTest.compositor(12): token "ref_value" is not recognized
18:35:37: Compiler error: unknown error in CompoFuncTest.compositor(13): token "comp_func" is not recognized
18:35:37: Compiler error: unknown error in CompoFuncTest.compositor(14): token "pass_op" is not recognized
here is my compositor for test.

Code: Select all

compositor Test/Stencil
{
	technique
	{
		
		
		target_output
		{
			pass stencil
			{
					check on
					ref_value 1.0
					comp_func always_pass
					pass_op replace
				
			}
			
			pass render_scene
			{
				
				first_render_queue 61
				last_render_queue 61

			}
		}
	}
}
Additionally, I found Ogre did not enter CompositionPassStencilTranslator::translate...
The following estimate always failed.

Code: Select all

			else if(obj->id == ID_STENCIL && parent && parent->id == ID_PASS)
				translator = &mCompositionPassStencilTranslator;
maxint
Gnoblar
Posts: 3
Joined: Thu Sep 10, 2009 5:57 am
Contact:

Re: Can not enable Stencil test in compositor?

Post by maxint »

I has just read manual, perphaps it should be wrote like this

Code: Select all

compositor Test/Stencil
{
   technique
   {     
      
      target_output
      {         
         pass render_scene
         {
            stencil
            {
               check on
               ref_value 1.0
               comp_func always_pass
               pass_op replace
            
            }
            first_render_queue 61
            last_render_queue 61

         }
      }
   }
cyrfer
Orc
Posts: 424
Joined: Wed Aug 01, 2007 8:13 pm
Location: Venice, CA, USA
x 7

Re: Can not enable Stencil test in compositor?

Post by cyrfer »

You probably needed something like this:

Code: Select all

       target scenebuffer
        {
            //material_scheme depth

            // this causes a clear to occur...
            //input previous

            //... prefer an explicit clear pass
			pass clear
			{
				clear
				{
					buffers colour depth stencil
					colour_value 0.0 0.0 0.0 1
					depth_value 1.0
					stencil_value 0.0
				}
			}

            pass stencil
            {
                stencil
                {
                    check on
                    comp_func always_pass
                    ref_value 0.0
                    //mask 4294967295
                    fail_op keep
                    depth_fail_op keep
                    pass_op increment
                    two_sided off
                }
            }

            pass render_scene
            {
            }
        }
Post Reply