예제 #1
0
        /// <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);
            }
        }
예제 #2
0
        /// <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);
            }
        }