Beispiel #1
0
        public CanonicalRequestGivenMonoShould(TestSuiteContext context)
        {
            this.context = context;

            context.AdjustHeaderValueSeparator();

            // Mock Mono environment
            defaultEnvironmentProbe           = CanonicalRequest.EnvironmentProbe;
            CanonicalRequest.EnvironmentProbe = new MonoEnvironmentProbe();
        }
Beispiel #2
0
 internal static void Internal_EnvProbeBake(bool started, EnvironmentProbe probe)
 {
     if (started)
     {
         EnvProbeBakeStart?.Invoke(probe);
     }
     else
     {
         EnvProbeBakeEnd?.Invoke(probe);
     }
 }
        private void OnEnvProbeBakeEnd(EnvironmentProbe environmentProbe)
        {
            _entriesDone++;
            UpdateProgress();

            // Check for end event
            if (_entriesDone >= _entriesTotal)
            {
                _entriesTotal = _entriesDone = 0;
                OnEnd();
            }
        }
        private void OnEnvProbeBakeStart(EnvironmentProbe environmentProbe)
        {
            // Check for start event
            if (_entriesTotal == 0)
            {
                _entriesDone = 0;
                OnStart();
            }

            _entriesTotal++;
            UpdateProgress();
        }
 private void UpdateEnvironmentReflection()
 {
     if ((SystemInfo.copyTextureSupport & CopyTextureSupport.RTToTexture) != 0)
     {
         if (EnvironmentProbe.texture == null)
         {
             probeRenderId = EnvironmentProbe.RenderProbe();
         }
         else if (EnvironmentProbe.texture != null || EnvironmentProbe.IsFinishedRendering(probeRenderId))
         {
             Graphics.CopyTexture(EnvironmentProbe.texture, EnvironmentReflection as Texture);
             RenderSettings.customReflection      = EnvironmentReflection;
             RenderSettings.defaultReflectionMode = DefaultReflectionMode.Custom;
             probeRenderId = EnvironmentProbe.RenderProbe();
         }
     }
 }
Beispiel #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AssetPreview"/> class.
        /// </summary>
        /// <param name="useWidgets">if set to <c>true</c> use widgets.</param>
        public AssetPreview(bool useWidgets)
            : base(RenderTask.Create <SceneRenderTask>(), new ArcBallCamera(Vector3.Zero, 50), useWidgets)
        {
            DockStyle = DockStyle.Fill;

            Task.Flags = ViewFlags.DefaulAssetPreview;
            Task.AllowGlobalCustomPostFx = false;

            ((ArcBallCamera)ViewportCamera).SetView(new Quaternion(0.424461186f, -0.0940724313f, 0.0443938486f, 0.899451137f));

            // Setup preview scene
            PreviewLight             = DirectionalLight.New();
            PreviewLight.Brightness  = 6.0f;
            PreviewLight.ShadowsMode = ShadowsCastingMode.None;
            PreviewLight.Orientation = Quaternion.Euler(new Vector3(52.1477f, -109.109f, -111.739f));
            //
            EnvProbe             = EnvironmentProbe.New();
            EnvProbe.AutoUpdate  = false;
            EnvProbe.CustomProbe = FlaxEngine.Content.LoadAsyncInternal <CubeTexture>(EditorAssets.DefaultSkyCubeTexture);
            //
            Sky          = Sky.New();
            Sky.SunLight = PreviewLight;
            Sky.SunPower = 8.0f;
            //
            SkyLight               = SkyLight.New();
            SkyLight.Mode          = SkyLight.Modes.CustomTexture;
            SkyLight.Brightness    = 2.0f;
            SkyLight.CustomTexture = EnvProbe.CustomProbe;
            //
            PostFxVolume           = PostFxVolume.New();
            PostFxVolume.IsBounded = false;
            PostFxVolume.Settings.Eye_MinLuminance = 0.1f;

            // Link actors for rendering
            Task.ActorsSource = ActorsSources.CustomActors;
            Task.CustomActors.Add(PreviewLight);
            Task.CustomActors.Add(EnvProbe);
            Task.CustomActors.Add(Sky);
            Task.CustomActors.Add(SkyLight);
            Task.CustomActors.Add(PostFxVolume);
        }