示例#1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Frustum(FrustumSettings frustumSettings, Camera camera, AuraCamera auraComponent)
        {
            _frustumSettings = frustumSettings;
            _frustumSettings.OnFrustumQualityChanged += _frustumSettings_OnFrustumQualityChanged;

            _cameraComponent     = camera;
            _auraComponent       = auraComponent;
            _volumesManager      = new VolumesManager(_cameraComponent, _frustumSettings);
            _spotLightsManager   = new SpotLightsManager(_cameraComponent, _frustumSettings);
            _pointLightsManager  = new PointLightsManager(_cameraComponent, _frustumSettings);
            _frustumSettingsToId = new FrustumSettingsToId(_frustumSettings, _auraComponent, _volumesManager, _spotLightsManager, _pointLightsManager);

            InitializeResources();

            _computeDataComputeShader.GetKernelThreadGroupSizes(0, out _threadSizeX, out _threadSizeY, out _threadSizeZ);

            SetFrustumGridResolution(_frustumSettings.QualitySettings.frustumGridResolution);

            _previousOcclusionCullingState = _frustumSettingsToId.HasFlags(FrustumParameters.EnableOcclusionCulling);
            _previousLightProbesState      = _frustumSettingsToId.HasFlags(FrustumParameters.EnableLightProbes);

            _cameraRanges = new Vector4();
            _zParameters  = new Vector4();
            _frustumCornersWorldPositionArray          = new float[32];
            _secondaryFrustumCornersWorldPositionArray = new float[32];
            _previousWorldToClipMatrix                = new Matrix4x4();
            _previousWorldToClipMatrixFloats          = new float[16];
            _previousSecondaryWorldToClipMatrix       = new Matrix4x4();
            _previousSecondaryWorldToClipMatrixFloats = new float[16];
        }
示例#2
0
 public FrustumSettingsToId(FrustumSettings settings, AuraCamera auraComponent, VolumesManager volumesManager, SpotLightsManager spotLightsManager, PointLightsManager pointLightsManager)
 {
     _frustumSettings    = settings;
     _auraComponent      = auraComponent;
     _volumesManager     = volumesManager;
     _spotLightsManager  = spotLightsManager;
     _pointLightsManager = pointLightsManager;
 }
示例#3
0
 /// <summary>
 /// Disposes the managers
 /// </summary>
 private void DisposeManagers()
 {
     _volumesManager.Dispose();
     _volumesManager = null;
     _spotLightsManager.Dispose();
     _spotLightsManager = null;
     _pointLightsManager.Dispose();
     _pointLightsManager = null;
 }
示例#4
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Frustum(FrustumSettings frustumSettings, Camera camera, AuraCamera auraComponent)
        {
            _frustumSettings = frustumSettings;
            _frustumSettings.OnFrustumQualityChanged += _frustumSettings_OnFrustumQualityChanged;

            _cameraComponent     = camera;
            _auraComponent       = auraComponent;
            _volumesManager      = new VolumesManager(_cameraComponent, _frustumSettings);
            _spotLightsManager   = new SpotLightsManager(_cameraComponent, _frustumSettings);
            _pointLightsManager  = new PointLightsManager(_cameraComponent, _frustumSettings);
            _frustumSettingsToId = new FrustumSettingsToId(_frustumSettings, _auraComponent, _volumesManager, _spotLightsManager, _pointLightsManager);

            InitializeResources();

            _computeDataComputeShader.GetKernelThreadGroupSizes(0, out _threadSizeX, out _threadSizeY, out _threadSizeZ);

            SetFrustumGridResolution(_frustumSettings.QualitySettings.frustumGridResolution);

            _previousOcclusionCullingState = _frustumSettingsToId.HasFlags(FrustumParameters.EnableOcclusionCulling);
            _previousLightProbesState      = _frustumSettingsToId.HasFlags(FrustumParameters.EnableLightProbes);
        }