예제 #1
0
        public void EvaluateSkinnedMeshesOffscreenUpdate()
        {
            // Arrange
            var profile = new CullingControllerProfile();

            profile.shadowMapProjectionSizeThreshold = 6;
            profile.shadowRendererSizeThreshold      = 20;
            profile.shadowDistanceThreshold          = 15;

            var settings = new CullingControllerSettings();

            settings.enableAnimationCullingDistance = 20;
            settings.enableAnimationCulling         = true;

            // Act
            var farTest  = CullingControllerUtils.TestSkinnedRendererOffscreenRule(settings, 30);
            var nearTest = CullingControllerUtils.TestSkinnedRendererOffscreenRule(settings, 10);

            settings.enableAnimationCulling = false;
            var farTestWithCullingDisabled = CullingControllerUtils.TestSkinnedRendererOffscreenRule(settings, 30);

            // Assert
            Assert.IsTrue(nearTest);
            Assert.IsFalse(farTest);
            Assert.IsTrue(farTestWithCullingDisabled);
        }
        protected override IEnumerator SetUp()
        {
            yield return(base.SetUp());

            Assert.IsFalse(Environment.i.platform.cullingController.IsRunning());

            // If we get the settings copy here, it can be overriden with unwanted values
            // by QualitySettingsController, breaking this test!!.
            var settings = new CullingControllerSettings();

            settings.maxTimeBudget = 99999;
            Environment.i.platform.cullingController.SetSettings(settings);
            Environment.i.platform.cullingController.Start();

            Assert.IsTrue(Environment.i.platform.cullingController.IsRunning());
            Assert.IsTrue(settings.enableObjectCulling);
        }
예제 #3
0
        private static CullingController CreateMockedCulledController(UniversalRenderPipelineAsset urpAsset, CullingControllerSettings settings, ICullingObjectsTracker cullingObjectsTracker = null)
        {
            var result = Substitute.ForPartsOf <CullingController>(
                urpAsset == null ? GraphicsSettings.currentRenderPipeline as UniversalRenderPipelineAsset : urpAsset,
                settings ?? new CullingControllerSettings(),
                cullingObjectsTracker ?? new CullingObjectsTracker());

            result.SetSettings(new CullingControllerSettings()
            {
                maxTimeBudget = float.MaxValue
            });

            return(result);
        }