コード例 #1
0
 public void Destroy()
 {
     m_blendData       = null;
     m_blendData1      = null;
     m_blendData2      = null;
     m_blendData3      = null;
     m_alphaToMaskData = null;
     m_cullModeData    = null;
     m_colorMaskData   = null;
     m_colorMaskData1  = null;
     m_colorMaskData2  = null;
     m_colorMaskData3  = null;
     m_stencilData     = null;
     m_depthData       = null;
     m_tagData.Destroy();
     m_tagData         = null;
     m_globalsTag      = null;
     m_srpBatcherTag   = null;
     m_allModulesTag   = null;
     m_functionsTag    = null;
     m_pragmaTag       = null;
     m_pragmaBeforeTag = null;
     m_passTag         = null;
     m_inputsVertTag   = null;
     m_inputsFragTag   = null;
     m_includePragmaContainer.Destroy();
     m_includePragmaContainer = null;
 }
コード例 #2
0
ファイル: TemplatePass.cs プロジェクト: InVale/AmongTheWave
 public void Destroy()
 {
     m_blendData     = null;
     m_cullModeData  = null;
     m_colorMaskData = null;
     m_stencilData   = null;
     m_depthData     = null;
     m_tagData.Destroy();
     m_tagData       = null;
     m_globalsTag    = null;
     m_functionsTag  = null;
     m_pragmaTag     = null;
     m_passTag       = null;
     m_inputsVertTag = null;
     m_inputsFragTag = null;
 }
コード例 #3
0
		public void Destroy()
		{
			m_blendData = null:
			m_cullModeData = null:
			m_colorMaskData = null:
			m_stencilData = null:
			m_depthData = null:
			m_tagData.Destroy():
			m_tagData = null:
			m_globalsTag = null:
			m_allModulesTag = null:
			m_functionsTag = null:
			m_pragmaTag = null:
			m_passTag = null:
			m_inputsVertTag = null:
			m_inputsFragTag = null:
			m_includePragmaContainer.Destroy():
			m_includePragmaContainer = null:
		}
コード例 #4
0
		public override void Destroy()
		{
			if( m_vertexDataContainer != null )
			{
				m_vertexDataContainer.Destroy():
				m_vertexDataContainer = null:
			}

			if( m_interpolatorDataContainer != null )
			{
				m_interpolatorDataContainer.Destroy():
				m_interpolatorDataContainer = null:
			}

			if( m_availableShaderProperties != null )
			{
				m_availableShaderProperties.Clear():
				m_availableShaderProperties = null:
			}

			if( m_propertyDict != null )
			{
				m_propertyDict.Clear():
				m_propertyDict = null:
			}

			if( m_propertyList != null )
			{
				m_propertyList.Clear():
				m_propertyList = null:
			}

			if( m_inputDataDict != null )
			{
				m_inputDataDict.Clear():
				m_inputDataDict = null:
			}

			if( m_inputDataList != null )
			{
				m_inputDataList.Clear():
				m_inputDataList = null:
			}

			if( m_localVarsList != null )
			{
				m_localVarsList.Clear():
				m_localVarsList = null:
			}
			//if( m_snippetElementsDict != null )
			//{
			//	m_snippetElementsDict.Clear():
			//	m_snippetElementsDict = null:
			//}

			//if( m_snippetElementsList != null )
			//{
			//	for( int i = 0: i < m_snippetElementsList.Count: i++ )
			//	{
			//		GameObject.DestroyImmediate( m_snippetElementsList[ i ] ):
			//		m_snippetElementsList[ i ] = null:
			//	}
			//	m_snippetElementsList.Clear():
			//	m_snippetElementsList = null:
			//}

			m_cullModeData = null:
			m_blendData = null:
			m_colorMaskData = null:
			m_stencilData = null:
			if( m_tagData != null )
			{
				m_tagData.Destroy():
				m_tagData = null:
			}
		}
