Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
RenderSettings.h
Go to the documentation of this file.
1/**
2 * @file RenderSettings.h
3 * @ingroup mnd_graphics
4 * @brief Per-frame renderer tuning knobs (PSX-style pixelation, fog, ambient).
5 *
6 * One instance lives on mnd::Engine and is forwarded to the
7 * mnd::RenderQueue and PostFX shader as uniforms. Tweak it from the
8 * Editor's "Render" panel or imperatively at runtime to switch between
9 * crisp full-resolution and a coarse internal-resolution pixelated look.
10 */
11
12#pragma once
13
14#include "Constants.h"
15#include "Types.h"
16
17namespace mnd
18{
19
20/**
21 * @ingroup mnd_graphics
22 * @brief Renderer tuning struct passed to the post-process shader each frame.
23 */
24/// Which scene-target attachment the final blit shows. Used to verify
25/// the MRT G-buffer is producing sane normals/depth before the outline
26/// post-pass is wired in. Color = production view.
27enum class DebugView : int
28{
29 Color = 0,
30 Normal = 1,
31 Depth = 2,
32};
33
35{
36 /// When true the scene renders to an internal-resolution FBO and is
37 /// then nearest-blit upscaled to the window — gives a chunky, pixely look.
38 bool useInternalRes = true;
39
40 /// Which scene-target attachment to blit. Defaults to Color.
42
43 /// When true, run the outline post-pass between the scene draw and the final blit.
44 /// Ignored when useInternalRes is false (the post-pass needs the MRT scene target).
45 bool useOutline = true;
46
47 /// Window-pixels per scene-pixel. 1 = native resolution; higher values
48 /// downsample more aggressively for a chunkier look. Drives the internal
49 /// target size each frame as window/pixelSize.
50 int pixelSize = 3;
51
52 /// Resolved each frame from window size / pixelSize. Editor reads them
53 /// for display only; setting them directly has no effect.
56
57 /// RGBA value used by `glClear` at the start of each frame.
58 vec4 clearColor = vec4(0.0F, 0.0F, 0.0F, 1.0F);
59
60 f32 snapX = 320.0F; ///< Vertex snapping grid X (PS1 wobble).
61 f32 snapY = 240.0F; ///< Vertex snapping grid Y.
62 f32 fogStart = 0.0F; ///< Fog near distance (0 disables fog).
63 f32 fogEnd = 0.0F; ///< Fog far distance.
64 f32 ambient = kDefaultAmbient; ///< Global ambient term added to lit pixels.
65 vec3 lightDir = vec3(0.0F, -1.0F, 0.0F); ///< Sun/directional light vector.
66 f32 colorDepth = 0.0F; ///< levels per channel; <= 1 disables quantize
67 f32 ditherStrength = 0.0F; ///< Bayer dither amount applied after quantization.
68
69 bool showFps = true; ///< Draw FPS counter overlay in top-left corner.
70};
71
72} // namespace mnd
Engine-wide compile-time tunables and ANSI colour codes.
constexpr mnd::f32 kDefaultAmbient
Definition Constants.h:45
constexpr mnd::i32 kDefaultInternalHeight
Definition Constants.h:44
constexpr mnd::i32 kDefaultInternalWidth
Definition Constants.h:43
Engine-wide primitive type aliases and GLM math imports.
glm::vec4 vec4
4-component float vector (e.g. RGBA colour, homogeneous coords).
Definition Types.h:52
glm::vec3 vec3
3-component float vector (e.g. world position, RGB colour, normals).
Definition Types.h:51
float f32
32-bit IEEE float — the standard GL scalar type.
Definition Types.h:40
DebugView
Renderer tuning struct passed to the post-process shader each frame.
f32 snapY
Vertex snapping grid Y.
vec4 clearColor
RGBA value used by glClear at the start of each frame.
vec3 lightDir
Sun/directional light vector.
f32 snapX
Vertex snapping grid X (PS1 wobble).
DebugView debugView
Which scene-target attachment to blit. Defaults to Color.
f32 fogStart
Fog near distance (0 disables fog).
f32 ditherStrength
Bayer dither amount applied after quantization.
f32 ambient
Global ambient term added to lit pixels.
f32 fogEnd
Fog far distance.
f32 colorDepth
levels per channel; <= 1 disables quantize
bool showFps
Draw FPS counter overlay in top-left corner.