Skip to content

Commit 8b5eaf5

Browse files
Revert: Fixed two issues with sky static lighting. (#1775)
1 parent b367719 commit 8b5eaf5

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbe.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ internal void ForceRenderingNextUpdate()
497497

498498
void UpdateProbeName()
499499
{
500-
if (settings.type == ProbeSettings.ProbeType.ReflectionProbe)
500+
// TODO: ask if this is ok:
501+
if (settings.type == ProbeSettings.ProbeType.PlanarProbe)
501502
{
502503
for (int i = 0; i < 6; i++)
503504
probeName[i] = $"Reflection Probe RenderCamera ({name}: {(CubemapFace)i})";

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ partial struct FrameSettings
393393
(uint)FrameSettingsField.MotionVectors, // Enable/disable whole motion vectors pass (Camera + Object).
394394
(uint)FrameSettingsField.ObjectMotionVectors,
395395
(uint)FrameSettingsField.Decals,
396-
(uint)FrameSettingsField.DecalLayers,
396+
(uint)FrameSettingsField.DecalLayers,
397397
(uint)FrameSettingsField.Refraction, // Depends on DepthPyramid - If not enable, just do a copy of the scene color (?) - how to disable refraction ?
398398
(uint)FrameSettingsField.Distortion,
399399
(uint)FrameSettingsField.Postprocess,
@@ -467,7 +467,7 @@ partial struct FrameSettings
467467
(uint)FrameSettingsField.MotionVectors, // Enable/disable whole motion vectors pass (Camera + Object).
468468
(uint)FrameSettingsField.ObjectMotionVectors,
469469
(uint)FrameSettingsField.Decals,
470-
(uint)FrameSettingsField.DecalLayers,
470+
(uint)FrameSettingsField.DecalLayers,
471471
//(uint)FrameSettingsField.Refraction, // Depends on DepthPyramid - If not enable, just do a copy of the scene color (?) - how to disable refraction ?
472472
//(uint)FrameSettingsField.Distortion,
473473
//(uint)FrameSettingsField.Postprocess,
@@ -797,13 +797,6 @@ internal static void Sanitize(ref FrameSettings sanitizedFrameSettings, Camera c
797797
sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.FPTLForForwardOpaque] &= !msaa;
798798

799799
sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.ProbeVolume] &= renderPipelineSettings.supportProbeVolume && (ShaderConfig.s_ProbeVolumesEvaluationMode != ProbeVolumesEvaluationModes.Disabled);
800-
801-
// We disable reflection probes and planar reflections in regular preview rendering for two reasons.
802-
// - Performance: Realtime reflection are 99% not necessary in previews
803-
// - Static lighting consistency: When rendering a planar probe from a preview camera it may induce a recomputing of the static lighting
804-
// but with the preview lights which are different from the ones in the scene and will change the result inducing flickering.
805-
sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.ReflectionProbe] &= !preview;
806-
sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.PlanarProbe] &= !preview;
807800
}
808801

809802
/// <summary>Aggregation is default with override of the renderer then sanitized depending on supported features of hdrpasset.</summary>

com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -735,18 +735,6 @@ public void UpdateEnvironment( HDCamera hdCamera,
735735
m_BuiltinParameters.skySettings = skyContext.skySettings;
736736
m_BuiltinParameters.cloudLayer = skyContext.cloudLayer;
737737

738-
// When update is not requested and the context is already valid (ie: already computed at least once),
739-
// we need to early out in two cases:
740-
// - updateMode is "OnDemand" in which case we never update unless explicitly requested
741-
// - updateMode is "Realtime" in which case we only update if the time threshold for realtime update is passed.
742-
if (IsCachedContextValid(skyContext) && !updateRequired)
743-
{
744-
if (skyContext.skySettings.updateMode.value == EnvironmentUpdateMode.OnDemand)
745-
return;
746-
else if (skyContext.skySettings.updateMode.value == EnvironmentUpdateMode.Realtime && skyContext.currentUpdateTime < skyContext.skySettings.updatePeriod.value)
747-
return;
748-
}
749-
750738
int skyHash = ComputeSkyHash(hdCamera, skyContext, sunLight, ambientMode, staticSky);
751739
bool forceUpdate = updateRequired;
752740

@@ -765,7 +753,6 @@ public void UpdateEnvironment( HDCamera hdCamera,
765753
{
766754
using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.UpdateSkyEnvironment)))
767755
{
768-
// Debug.Log("Update Sky Lighting");
769756
RenderSkyToCubemap(skyContext);
770757

771758
if (updateAmbientProbe)
@@ -845,7 +832,7 @@ public void UpdateEnvironment(HDCamera hdCamera, ScriptableRenderContext renderC
845832
{
846833
m_StaticLightingSky.skySettings = staticLightingSky != null ? staticLightingSky.skySettings : null;
847834
m_StaticLightingSky.cloudLayer = staticLightingSky != null ? staticLightingSky.cloudLayer : null;
848-
UpdateEnvironment(hdCamera, renderContext, m_StaticLightingSky, sunLight, m_StaticSkyUpdateRequired || m_UpdateRequired, true, true, SkyAmbientMode.Static, frameIndex, cmd);
835+
UpdateEnvironment(hdCamera, renderContext, m_StaticLightingSky, sunLight, m_StaticSkyUpdateRequired, true, true, SkyAmbientMode.Static, frameIndex, cmd);
849836
m_StaticSkyUpdateRequired = false;
850837
}
851838

0 commit comments

Comments
 (0)