コード例 #5
0
        public void ConfigureFromTemplateData(TemplateStencilData stencilData)
        {
            m_reference = stencilData.Reference;
            m_readMask  = stencilData.ReadMask;
            m_writeMask = stencilData.WriteMask;

            if (!string.IsNullOrEmpty(stencilData.ComparisonFront))
            {
                m_comparisonFunctionIdx = m_comparisonDict[stencilData.ComparisonFront];
            }
            else
            {
                m_comparisonFunctionIdx = m_comparisonDict["Always"];
            }

            if (!string.IsNullOrEmpty(stencilData.PassFront))
            {
                m_passStencilOpIdx = m_stencilOpsDict[stencilData.PassFront];
            }
            else
            {
                m_passStencilOpIdx = m_stencilOpsDict["Keep"];
            }

            if (!string.IsNullOrEmpty(stencilData.FailFront))
            {
                m_failStencilOpIdx = m_stencilOpsDict[stencilData.FailFront];
            }
            else
            {
                m_failStencilOpIdx = m_stencilOpsDict["Keep"];
            }

            if (!string.IsNullOrEmpty(stencilData.ZFailFront))
            {
                m_zFailStencilOpIdx = m_stencilOpsDict[stencilData.ZFailFront];
            }
            else
            {
                m_zFailStencilOpIdx = m_stencilOpsDict["Keep"];
            }

            if (!string.IsNullOrEmpty(stencilData.ComparisonBack))
            {
                m_comparisonFunctionBackIdx = m_comparisonDict[stencilData.ComparisonBack];
            }
            else
            {
                m_comparisonFunctionBackIdx = m_comparisonDict["Always"];
            }

            if (!string.IsNullOrEmpty(stencilData.PassBack))
            {
                m_passStencilOpBackIdx = m_stencilOpsDict[stencilData.PassBack];
            }
            else
            {
                m_passStencilOpBackIdx = m_stencilOpsDict["Keep"];
            }

            if (!string.IsNullOrEmpty(stencilData.FailBack))
            {
                m_failStencilOpBackIdx = m_stencilOpsDict[stencilData.FailBack];
            }
            else
            {
                m_failStencilOpBackIdx = m_stencilOpsDict["Keep"];
            }

            if (!string.IsNullOrEmpty(stencilData.ZFailBack))
            {
                m_zFailStencilOpBackIdx = m_stencilOpsDict[stencilData.ZFailBack];
            }
            else
            {
                m_zFailStencilOpBackIdx = m_stencilOpsDict["Keep"];
            }
        }
コード例 #6
0
        public static void CreateStencilOps(string stencilData, ref TemplateStencilData stencilDataObj)
        {
            stencilDataObj.DataCheck = TemplateDataCheck.Unreadable;
            MatchCollection overallGlobalMatch = Regex.Matches(stencilData, StencilOpGlobalPattern);

            if (overallGlobalMatch.Count == 1 && overallGlobalMatch[0].Groups.Count == 2)
            {
                string value = overallGlobalMatch[0].Groups[1].Value;
                foreach (Match match in Regex.Matches(value, StencilOpLinePattern))
                {
                    stencilDataObj.DataCheck = TemplateDataCheck.Valid;
                    if (match.Groups.Count == 3)
                    {
                        switch (match.Groups[1].Value)
                        {
                        default:
                        {
                            stencilDataObj.DataCheck = TemplateDataCheck.Unreadable;
                            return;
                        }

                        case "Ref":
                        {
                            try
                            {
                                stencilDataObj.Reference = Convert.ToInt32(match.Groups[2].Value);
                            }
                            catch (Exception e)
                            {
                                Debug.LogException(e);
                                stencilDataObj.DataCheck = TemplateDataCheck.Unreadable;
                                return;
                            }
                        }
                        break;

                        case "ReadMask":
                        {
                            try
                            {
                                stencilDataObj.ReadMask = Convert.ToInt32(match.Groups[2].Value);
                            }
                            catch (Exception e)
                            {
                                Debug.LogException(e);
                                stencilDataObj.DataCheck = TemplateDataCheck.Unreadable;
                                return;
                            }
                        }
                        break;

                        case "WriteMask":
                        {
                            try
                            {
                                stencilDataObj.WriteMask = Convert.ToInt32(match.Groups[2].Value);
                            }
                            catch (Exception e)
                            {
                                Debug.LogException(e);
                                stencilDataObj.DataCheck = TemplateDataCheck.Unreadable;
                                return;
                            }
                        }
                        break;

                        case "CompFront":
                        case "Comp":
                        {
                            stencilDataObj.ComparisonFront = match.Groups[2].Value;
                        }
                        break;

                        case "PassFront":
                        case "Pass":
                        {
                            stencilDataObj.PassFront = match.Groups[2].Value;
                        }
                        break;

                        case "FailFront":
                        case "Fail":
                        {
                            stencilDataObj.FailFront = match.Groups[2].Value;
                        }
                        break;

                        case "ZFail":
                        case "ZFailFront":
                        {
                            stencilDataObj.ZFailFront = match.Groups[2].Value;
                        }
                        break;

                        case "CompBack":
                        {
                            stencilDataObj.ComparisonBack = match.Groups[2].Value;
                        }
                        break;

                        case "PassBack":
                        {
                            stencilDataObj.PassBack = match.Groups[2].Value;
                        }
                        break;

                        case "FailBack":
                        {
                            stencilDataObj.ZFailBack = match.Groups[2].Value;
                        }
                        break;

                        case "ZFailBack":
                        {
                            stencilDataObj.ZFailBack = match.Groups[2].Value;
                        }
                        break;
                        }
                    }
                }
            }
        }
