Rename SceneRenderTask::RenderingPercentage to RenderScale

This commit is contained in:
2026-06-03 13:01:11 +02:00
parent e0f234c667
commit fd8ae9bc2b
4 changed files with 28 additions and 17 deletions
+14 -11
View File
@@ -353,8 +353,11 @@ Viewport SceneRenderTask::GetViewport() const
viewport = Buffers->GetViewport();
else
viewport = Viewport(0, 0, 1280, 720);
viewport.Width *= RenderingPercentage;
viewport.Height *= RenderingPercentage;
PRAGMA_DISABLE_DEPRECATION_WARNINGS
float renderScale = RenderingPercentage * RenderScale;
PRAGMA_ENABLE_DEPRECATION_WARNINGS
viewport.Width *= renderScale;
viewport.Height *= renderScale;
return viewport;
}
@@ -394,13 +397,16 @@ void SceneRenderTask::OnBegin(GPUContext* context)
}
// Setup render buffers for the output rendering resolution
PRAGMA_DISABLE_DEPRECATION_WARNINGS
float renderScale = RenderingPercentage * RenderScale;
PRAGMA_ENABLE_DEPRECATION_WARNINGS
if (Output)
{
Buffers->Init((int32)((float)Output->Width() * RenderingPercentage), (int32)((float)Output->Height() * RenderingPercentage));
Buffers->Init((int32)((float)Output->Width() * renderScale), (int32)((float)Output->Height() * renderScale));
}
else if (SwapChain)
{
Buffers->Init((int32)((float)SwapChain->GetWidth() * RenderingPercentage), (int32)((float)SwapChain->GetHeight() * RenderingPercentage));
Buffers->Init((int32)((float)SwapChain->GetWidth() * renderScale), (int32)((float)SwapChain->GetHeight() * renderScale));
}
}
@@ -434,7 +440,10 @@ bool SceneRenderTask::Resize(int32 width, int32 height)
PROFILE_MEM(Graphics);
if (Output && Output->Resize(width, height))
return true;
if (Buffers && Buffers->Init((int32)((float)width * RenderingPercentage), (int32)((float)height * RenderingPercentage)))
PRAGMA_DISABLE_DEPRECATION_WARNINGS
float renderScale = RenderingPercentage * RenderScale;
PRAGMA_ENABLE_DEPRECATION_WARNINGS
if (Buffers && Buffers->Init((int32)((float)width * renderScale), (int32)((float)height * renderScale)))
return true;
return false;
}
@@ -477,12 +486,6 @@ void MainRenderTask::OnBegin(GPUContext* context)
// Use the main camera for the game (can be later overriden in Begin event by external code)
Camera = Camera::GetMainCamera();
#if !USE_EDITOR
// Sync render buffers size with the backbuffer
const auto size = Screen::GetSize();
Buffers->Init((int32)(size.X * RenderingPercentage), (int32)(size.Y * RenderingPercentage));
#endif
SceneRenderTask::OnBegin(context);
}
+7 -1
View File
@@ -268,8 +268,14 @@ public:
/// <summary>
/// The scale of the rendering resolution relative to the output dimensions. If lower than 1 the scene and postprocessing will be rendered at a lower resolution and upscaled to the output backbuffer.
/// [Deprecated in v1.13]
/// </summary>
API_FIELD() float RenderingPercentage = 1.0f;
API_FIELD() DEPRECATED("Use RenderScale instead.") float RenderingPercentage = 1.0f;
/// <summary>
/// The scale of the rendering resolution relative to the output dimensions. If lower than 1 the scene and postprocessing will be rendered at a lower resolution and upscaled to the output backbuffer.
/// </summary>
API_FIELD() float RenderScale = 1.0f;
/// <summary>
/// The image resolution upscale location within rendering pipeline. Unused if RenderingPercentage is 1.