Ejemplo n.º 1
0
        internal void UpdateShadowRequest(int index, HDShadowRequest shadowRequest, ShadowMapUpdateType updateType)
        {
            if (index >= m_ShadowRequestCount)
            {
                return;
            }

            m_ShadowRequests[index] = shadowRequest;

            bool addToCached = updateType == ShadowMapUpdateType.Cached || updateType == ShadowMapUpdateType.Mixed;
            bool addDynamic  = updateType == ShadowMapUpdateType.Dynamic || updateType == ShadowMapUpdateType.Mixed;

            switch (shadowRequest.shadowMapType)
            {
            case ShadowMapType.PunctualAtlas:
            {
                if (addToCached)
                {
                    cachedShadowManager.punctualShadowAtlas.AddShadowRequest(shadowRequest);
                }
                if (addDynamic)
                {
                    m_Atlas.AddShadowRequest(shadowRequest);
                    if (updateType == ShadowMapUpdateType.Mixed)
                    {
                        m_Atlas.AddRequestToPendingBlitFromCache(shadowRequest);
                    }
                }

                break;
            }

            case ShadowMapType.CascadedDirectional:
            {
                m_CascadeAtlas.AddShadowRequest(shadowRequest);
                break;
            }

            case ShadowMapType.AreaLightAtlas:
            {
                if (addToCached)
                {
                    cachedShadowManager.areaShadowAtlas.AddShadowRequest(shadowRequest);
                }
                if (addDynamic)
                {
                    m_AreaLightShadowAtlas.AddShadowRequest(shadowRequest);
                    if (updateType == ShadowMapUpdateType.Mixed)
                    {
                        m_AreaLightShadowAtlas.AddRequestToPendingBlitFromCache(shadowRequest);
                    }
                }

                break;
            }
            }
            ;
        }
Ejemplo n.º 2
0
        internal void UpdateShadowRequest(int index, HDShadowRequest shadowRequest, bool isCached = false)
        {
            if (index >= m_ShadowRequestCount)
            {
                return;
            }

            m_ShadowRequests[index] = shadowRequest;

            switch (shadowRequest.shadowMapType)
            {
            case ShadowMapType.PunctualAtlas:
            {
                if (isCached)
                {
                    cachedShadowManager.punctualShadowAtlas.AddShadowRequest(shadowRequest);
                }
                else
                {
                    m_Atlas.AddShadowRequest(shadowRequest);
                }

                break;
            }

            case ShadowMapType.CascadedDirectional:
            {
                m_CascadeAtlas.AddShadowRequest(shadowRequest);
                break;
            }

            case ShadowMapType.AreaLightAtlas:
            {
                if (isCached)
                {
                    cachedShadowManager.areaShadowAtlas.AddShadowRequest(shadowRequest);
                }
                else
                {
                    m_AreaLightShadowAtlas.AddShadowRequest(shadowRequest);
                }

                break;
            }
            }
            ;
        }