Beispiel #1
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_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;
 }
        public static void CreateZTestMode(string zTestData, ref TemplateDepthData depthDataObj)
        {
            depthDataObj.DataCheck = TemplateDataCheck.Unreadable;
            MatchCollection matchColl = Regex.Matches(zTestData, ZTestPattern);

            if (matchColl.Count > 0)
            {
                if (matchColl[0].Groups.Count == 2)
                {
                    try
                    {
                        depthDataObj.ZTestModeValue = (ZTestMode)Enum.Parse(typeof(ZTestMode), matchColl[0].Groups[1].Value);
                        depthDataObj.DataCheck      = TemplateDataCheck.Valid;
                        depthDataObj.ValidZTest     = true;
                    }
                    catch
                    {
                        depthDataObj.DataCheck = TemplateDataCheck.Unreadable;
                    }
                }
            }
        }
        public void ConfigureFromTemplateData(TemplateDepthData depthData)
        {
            m_validZTest = depthData.ValidZTest;
            if (depthData.ValidZTest)
            {
                m_zTestMode = ZBufferOpHelper.ZTestModeDict[depthData.ZTestModeValue];
            }

            m_validZWrite = depthData.ValidZWrite;
            if (depthData.ValidZWrite)
            {
                m_zWriteMode = ZBufferOpHelper.ZWriteModeDict[depthData.ZWriteModeValue];
            }

            m_offsetEnabled = depthData.ValidOffset;
            m_validOffset   = depthData.ValidOffset;
            if (depthData.ValidOffset)
            {
                m_offsetFactor = depthData.OffsetFactor;
                m_offsetUnits  = depthData.OffsetUnits;
            }
        }
        public static void CreateZOffsetMode(string zOffsetData, ref TemplateDepthData depthDataObj)
        {
            depthDataObj.DataCheck = TemplateDataCheck.Unreadable;
            MatchCollection matchColl = Regex.Matches(zOffsetData, ZOffsetPattern);

            if (matchColl.Count > 0)
            {
                if (matchColl[0].Groups.Count == 3)
                {
                    try
                    {
                        depthDataObj.OffsetFactor = Convert.ToSingle(matchColl[0].Groups[1].Value);
                        depthDataObj.OffsetUnits  = Convert.ToSingle(matchColl[0].Groups[2].Value);
                        depthDataObj.ValidOffset  = true;
                        depthDataObj.DataCheck    = TemplateDataCheck.Valid;
                    }
                    catch
                    {
                        depthDataObj.DataCheck = TemplateDataCheck.Unreadable;
                    }
                }
            }
        }