Fix camera cut flag in rendering to not trigger on origin change for smother visuals
This commit is contained in:
@@ -265,6 +265,14 @@ public:
|
|||||||
return Projection.M44 >= 1.0f;
|
return Projection.M44 >= 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether view Origin has been moved in this frame. Old history buffers/data might be invalid.
|
||||||
|
/// </summary>
|
||||||
|
FORCE_INLINE bool IsOriginTeleport() const
|
||||||
|
{
|
||||||
|
return Origin != PrevOrigin;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Ignore deprecation warnings in defaults
|
// Ignore deprecation warnings in defaults
|
||||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|||||||
@@ -353,8 +353,6 @@ void RenderInner(SceneRenderTask* task, RenderContext& renderContext, RenderCont
|
|||||||
const bool isGBufferDebug = GBufferPass::IsDebugView(renderContext.View.Mode);
|
const bool isGBufferDebug = GBufferPass::IsDebugView(renderContext.View.Mode);
|
||||||
{
|
{
|
||||||
PROFILE_CPU_NAMED("Setup");
|
PROFILE_CPU_NAMED("Setup");
|
||||||
if (renderContext.View.Origin != renderContext.View.PrevOrigin)
|
|
||||||
renderContext.Task->CameraCut(); // Cut any temporal effects on rendering origin change
|
|
||||||
const int32 screenWidth = renderContext.Buffers->GetWidth();
|
const int32 screenWidth = renderContext.Buffers->GetWidth();
|
||||||
const int32 screenHeight = renderContext.Buffers->GetHeight();
|
const int32 screenHeight = renderContext.Buffers->GetHeight();
|
||||||
setup.UpscaleLocation = renderContext.Task->UpscaleLocation;
|
setup.UpscaleLocation = renderContext.Task->UpscaleLocation;
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ bool VolumetricFogPass::Init(RenderContext& renderContext, GPUContext* context,
|
|||||||
(float)_cache.GridSizeZ);
|
(float)_cache.GridSizeZ);
|
||||||
auto& fogData = renderContext.Buffers->VolumetricFogData;
|
auto& fogData = renderContext.Buffers->VolumetricFogData;
|
||||||
fogData.MaxDistance = options.Distance;
|
fogData.MaxDistance = options.Distance;
|
||||||
if (renderContext.Task->IsCameraCut)
|
if (renderContext.Task->IsCameraCut || renderContext.View.IsOriginTeleport())
|
||||||
_cache.HistoryWeight = 0.0f;
|
_cache.HistoryWeight = 0.0f;
|
||||||
|
|
||||||
// Init data (partial, without directional light or sky light data);
|
// Init data (partial, without directional light or sky light data);
|
||||||
@@ -313,7 +313,7 @@ void VolumetricFogPass::Render(RenderContext& renderContext)
|
|||||||
PROFILE_GPU_CPU("Volumetric Fog");
|
PROFILE_GPU_CPU("Volumetric Fog");
|
||||||
|
|
||||||
// TODO: test exponential depth distribution (should give better quality near the camera)
|
// TODO: test exponential depth distribution (should give better quality near the camera)
|
||||||
// TODO: use tiled light culling and render unshadowed lights in single pass
|
// TODO: use tiled light culling and render shadowed/unshadowed lights in single pass
|
||||||
|
|
||||||
// Try to get shadows atlas
|
// Try to get shadows atlas
|
||||||
GPUTexture* shadowMap;
|
GPUTexture* shadowMap;
|
||||||
|
|||||||
Reference in New Issue
Block a user