vkmEngine 1.0.15
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::RenderSettings Struct Reference

Editable render tuning: pass toggles + per-effect parameters. More...

#include <render_settings.h>

Public Member Functions

uint32_t sceneExtent (uint32_t viewportPixels) const
 viewportPixels at the scene's scale, renderScale clamped to MIN_RENDER_SCALE..MAX_RENDER_SCALE.
bool gridShown () const
 Whether the editor's world grid draws at all.

Static Public Member Functions

static float renderScaleFor (uint32_t height, uint32_t viewportHeight)
 The renderScale that renders a viewport viewportHeight pixels tall at height.
static bool isMsaaSampleCount (uint32_t samples)
 Whether samples is one of MSAA_SAMPLE_COUNTS.

Public Attributes

bool ssr = true
 Screen-space reflections, over the probes and the sky.
bool screenShadows = true
 The cascaded sun's contacts its cascades are too coarse for.
float gtaoRadius = 0.6f
 World-space sample radius, MIN_GTAO_RADIUS..MAX_GTAO_RADIUS.
float gtaoIntensity = 1.0f
 Occlusion strength.
float gtaoPower = 1.5f
 Contrast curve.
float ssrMaxRoughness = 0.6f
 Rougher surfaces reflect the probes and the sky alone.
float ssrMaxDistance = 50.0f
bool ssrHalfResolution = false
float bloomStrength = 0.06f
float bloomThreshold = 2.0f
float bloomKnee = 0.5f
 Soft-knee width around the threshold.
float bloomRadius = 0.005f
 Upsample tent radius, fraction of frame width.
float exposure = 1.0f
 The exposure in stops: the frame is scaled by 2^exposure before the tonemap.
bool autoExposure = false
 Adapt the exposure to the frame's brightness, as an eye does (system/render/exposure.h).
float exposureMinimum = -4.0f
float adaptBrighter = 1.0f
float cullMaxDistance = 500.0f
 World-space.
float cullMinPixels = 3.0f
 Screen-pixel size; 0 disables.
bool occlusionCulling = false
 Cull the opaque geometry other geometry hides, on the GPU.
uint32_t msaaSamples = 4
 Scene-pass MSAA samples, one of MSAA_SAMPLE_COUNTS; post runs on the resolved buffer.
TextureFiltering textureFiltering = TextureFiltering::Trilinear
 The frame's default texel sampling; TextureParams::filterOverride outranks it.
uint32_t textureAnisotropy = 16
 Degree when the mode is Trilinear (1 = off); clamped to the driver's ceiling.
uint32_t shadowResolution = 4096
 The largest shadow tile's edge, one of SHADOW_RESOLUTIONS, the sun's near cascades'; costly to raise.
bool softShadows = true
 Shadows soft as each light's sourceRadius makes them (PCSS); off, every shadow takes the hard 3x3 filter, as a light of no size does.
float renderScale = 1.0f
 The scene's pixels as a share of the viewport's on each axis, MIN_RENDER_SCALE..MAX_RENDER_SCALE.

Static Public Attributes

static constexpr float MIN_GTAO_RADIUS = 0.05f
 The search divides by the radius, so it is never zero.
static constexpr float MAX_GTAO_RADIUS = 5.0f
 Past this the search reads the screen, not a neighbourhood.
static constexpr uint32_t MSAA_SAMPLE_COUNTS [] = {1, 2, 4, 8}
 1 is off.
static constexpr uint32_t SHADOW_RESOLUTIONS [] = {1024, 2048, 4096}
 What shadowResolution may be.
static constexpr float MIN_RENDER_SCALE = 0.5f
 Below half, the upscale is a blur no tier wants.
static constexpr float MAX_RENDER_SCALE = 1.0f
 The scene never renders past the viewport's resolution.

Detailed Description

Editable render tuning: pass toggles + per-effect parameters.

Carried on FrameContext::render; copied into RenderView::settings each frame.

Member Function Documentation

◆ renderScaleFor()

float Vkm::Engine::RenderSettings::renderScaleFor ( uint32_t height,
uint32_t viewportHeight )
inlinestatic

