Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::rendering::pipeline Class Referenceabstract

#include <pipeline.h>

Inheritance diagram for unravel::rendering::pipeline:
unravel::rendering::deferred

Classes

struct  run_params
 

Public Types

enum  visibility_query : uint32_t { not_specified = 1 << 0 , is_dirty = 1 << 1 , is_static = 1 << 2 , is_shadow_caster = 1 << 3 }
 Flags for visibility queries. More...
 
enum class  pipeline_run_type : std::uint8_t { camera = 0 , reflection_probe_capture = 1 }
 Describes which high-level pipeline path is executing. Pass enablement is controlled separately via run_params::pflags. More...
 
using uptr = std::unique_ptr<pipeline>
 
using sptr = std::shared_ptr<pipeline>
 
using wptr = std::weak_ptr<pipeline>
 
using visibility_flags = uint32_t
 Type alias for visibility flags.
 
using pipeline_flags = uint32_t
 

Public Member Functions

 pipeline ()=default
 
virtual ~pipeline ()=default
 
virtual auto init (rtti::context &ctx) -> bool
 
virtual void gather_visible_models (scene &scn, const camera *cam, visibility_flags query, const layer_mask &render_mask, delta_t dt, const std::function< void(entt::handle entity, const lod_data &lod_data)> &lod_data_callback, const camera *lod_reference_cam=nullptr)
 Gathers visible models from the scene based on the given query.
 
virtual auto run_pipeline (scene &scn, const camera &camera, gfx::render_view &rview, delta_t dt, const run_params &params, layer_mask render_mask=layer_mask{ layer_reserved::everything_layer}) -> gfx::frame_buffer::ptr=0
 Renders the entire scene from the camera's perspective.
 
virtual void run_pipeline (const gfx::frame_buffer::ptr &output, scene &scn, const camera &camera, gfx::render_view &rview, delta_t dt, const run_params &params, layer_mask render_mask=layer_mask{layer_reserved::everything_layer})=0
 Renders the entire scene from the camera's perspective to the specified output.
 
virtual void set_debug_pass (int pass)=0
 
virtual void run_ui_pass (scene &scn, const camera &camera, gfx::render_view &rview, const gfx::frame_buffer::ptr &output)
 
virtual void run_particle_pass (scene &scn, const camera &camera, gfx::render_view &rview, const gfx::frame_buffer::ptr &output)
 
virtual auto create_run_params (entt::handle camera_ent) const -> rendering::pipeline::run_params
 
virtual auto create_run_params (entt::handle camera_ent, scene *scn, const camera *cam) const -> rendering::pipeline::run_params
 
auto get_stats () -> pipeline_stats &
 

Static Public Member Functions

static auto get_shadow_lod_bias () -> float
 LOD bias applied on top of the main selection when rendering shadows. 0 = shadows use the same LOD the main view would pick; positive values push shadow rendering toward coarser LODs. Replaces the old behavior of always using LOD 0.
 
static void set_shadow_lod_bias (float bias)
 

Protected Attributes

prefilter_pass prefilter_pass_ {}
 
blit_pass blit_pass_ {}
 
atmospheric_pass_perez atmospheric_pass_perez_ {}
 
atmospheric_pass_skybox atmospheric_pass_skybox_ {}
 
assao_pass assao_pass_ {}
 
auto_exposure_pass auto_exposure_pass_ {}
 
bloom_pass bloom_pass_ {}
 
fxaa_pass fxaa_pass_ {}
 
taa_pass taa_pass_ {}
 
tonemapping_pass tonemapping_pass_ {}
 
ssr_pass ssr_pass_ {}
 
hiz_pass hiz_pass_ {}
 Hi-Z buffer generation pass.
 
ssil_pass ssil_pass_ {}
 
std::unique_ptr< gpu_programparticle_program_ {}
 
std::unique_ptr< gpu_programparticle_program_instanced_ {}
 
std::unique_ptr< gpu_programparticle_program_instanced_mask_ {}
 
std::unique_ptr< gpu_programworld_quad_program_ {}
 
pipeline_stats stats_ {}
 
entt::registry cache_registry_
 
entt::entity cache_entity_
 

Detailed Description

Definition at line 92 of file pipeline.h.

Member Typedef Documentation

◆ pipeline_flags

Definition at line 112 of file pipeline.h.

◆ sptr

using unravel::rendering::pipeline::sptr = std::shared_ptr<pipeline>

Definition at line 96 of file pipeline.h.

◆ uptr

