Fix incorrectly rendered transparency in Physics Colliders view mode

#3474
This commit is contained in:
Wojtek Figat
2025-05-30 15:51:35 +02:00
parent d6b1f06721
commit 11dec8e868
2 changed files with 12 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ void ForwardPass::Dispose()
_shader = nullptr;
}
void ForwardPass::Render(RenderContext& renderContext, GPUTexture* input, GPUTexture* output)
void ForwardPass::Render(RenderContext& renderContext, GPUTexture*& input, GPUTexture*& output)
{
PROFILE_GPU_CPU("Forward");
auto context = GPUDevice::Instance->GetMainContext();
@@ -91,6 +91,16 @@ void ForwardPass::Render(RenderContext& renderContext, GPUTexture* input, GPUTex
// Check if there is no objects to render or no resources ready
auto& forwardList = mainCache->DrawCallsLists[(int32)DrawCallsListType::Forward];
auto& distortionList = mainCache->DrawCallsLists[(int32)DrawCallsListType::Distortion];
if ((forwardList.IsEmpty() && distortionList.IsEmpty())
#if USE_EDITOR
|| renderContext.View.Mode == ViewMode::PhysicsColliders
#endif
)
{
// Skip rendering
Swap(input, output);
return;
}
if (distortionList.IsEmpty() || checkIfSkipPass())
{
// Copy frame

View File

@@ -31,7 +31,7 @@ public:
/// <param name="renderContext">The rendering context.</param>
/// <param name="input">Target with renderer frame ready for further processing.</param>
/// <param name="output">The output frame.</param>
void Render(RenderContext& renderContext, GPUTexture* input, GPUTexture* output);
void Render(RenderContext& renderContext, GPUTexture*& input, GPUTexture*& output);
private: