VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
constants.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
8#include <cstdint>
9#include <unordered_map>
11
12namespace visutwin::canvas
13{
14 // The world layer (matches Engine bootstrap IDs).
15 constexpr int LAYERID_WORLD = 1;
16
17 // The depth layer (matches Engine bootstrap IDs).
18 constexpr int LAYERID_DEPTH = 2;
19
20 // The skybox layer (matches Engine bootstrap IDs).
21 constexpr int LAYERID_SKYBOX = 3;
22
23 // The UI layer (matches Engine bootstrap IDs).
24 constexpr int LAYERID_UI = 4;
25
26 // The immediate layer (matches Engine bootstrap IDs).
27 constexpr int LAYERID_IMMEDIATE = 5;
28
29 // Light mask bits.
30 constexpr uint32_t MASK_NONE = 0u;
31 constexpr uint32_t MASK_AFFECT_DYNAMIC = 1u;
32 constexpr uint32_t MASK_AFFECT_LIGHTMAPPED = 2u;
33 constexpr uint32_t MASK_BAKE = 4u;
34
35 // Specular occlusion modes.
36 constexpr uint32_t SPECOCC_NONE = 0u;
37 constexpr uint32_t SPECOCC_AO = 1u;
38 constexpr uint32_t SPECOCC_GLOSSDEPENDENT = 2u;
39
41 {
45 SKYTYPE_ATMOSPHERE // Sphere mesh + infinite behavior (camera-following)
46 };
47
48 enum class LightType
49 {
50 LIGHTTYPE_DIRECTIONAL, // Directional (global) light source
51 LIGHTTYPE_OMNI, // Omni-directional (local) light source
52 LIGHTTYPE_POINT, // Point (local) light source
53 LIGHTTYPE_SPOT, // Spot (local) light source
54 LIGHTTYPE_AREA_RECT // Rectangular area light (local)
55 };
56
62
70
72 {
73 SHADOWUPDATE_NONE, // The shadow map is not to be updated
74 SHADOWUPDATE_THISFRAME, // The shadow map is regenerated this frame and not on subsequent frames
75 SHADOWUPDATE_REALTIME // The shadow map is regenerated every frame
76 };
77
78 // Tonemapping modes.
89
90 enum class AspectRatioMode
91 {
92 ASPECT_AUTO, // Automatically set an aspect ratio to current render target's width divided by height
93 ASPECT_MANUAL, // Use the manual aspect ratio value
94 };
95
118
120 {
121 const char* name;
122 const char* kind;
124 bool pcf = false;
125 bool vsm = false;
126 };
127
128 extern const std::unordered_map<ShadowType, ShadowTypeInfo> shadowTypeInfo;
129}
constexpr int LAYERID_DEPTH
Definition constants.h:18
constexpr uint32_t SPECOCC_GLOSSDEPENDENT
Definition constants.h:38
constexpr uint32_t MASK_BAKE
Definition constants.h:33
constexpr int LAYERID_IMMEDIATE
Definition constants.h:27
constexpr uint32_t MASK_NONE
Definition constants.h:30
constexpr int LAYERID_SKYBOX
Definition constants.h:21
constexpr uint32_t SPECOCC_AO
Definition constants.h:37
constexpr uint32_t SPECOCC_NONE
Definition constants.h:36
constexpr int LAYERID_WORLD
Definition constants.h:15
constexpr int LAYERID_UI
Definition constants.h:24
constexpr uint32_t MASK_AFFECT_LIGHTMAPPED
Definition constants.h:32
const std::unordered_map< ShadowType, ShadowTypeInfo > shadowTypeInfo
Definition constants.cpp:10
constexpr uint32_t MASK_AFFECT_DYNAMIC
Definition constants.h:31