using unravel::rendering::pipeline::uptr = std::unique_ptr<pipeline>

Definition at line 95 of file pipeline.h.

◆ visibility_flags

Type alias for visibility flags.

Definition at line 111 of file pipeline.h.

◆ wptr

Definition at line 97 of file pipeline.h.

Member Enumeration Documentation

◆ pipeline_run_type

enum class unravel::rendering::pipeline::pipeline_run_type : std::uint8_t
strong

Describes which high-level pipeline path is executing. Pass enablement is controlled separately via run_params::pflags.

Enumerator
camera 

Main camera / viewport rendering (post-processing, UI, probe build, etc.).

reflection_probe_capture 

Single cubemap face capture for reflection probe baking.

Definition at line 118 of file pipeline.h.

◆ visibility_query

Flags for visibility queries.

Enumerator
not_specified 

No specific visibility query.

is_dirty 

Query for dirty entities.

is_static 

Query for static entities.

is_shadow_caster 

Query for shadow casting entities.

Definition at line 103 of file pipeline.h.

Constructor & Destructor Documentation

◆ pipeline()

unravel::rendering::pipeline::pipeline ( )
default

◆ ~pipeline()

virtual unravel::rendering::pipeline::~pipeline ( )
virtualdefault

Member Function Documentation

◆ create_run_params() [1/2]

auto unravel::rendering::pipeline::create_run_params ( entt::handle camera_ent) const -> rendering::pipeline::run_params
virtual

Definition at line 231 of file pipeline.cpp.

◆ create_run_params() [2/2]

auto unravel::rendering::pipeline::create_run_params ( entt::handle camera_ent,
scene * scn,
const camera * cam ) const -> rendering::pipeline::run_params
virtual

Definition at line 346 of file pipeline.cpp.

◆ gather_visible_models()

void unravel::rendering::pipeline::gather_visible_models ( scene & scn,
const camera * cam,
visibility_flags query,
const layer_mask & render_mask,
delta_t dt,
const std::function< void(entt::handle entity, const lod_data &lod_data)> & lod_data_callback,
const camera * lod_reference_cam = nullptr )
virtual

Gathers visible models from the scene based on the given query.

Parameters
scnThe scene to gather models from.
camThe camera used for visibility determination.
queryThe visibility query flags.
render_maskRender mask to filter entities by layers.
dtThe delta time.
lod_data_callbackThe callback to call for each visible model.
lod_reference_camOptional camera used only for LOD selection when cam is null (e.g. shadow gathering, which must not frustum-cull but benefits from distance-appropriate LODs). The shadow LOD bias is applied on top.
Returns
A vector of handles to the visible models.

Definition at line 110 of file pipeline.cpp.

◆ get_shadow_lod_bias()

auto unravel::rendering::pipeline::get_shadow_lod_bias ( ) -> float
static

LOD bias applied on top of the main selection when rendering shadows. 0 = shadows use the same LOD the main view would pick; positive values push shadow rendering toward coarser LODs. Replaces the old behavior of always using LOD 0.

Definition at line 100 of file pipeline.cpp.

◆ get_stats()

auto unravel::rendering::pipeline::get_stats ( ) -> pipeline_stats&
inline

Definition at line 233 of file pipeline.h.

◆ init()

auto unravel::rendering::pipeline::init ( rtti::context & ctx) -> bool
virtual

Reimplemented in unravel::rendering::deferred.

Definition at line 58 of file pipeline.cpp.

◆ run_particle_pass()

void unravel::rendering::pipeline::run_particle_pass ( scene & scn,
const camera & camera,
gfx::render_view & rview,
const gfx::frame_buffer::ptr & output )
virtual

Definition at line 548 of file pipeline.cpp.

◆ run_pipeline() [1/2]

virtual void unravel::rendering::pipeline::run_pipeline ( const gfx::frame_buffer::ptr & output,
scene & scn,
const camera & camera,
gfx::render_view & rview,
delta_t dt,
const run_params & params,
layer_mask render_mask = layer_mask{layer_reserved::everything_layer} )
pure virtual

Renders the entire scene from the camera's perspective to the specified output.

Parameters
outputThe output frame buffer.
scnThe scene to render.
cameraThe camera to render from.
storageThe camera storage.
render_viewThe render view.
dtThe delta time.
queryThe visibility query flags.

Implemented in unravel::rendering::deferred.

◆ run_pipeline() [2/2]

