/// <summary> /// Collects the volumes's data and pack them in the computeBuffer /// </summary> private void CollectVolumesData() { if (_culler.HasVisibleObjects) { AuraVolume[] visibleVolumes = _culler.GetVisibleObjects(); for (int i = 0; i < _culler.VisibleObjectsCount; ++i) { _visibleVolumesDataArray[i] = visibleVolumes[i].GetData(); } Buffer.SetData(_visibleVolumesDataArray); } }
/// <summary> /// Updates the manager (collects shadows/cookies/data and packs them) /// </summary> public void Update() { _culler.Update(); SetupBuffers(); if (_culler.HasVisibleObjects) { _shadowmapsCollector.Generate(); _cookieMapsCollector.Generate(); AuraLight[] visibleLights = _culler.GetVisibleObjects(); for (int i = 0; i < _culler.VisibleObjectsCount; ++i) { visibleLights[i].SetShadowMapIndex(_shadowmapsCollector.GetTextureIndex(visibleLights[i].shadowMapRenderTexture)); visibleLights[i].SetCookieMapIndex(_cookieMapsCollector.GetTextureIndex(visibleLights[i].cookieMapRenderTexture)); _visibleSpotLightParametersArray[i] = visibleLights[i].GetSpotParameters(); } DataBuffer.SetData(_visibleSpotLightParametersArray); } }