コード例 #1
0
        private void UpdateMacroArray()
        {
            ShaderMacros.ClearDefines();
            ShaderMacros.SetExtraInclude(CShaderDefinitions.EExtraIncludeType.Material, MtlShaderPatch.GetShaderIncludes());
            if (MdfQueueShaderPatch.GetShaderIncludes() != null)
            {
                ShaderMacros.SetExtraInclude(CShaderDefinitions.EExtraIncludeType.MdfQueue, MdfQueueShaderPatch.GetShaderIncludes());
            }

            ShaderMacros.SetExtraDefines(CShaderDefinitions.EExtraIncludeType.Material, MtlShaderPatch.GetShaderDefines());
            if (MdfQueueShaderPatch.GetShaderDefines() != null)
            {
                ShaderMacros.SetExtraDefines(CShaderDefinitions.EExtraIncludeType.MdfQueue, MdfQueueShaderPatch.GetShaderDefines());
            }
            if (EnvShaderPatch.MacroDefines != null)
            {
                var defs = EnvShaderPatch.MacroDefines;
                foreach (var i in defs)
                {
                    ShaderMacros.SetDefine(i.Name, i.Definition);
                }
            }

            List <CGfxMaterial.MtlMacro> MacroArray = MtlShaderPatch.GetMtlMacroArray();

            for (int idx = 0; idx < MacroArray.Count; idx++)
            {
                ShaderMacros.SetDefine(MacroArray[idx].mMacroName, MacroArray[idx].mMacroValue);
            }

            var mdfCaller = MdfQueueShaderPatch.GetMdfQueueCaller();

            if (string.IsNullOrEmpty(mdfCaller) == false)
            {
                ShaderMacros.SetDefine("MDFQUEUE_FUNCTION", mdfCaller);
            }
        }