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; } } ; }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------ // Functions for mixed cached shadows that need to live in cached atlas // ------------------------------------------------------------------------------------------ public void AddBlitRequestsForUpdatedShadows(HDDynamicShadowAtlas dynamicAtlas) { foreach (var request in m_ShadowRequests) { if (request.shouldRenderCachedComponent) // meaning it has been updated this time frame { dynamicAtlas.AddRequestToPendingBlitFromCache(request); } } }