Timestamp:
Nov 18, 2022, 8:59:18 PM (21 months ago)
Author:
Vladislav Belov
Message:

Moves post processing out of scene rendering to avoid framebuffer pass duplicate.

Comments By: phosit, Stan

Differential Revision: https://code.wildfiregames.com/D4827

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/tools/atlas/GameInterface/ActorViewer.cpp

    r27111 r27232  
    4545#include "ps/ProfileViewer.h"
    4646#include "ps/VideoMode.h"
     47
     48
    4749#include "renderer/Renderer.h"
    4850#include "renderer/RenderingOptions.h"
     
    510512    // TODO: ActorViewer should reuse CRenderer code and not duplicate it.
    511513
     514
     515
    512516    // Set simulation context for rendering purposes
    513     g_Renderer.GetSceneRenderer().SetSimulation(&m.Simulation2);
     517    .SetSimulation(&m.Simulation2);
    514518
    515519    // Find the centre of the interesting region, in the middle of the patch
     
    527531    camera.UpdateFrustum();
    528532
    529     g_Renderer.GetSceneRenderer().SetSceneCamera(camera, camera);
     533    .SetSceneCamera(camera, camera);
    530534
    531535    g_Renderer.BeginFrame();
    532536
    533     g_Renderer.GetSceneRenderer().RenderScene(g_Renderer.GetDeviceCommandContext(), m);
    534 
    535     {
    536         CCanvas2D canvas(g_xres, g_yres, g_VideoMode.GetScale(), g_Renderer.GetDeviceCommandContext());
     537    Renderer::Backend::IDeviceCommandContext* deviceCommandContext =
     538        g_Renderer.GetDeviceCommandContext();
     539
     540    sceneRenderer.PrepareScene(deviceCommandContext, m);
     541
     542    deviceCommandContext->BeginFramebufferPass(
     543        deviceCommandContext->GetDevice()->GetCurrentBackbuffer());
     544
     545    sceneRenderer.RenderScene(deviceCommandContext);
     546    sceneRenderer.RenderSceneOverlays(deviceCommandContext);
     547
     548    {
     549        CCanvas2D canvas(g_xres, g_yres, g_VideoMode.GetScale(), deviceCommandContext);
    537550        g_Logger->Render(canvas);
    538551        g_ProfileViewer.RenderProfile(canvas);
    539552    }
     553
     554
    540555
    541556    g_Renderer.EndFrame();
Note: See TracChangeset for help on using the changeset viewer.