VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
renderAction.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 12.09.2025.
5//
6#pragma once
7
9#include "scene/layer.h"
10
11namespace visutwin::canvas
12{
14 {
16
17 // true if the camera should render using render passes, it specifies
18 bool useCameraPasses = false;
19
20 Layer* layer = nullptr;
21
22 std::shared_ptr<RenderTarget> renderTarget;
23
24 // True if this is the first render action using this camera
25 bool firstCameraUse = false;
26
27 // True if this render action should trigger a postprocessing callback for the camera
28 bool triggerPostprocess = false;
29
30 bool transparent = false;
31 bool clearColor = false;
32 bool clearDepth = false;
33 bool clearStencil = false;
34
35 // True if this is the last render action using this camera
36 bool lastCameraUse = false;
37
38 void setupClears(const CameraComponent* cameraComponent, const Layer* layer)
39 {
40 const auto* camera = cameraComponent ? cameraComponent->camera() : nullptr;
41 clearColor = (camera && camera->clearColorBufferEnabled()) || (layer && layer->clearColorBuffer());
42 clearDepth = (camera && camera->clearDepthBufferEnabled()) || (layer && layer->clearDepthBuffer());
43 clearStencil = (camera && camera->clearStencilBufferEnabled()) || (layer && layer->clearStencilBuffer());
44 }
45 };
46}
std::shared_ptr< RenderTarget > renderTarget
void setupClears(const CameraComponent *cameraComponent, const Layer *layer)