The renderScale that renders a viewport viewportHeight pixels tall at height.

For a settings screen that offers resolutions (WindowManager::renderResolutions): the window keeps its size and the frame is scaled up to it.

Parameters
heightThe chosen resolution's height.
viewportHeightThe viewport's.
Returns
The scale, clamped to MIN_RENDER_SCALE..MAX_RENDER_SCALE; 1 for an empty viewport.

◆ sceneExtent()

uint32_t Vkm::Engine::RenderSettings::sceneExtent ( uint32_t viewportPixels) const
inline

viewportPixels at the scene's scale, renderScale clamped to MIN_RENDER_SCALE..MAX_RENDER_SCALE.

Parameters
viewportPixelsA viewport extent.
Returns
The scene's extent; 0 only for 0.

◆ gridShown()

bool Vkm::Engine::RenderSettings::gridShown ( ) const
inline

Whether the editor's world grid draws at all.

Returns
True while any of its axes is on.

◆ isMsaaSampleCount()

bool Vkm::Engine::RenderSettings::isMsaaSampleCount ( uint32_t samples)
inlinestatic

Whether samples is one of MSAA_SAMPLE_COUNTS.

Parameters
samplesA requested msaaSamples.
Returns
True when it is allowed.

Member Data Documentation

◆ ssrMaxDistance

float Vkm::Engine::RenderSettings::ssrMaxDistance = 50.0f

World-space trace length.

◆ ssrHalfResolution

bool Vkm::Engine::RenderSettings::ssrHalfResolution = false

A ray every two by two pixels, gathered back to each by the surfaces they lie on: the reflected picture keeps its detail, only where a ray lands is coarser.

◆ bloomStrength

float Vkm::Engine::RenderSettings::bloomStrength = 0.06f

Bloom scale, added pre-tonemap.

◆ bloomThreshold

float Vkm::Engine::RenderSettings::bloomThreshold = 2.0f

On a pixel's brightest channel, after the exposure: past a sunlit white's, so what glows is a highlight, an emitter or the sun.

◆ exposure

float Vkm::Engine::RenderSettings::exposure = 1.0f

The exposure in stops: the frame is scaled by 2^exposure before the tonemap.

0 is as lit. One stop up by default, the daylight balance the procedural sky is built for. With autoExposure it is added to the adapted stops.

◆ exposureMinimum

float Vkm::Engine::RenderSettings::exposureMinimum = -4.0f

The adapted stops' range, before exposure is added: how far it darkens a bright frame and brightens a dark one.

◆ adaptBrighter

float Vkm::Engine::RenderSettings::adaptBrighter = 1.0f

How fast it brightens a frame grown dark, and darkens one grown bright: the share of the gap closed in a second is 1 - e^-rate. By default it brightens slower, as an eye does.

◆ occlusionCulling

bool Vkm::Engine::RenderSettings::occlusionCulling = false

Cull the opaque geometry other geometry hides, on the GPU.

Off by default: it pays only where the GPU bounds the frame and much of the scene is hidden (docs/reference/visibility.md).

◆ textureFiltering

TextureFiltering Vkm::Engine::RenderSettings::textureFiltering = TextureFiltering::Trilinear

The frame's default texel sampling; TextureParams::filterOverride outranks it.

textureAnisotropy is ignored unless this is Trilinear. Unrelated to MaterialAsset::anisotropy (the BRDF lobe).

◆ softShadows

bool Vkm::Engine::RenderSettings::softShadows = true

Shadows soft as each light's sourceRadius makes them (PCSS); off, every shadow takes the hard 3x3 filter, as a light of no size does.

The soft path's blocker search and its wider filter are the forward pass's dearest work.

◆ renderScale

float Vkm::Engine::RenderSettings::renderScale = 1.0f

The scene's pixels as a share of the viewport's on each axis, MIN_RENDER_SCALE..MAX_RENDER_SCALE.

The scene, its effects and their targets render at RenderView::sceneWidth/sceneHeight, and the composite scales the frame up to the viewport, where the UI draws at full resolution.


The documentation for this struct was generated from the following file: