From ae1b957dd6db5ef71ea4cd372065014ba09d2d55 Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Fri, 11 Sep 2020 17:00:09 +0200 Subject: [PATCH] Force probe to render again if first time was during async shader compilation --- .../CHANGELOG.md | 1 + .../Runtime/Lighting/Reflection/HDProbe.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 048c3a265f3..95dbd5df838 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -71,6 +71,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed for post process being overridable in reflection probes even though it is not supported. - Fixed RTGI in performance mode when light layers are enabled on the asset. - Fixed SSS materials appearing black in matcap mode. +- Force probe to render again if first time was during async shader compilation to avoid having cyan objects. ### Changed - Preparation pass for RTSSShadows to be supported by render graph. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbe.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbe.cs index 111bf299026..c7d8070bb3f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbe.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbe.cs @@ -1,5 +1,8 @@ using System; using UnityEngine.Serialization; +#if UNITY_EDITOR +using UnityEditor; +#endif namespace UnityEngine.Rendering.HighDefinition { @@ -121,6 +124,9 @@ float aspect RTHandle m_RealtimeDepthBuffer; RenderData m_RealtimeRenderData; bool m_WasRenderedSinceLastOnDemandRequest = true; +#if UNITY_EDITOR + bool m_WasRenderedDuringAsyncCompilation = false; +#endif // Array of names that will be used in the Render Loop to name the probes in debug internal string[] probeName = new string[6]; @@ -129,6 +135,10 @@ internal bool requiresRealtimeUpdate { get { +#if UNITY_EDITOR + if (m_WasRenderedDuringAsyncCompilation && !ShaderUtil.anythingCompiling) + return true; +#endif if (mode != ProbeSettings.Mode.Realtime) return false; switch (realtimeMode) @@ -468,6 +478,9 @@ internal Matrix4x4 proxyToWorld internal void SetIsRendered(int frame) { +#if UNITY_EDITOR + m_WasRenderedDuringAsyncCompilation = ShaderUtil.anythingCompiling; +#endif m_WasRenderedSinceLastOnDemandRequest = true; wasRenderedAfterOnEnable = true; lastRenderedFrame = frame;