virtual auto unravel::rendering::pipeline::run_pipeline ( scene & scn,
const camera & camera,
gfx::render_view & rview,
delta_t dt,
const run_params & params,
layer_mask render_mask = layer_masklayer_reserved::everything_layer} ) -> gfx::frame_buffer::ptr
pure virtual

Renders the entire scene from the camera's perspective.

Parameters
scnThe scene to render.
cameraThe camera to render from.
storageThe camera storage.
render_viewThe render view.
dtThe delta time.
queryThe visibility query flags.
Returns
A shared pointer to the frame buffer containing the rendered scene.

Implemented in unravel::rendering::deferred.

◆ run_ui_pass()

void unravel::rendering::pipeline::run_ui_pass ( scene & scn,
const camera & camera,
gfx::render_view & rview,
const gfx::frame_buffer::ptr & output )
virtual

Definition at line 417 of file pipeline.cpp.

◆ set_debug_pass()

virtual void unravel::rendering::pipeline::set_debug_pass ( int pass)
pure virtual

◆ set_shadow_lod_bias()

void unravel::rendering::pipeline::set_shadow_lod_bias ( float bias)
static

Definition at line 105 of file pipeline.cpp.

Member Data Documentation

◆ assao_pass_

assao_pass unravel::rendering::pipeline::assao_pass_ {}
protected

Definition at line 243 of file pipeline.h.

◆ atmospheric_pass_perez_

atmospheric_pass_perez unravel::rendering::pipeline::atmospheric_pass_perez_ {}
protected

Definition at line 241 of file pipeline.h.

◆ atmospheric_pass_skybox_

atmospheric_pass_skybox unravel::rendering::pipeline::atmospheric_pass_skybox_ {}
protected

Definition at line 242 of file pipeline.h.

◆ auto_exposure_pass_

auto_exposure_pass unravel::rendering::pipeline::auto_exposure_pass_ {}
protected

Definition at line 244 of file pipeline.h.

◆ blit_pass_

blit_pass unravel::rendering::pipeline::blit_pass_ {}
protected

Definition at line 240 of file pipeline.h.

◆ bloom_pass_

bloom_pass unravel::rendering::pipeline::bloom_pass_ {}
protected

Definition at line 245 of file pipeline.h.

◆ cache_entity_

entt::entity unravel::rendering::pipeline::cache_entity_
protected

Definition at line 262 of file pipeline.h.

◆ cache_registry_

entt::registry unravel::rendering::pipeline::cache_registry_
protected

Definition at line 261 of file pipeline.h.

◆ fxaa_pass_

fxaa_pass unravel::rendering::pipeline::fxaa_pass_ {}
protected

Definition at line 246 of file pipeline.h.

◆ hiz_pass_

hiz_pass unravel::rendering::pipeline::hiz_pass_ {}
protected

Hi-Z buffer generation pass.

Definition at line 250 of file pipeline.h.

◆ particle_program_

std::unique_ptr<gpu_program> unravel::rendering::pipeline::particle_program_ {}
protected

Definition at line 253 of file pipeline.h.

◆ particle_program_instanced_

std::unique_ptr<gpu_program> unravel::rendering::pipeline::particle_program_instanced_ {}
protected

Definition at line 254 of file pipeline.h.

◆ particle_program_instanced_mask_

std::unique_ptr<gpu_program> unravel::rendering::pipeline::particle_program_instanced_mask_ {}
protected

Definition at line 255 of file pipeline.h.

◆ prefilter_pass_

prefilter_pass unravel::rendering::pipeline::prefilter_pass_ {}
protected

Definition at line 239 of file pipeline.h.

◆ ssil_pass_

ssil_pass unravel::rendering::pipeline::ssil_pass_ {}
protected

Definition at line 251 of file pipeline.h.

◆ ssr_pass_

ssr_pass unravel::rendering::pipeline::ssr_pass_ {}
protected

Definition at line 249 of file pipeline.h.

◆ stats_

pipeline_stats unravel::rendering::pipeline::stats_ {}
protected

Definition at line 258 of file pipeline.h.

◆ taa_pass_

taa_pass unravel::rendering::pipeline::taa_pass_ {}
protected

Definition at line 247 of file pipeline.h.

◆ tonemapping_pass_

tonemapping_pass unravel::rendering::pipeline::tonemapping_pass_ {}
protected

Definition at line 248 of file pipeline.h.

◆ world_quad_program_

std::unique_ptr<gpu_program> unravel::rendering::pipeline::world_quad_program_ {}
protected

Definition at line 256 of file pipeline.h.


The documentation for this class was generated from the following files: