Example #1
0
        /// <summary>
        /// 分发渲染器,分发到对应的glow、DissloveGlow、GlowOutLine中
        /// </summary>
        public static EffectDispatchResult DispatchRender(Renderer r, Material mat, int subMeshIndex = 0)
        {
            if (!r)
            {
                return(EffectDispatchResult.Dispatch_None);
            }

            if (!EffectUtily.DispatchRenderToGlow(r, mat, subMeshIndex))
            {
                if (!EffectUtily.DispatchRenderToDissolveGlow(r, mat, subMeshIndex))
                {
                    if (EffectUtily.DispatchRenderToGlowOutLine(r, mat, subMeshIndex))
                    {
                        return(EffectDispatchResult.Dispatch_GlowOutLine);
                    }
                    return(EffectDispatchResult.Dispatch_None);
                }
                return(EffectDispatchResult.Dispatch_DissloveGlow);
            }
            return(EffectDispatchResult.Diapatch_Glow);
        }
Example #2
0
        /// <summary>
        /// 分发渲染器,分发到对应的glow、DissloveGlow、GlowOutLine中
        /// </summary>
        void DispatchRender(EffectModules modules)
        {
            foreach (Renderer r in modules.m_Normal_Renders)
            {
                if (!r)
                {
                    Debug.LogWarning(name + ",bake信息已经改变,请美术重新bake!");
                    continue;
                }

                //层级不对,一边去
                if (r.gameObject.layer != LayerMask.NameToLayer(Config.LayerLightingEffectOnly))
                {
                    continue;
                }

                Material mat = r.sharedMaterial;
                if (!EffectUtily.DispatchRenderToGlow(r, mat, 0))
                {
                    if (!EffectUtily.DispatchRenderToDissolveGlow(r, mat, 0))
                    {
                        if (EffectUtily.DispatchRenderToGlowOutLine(r, mat, 0))
                        {
                            m_DispatchedRender.Add(r, mat);
                        }
                    }
                    else
                    {
                        m_DispatchedRender.Add(r, mat);
                    }
                }
                else
                {
                    m_DispatchedRender.Add(r, mat);
                }
            }
        }