Skip to content

Engine → Renderer

render_scene.h

The extraction contract: the engine's EXTRACT systems fill a render_scene, the renderer renders it. The renderer owns a render_scene_pair; begin_extract clears and returns the write slot, end_extract swaps, render_frame renders the read slot. The pair is not internally synchronised: the engine loop guarantees extraction of frame N and rendering of frame N-1 never touch the same slot (asserted by owner thread in Debug).

Structs

File Description
mesh_instance
render_scene
render_view
view_render_settings The post-process and SSAO groups one view renders with.

Classes

File Description
render_scene_pair Two scenes: one being written by extraction, one being read by the renderer.

Enumerations

view_debug_mode

enum class view_debug_mode : u8 {
    NONE = 0,
    AMBIENT_OCCLUSION                               // the SSAO term as grey, white = unoccluded
};

A debug visualisation that replaces a view's output. A property of the view only (editor views, screenshots and tests), never stored in a scene or project.

view_flags

enum class view_flags : u8 {
    NONE = 0,
    DRAW_DEBUG = 1 << 0,
    NO_POST_PROCESS = 1 << 1,
    SKIP_SHADOWS = 1 << 2,
    // Local-light (atlas) shadows use only casters on this view's layerMask, as its cascades do, instead of
    // the union of the masks of the shadowing views that are not isolated; this view's mask stays out of that
    // union. Each change of caster set along the view order re-renders the atlas once. SKIP_SHADOWS wins.
    ISOLATED_SHADOWS = 1 << 3,
    // The view's final image keeps the coverage the HDR frame carries as its alpha (0 where nothing drew, 1 under
    // a solid surface or the sky) and render_view::background is not composited: for a picture shown over a
    // backdrop of its own (the editor's Scene panel, whose themed backdrop and grid show where the scene drew
    // nothing). Every other view's image is opaque.
    KEEP_COVERAGE_ALPHA = 1 << 4
};

Macros

CONJURE_ENUM_FLAGS

CONJURE_ENUM_FLAGS(view_flags)

Functions

Public

effective_view_settings

[[nodiscard]] CONJURE_API view_render_settings effective_view_settings(
    const post_process_settings &scenePostProcess,
    const ssao_settings &sceneSsao,
    const render_view &view) noexcept;

The given scene groups with each group the view names in settingsOverride replaced by the view's own, unsanitised. Turning post-processing off (view_flags::NO_POST_PROCESS) and debugMode are not applied here: the result is the configured values.