VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
renderPassForward.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Created by Arnis Lektauers on 09.02.2026.
5//
6#pragma once
7
10
11namespace visutwin::canvas
12{
13 class LayerComposition;
14 class Scene;
15 class Renderer;
16
21 class RenderPassForward final : public RenderPass
22 {
23 public:
24 RenderPassForward(const std::shared_ptr<GraphicsDevice>& device,
25 LayerComposition* layerComposition, Scene* scene, Renderer* renderer);
26
27 void addRenderAction(RenderAction* renderAction);
28
29 // when true, the ProgramLibrary will generate forward shaders
30 // that output linear HDR (no tonemapping, no gamma correction).
31 void setHdrPass(bool hdr) { _hdrPass = hdr; }
32 bool hdrPass() const { return _hdrPass; }
33
34 void before() override;
35 void execute() override;
36 void after() override;
37
38 private:
39 void updateClears();
40 void refreshCameraUseFlags();
41 bool validateRenderActionOrder() const;
42 void renderRenderAction(RenderAction* renderAction, bool firstRenderAction);
43
44 LayerComposition* _layerComposition = nullptr;
45 Scene* _scene = nullptr;
46 Renderer* _renderer = nullptr;
47 std::vector<RenderAction*> _renderActions;
48
49 bool _hdrPass = false;
50
51 // Runtime parity checks for pass ordering.
52 bool _beforeCalled = false;
53 bool _executeCalled = false;
54 };
55}
void addRenderAction(RenderAction *renderAction)
RenderPassForward(const std::shared_ptr< GraphicsDevice > &device, LayerComposition *layerComposition, Scene *scene, Renderer *renderer)
std::shared_ptr< GraphicsDevice > device() const
Definition renderPass.h:124
RenderPass(const std::shared_ptr< GraphicsDevice > &device)
Definition renderPass.h:66
Container for the scene graph, lighting environment, fog, skybox, and layer composition.
Definition scene.h:29