 Op 
        private const int FailStencilOpDefaultValue = 0;

        [SerializeField]
        private InlineProperty m_failStencilOpFrontIdx = new InlineProperty( FailStencilOpDefaultValue );

        [SerializeField]
        private InlineProperty m_failStencilOpBackIdx = new InlineProperty( FailStencilOpDefaultValue );

        //ZFail Stencil Op
        private const int ZFailStencilOpDefaultValue = 0;
        [SerializeField]
        private InlineProperty m_zFailStencilOpFrontIdx = new InlineProperty( ZFailStencilOpDefaultValue );

        [SerializeField]
        private InlineProperty m_zFailStencilOpBackIdx = new InlineProperty( ZFailStencilOpDefaultValue );

        public TemplatesStencilBufferModule() : base("Stencil Buffer")
        {
            for( int i = 0; i < StencilBufferOpHelper.StencilComparisonValues.Length; i++ )
            {
                m_comparisonDict.Add( StencilBufferOpHelper.StencilComparisonValues[ i ].ToLower(), i );
            }

            for( int i = 0; i < StencilBufferOpHelper.StencilOpsValues.Length; i++ )
            {
                m_stencilOpsDict.Add( StencilBufferOpHelper.StencilOpsValues[ i ].ToLower(), i );
            }
        }

		public void CopyFrom( TemplatesStencilBufferModule other, bool allData )
		{
			if( allData )
				m_independentModule = other.IndependentModule;

			m_active = other.Active;
			m_reference.CopyFrom( other.Reference );
			m_readMask.CopyFrom( other.ReadMask );
			m_writeMask.CopyFrom( other.WriteMask );
			m_comparisonFunctionFrontIdx.CopyFrom( other.ComparisonFunctionIdx );
			m_comparisonFunctionBackIdx.CopyFrom( other.ComparisonFunctionBackIdx );
			m_passStencilOpFrontIdx.CopyFrom( other.PassStencilOpIdx );
			m_passStencilOpBackIdx.CopyFrom( other.PassStencilOpBackIdx );
			m_failStencilOpFrontIdx.CopyFrom( other.FailStencilOpIdx );
			m_failStencilOpBackIdx.CopyFrom( other.FailStencilOpBackIdx );
			m_zFailStencilOpFrontIdx.CopyFrom( other.ZFailStencilOpIdx );
			m_zFailStencilOpBackIdx.CopyFrom( other.ZFailStencilOpBackIdx );
		}

        public void ConfigureFromTemplateData( TemplateStencilData stencilData )
        {
			bool newValidData = ( stencilData.DataCheck == TemplateDataCheck.Valid );
			if( newValidData && m_validData!= newValidData )
			{
				m_active = stencilData.Active;
				m_independentModule = stencilData.IndependentModule;
				if( string.IsNullOrEmpty( stencilData.ReferenceInline ) )
				{
					m_reference.IntValue = stencilData.Reference;
					m_reference.ResetProperty();
				}
				else
				{
					m_reference.SetInlineByName( stencilData.ReferenceInline );
				}

				if( string.IsNullOrEmpty( stencilData.ReadMaskInline ) )
				{
					m_readMask.IntValue = stencilData.ReadMask;
					m_readMask.ResetProperty();
				}
				else
				{
					m_readMask.SetInlineByName( stencilData.ReadMaskInline );
				}

				if( string.IsNullOrEmpty( stencilData.WriteMaskInline ) )
				{
					m_writeMask.IntValue = stencilData.WriteMask;
					m_writeMask.ResetProperty();
				}
				else
				{
					m_writeMask.SetInlineByName( stencilData.WriteMaskInline );
				}

				if( string.IsNullOrEmpty( stencilData.ComparisonFrontInline ) )
				{
					if(!string.IsNullOrEmpty( stencilData.ComparisonFront ) )
					{
						m_comparisonFunctionFrontIdx.IntValue = m_comparisonDict[ stencilData.ComparisonFront.ToLower() ];
					}
					else
					{
						m_comparisonFunctionFrontIdx.IntValue = m_comparisonDict[ "always" ];
					}
					m_comparisonFunctionFrontIdx.ResetProperty();
				}
				else
				{
					m_comparisonFunctionFrontIdx.SetInlineByName( stencilData.ComparisonFrontInline );
				}

				if( string.IsNullOrEmpty( stencilData.PassFrontInline ) )
				{
					if(!string.IsNullOrEmpty( stencilData.PassFront ) )
					{
						m_passStencilOpFrontIdx.IntValue = m_stencilOpsDict[ stencilData.PassFront.ToLower() ];
					}
					else
					{
						m_passStencilOpFrontIdx.IntValue = m_stencilOpsDict[ "keep" ];
					}
					m_passStencilOpFrontIdx.ResetProperty();
				}
				else
				{
					m_passStencilOpFrontIdx.SetInlineByName( stencilData.PassFrontInline ); 
				}

				if( string.IsNullOrEmpty( stencilData.FailFrontInline ) )
				{
					if(!string.IsNullOrEmpty( stencilData.FailFront ) )
					{
						m_failStencilOpFrontIdx.IntValue = m_stencilOpsDict[ stencilData.FailFront.ToLower() ];
					}
					else
					{
						m_failStencilOpFrontIdx.IntValue = m_stencilOpsDict[ "keep" ];
					}
					m_failStencilOpFrontIdx.ResetProperty();
				}
				else
				{
					m_failStencilOpFrontIdx.SetInlineByName( stencilData.FailFrontInline );
				}

				if( string.IsNullOrEmpty( stencilData.ZFailFrontInline ) )
				{
					if(!string.IsNullOrEmpty( stencilData.ZFailFront ) )
					{
						m_zFailStencilOpFrontIdx.IntValue = m_stencilOpsDict[ stencilData.ZFailFront.ToLower() ];
					}
					else
					{
						m_zFailStencilOpFrontIdx.IntValue = m_stencilOpsDict[ "keep" ];
					}
					m_zFailStencilOpFrontIdx.ResetProperty();
				}
				else
				{
					m_zFailStencilOpFrontIdx.SetInlineByName( stencilData.ZFailFrontInline );
				}

				if( string.IsNullOrEmpty( stencilData.ComparisonBackInline ) )
				{
					if(!string.IsNullOrEmpty( stencilData.ComparisonBack ) )
					{
						m_comparisonFunctionBackIdx.IntValue = m_comparisonDict[ stencilData.ComparisonBack.ToLower() ];
					}
					else
					{
						m_comparisonFunctionBackIdx.IntValue = m_comparisonDict[ "always" ];
					}
					m_comparisonFunctionBackIdx.ResetProperty();
				}
				else
				{
					m_comparisonFunctionBackIdx.SetInlineByName( stencilData.ComparisonBackInline );
				}

				if( string.IsNullOrEmpty( stencilData.PassBackInline ) )
				{

					if(!string.IsNullOrEmpty( stencilData.PassBack ) )
					{
						m_passStencilOpBackIdx.IntValue = m_stencilOpsDict[ stencilData.PassBack.ToLower() ];
					}
					else
					{
						m_passStencilOpBackIdx.IntValue = m_stencilOpsDict[ "keep" ];
					}
					m_passStencilOpBackIdx.ResetProperty();
				}
				else
				{
					m_passStencilOpBackIdx.SetInlineByName( stencilData.PassBackInline );
				}

				if( string.IsNullOrEmpty( stencilData.FailBackInline ) )
				{
					if(!string.IsNullOrEmpty( stencilData.FailBack ) )
					{
						m_failStencilOpBackIdx.IntValue = m_stencilOpsDict[ stencilData.FailBack.ToLower() ];
					}
					else
					{
						m_failStencilOpBackIdx.IntValue = m_stencilOpsDict[ "keep" ];
					}