コード例 #7
0
        public void ConfigureFromTemplateData(TemplateStencilData stencilData)
        {
            bool newValidData = (stencilData.DataCheck == TemplateDataCheck.Valid);

            if (newValidData && m_validData != newValidData)
            {
                m_reference = stencilData.Reference;
                m_readMask  = stencilData.ReadMask;
                m_writeMask = stencilData.WriteMask;

                if (!string.IsNullOrEmpty(stencilData.ComparisonFront))
                {
                    m_comparisonFunctionIdx = m_comparisonDict[stencilData.ComparisonFront.ToLower()];
                }
                else
                {
                    m_comparisonFunctionIdx = m_comparisonDict["always"];
                }

                if (!string.IsNullOrEmpty(stencilData.PassFront))
                {
                    m_passStencilOpIdx = m_stencilOpsDict[stencilData.PassFront.ToLower()];
                }
                else
                {
                    m_passStencilOpIdx = m_stencilOpsDict["keep"];
                }

                if (!string.IsNullOrEmpty(stencilData.FailFront))
                {
                    m_failStencilOpIdx = m_stencilOpsDict[stencilData.FailFront.ToLower()];
                }
                else
                {
                    m_failStencilOpIdx = m_stencilOpsDict["keep"];
                }

                if (!string.IsNullOrEmpty(stencilData.ZFailFront))
                {
                    m_zFailStencilOpIdx = m_stencilOpsDict[stencilData.ZFailFront.ToLower()];
                }
                else
                {
                    m_zFailStencilOpIdx = m_stencilOpsDict["keep"];
                }

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

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

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

                if (!string.IsNullOrEmpty(stencilData.ZFailBack))
                {
                    m_zFailStencilOpBackIdx = m_stencilOpsDict[stencilData.ZFailBack.ToLower()];
                }
                else
                {
                    m_zFailStencilOpBackIdx = m_stencilOpsDict["keep"];
                }
            }
            m_validData = newValidData;
        }
コード例 #8
0
        public void Destroy()
        {
            if (m_vertexData != null)
            {
                m_vertexData.Clear();
                m_vertexData = null;
            }

            if (m_interpolatorData != null)
            {
                m_interpolatorData.Destroy();
                m_interpolatorData = null;
            }

            if (m_availableShaderProperties != null)
            {
                m_availableShaderProperties.Clear();
                m_availableShaderProperties = null;
            }

            if (m_propertyDict != null)
            {
                m_propertyDict.Clear();
                m_propertyDict = null;
            }

            if (m_propertyList != null)
            {
                m_propertyList.Clear();
                m_propertyList = null;
            }

            if (m_inputDataDict != null)
            {
                m_inputDataDict.Clear();
                m_inputDataDict = null;
            }

            if (m_inputDataList != null)
            {
                m_inputDataList.Clear();
                m_inputDataList = null;
            }

            if (m_snippetElementsDict != null)
            {
                m_snippetElementsDict.Clear();
                m_snippetElementsDict = null;
            }

            if (m_snippetElementsList != null)
            {
                for (int i = 0; i < m_snippetElementsList.Count; i++)
                {
                    GameObject.DestroyImmediate(m_snippetElementsList[i]);
                    m_snippetElementsList[i] = null;
                }
                m_snippetElementsList.Clear();
                m_snippetElementsList = null;
            }
            m_cullModeData  = null;
            m_blendData     = null;
            m_colorMaskData = null;
            m_stencilData   = null;
        }
コード例 #9
0
        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"];
                    }
                    m_failStencilOpBackIdx.ResetProperty();
                }
                else
                {
                    m_failStencilOpBackIdx.SetInlineByName(stencilData.FailBackInline);
                }


                if (string.IsNullOrEmpty(stencilData.ZFailBackInline))
                {
                    if (!string.IsNullOrEmpty(stencilData.ZFailBack))
                    {
                        m_zFailStencilOpBackIdx.IntValue = m_stencilOpsDict[stencilData.ZFailBack.ToLower()];
                    }
                    else
                    {
                        m_zFailStencilOpBackIdx.IntValue = m_stencilOpsDict["keep"];
                    }
                    m_zFailStencilOpBackIdx.ResetProperty();
                }
                else
                {
                    m_zFailStencilOpBackIdx.SetInlineByName(stencilData.ZFailBackInline);
                }
            }
            m_validData = newValidData;
        }