29 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
30 auto& ev = ctx.get_cached<
events>();
34 debug_draw_callbacks_.reserve(128);
40 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
48 debug_draw_callbacks_.clear();
90 [&](
auto e,
auto&& camera_comp)
92 auto& pipeline_data = camera_comp.get_pipeline_data();
93 auto&
camera = pipeline_data.get_camera();
94 auto& pipeline = pipeline_data.get_pipeline();
95 auto& rview = camera_comp.get_render_view();
107 auto& pipeline_data = camera_comp.get_pipeline_data();
108 auto&
camera = pipeline_data.get_camera();
109 auto& pipeline = pipeline_data.get_pipeline();
110 auto& rview = camera_comp.get_render_view();
113 bool process_input = render_screen_space;
115 ui.update_world_space(ctx, camera_ent, scn, process_input);
117 ui.render_world_space(ctx, camera_ent, scn, dt);
119 auto params = pipeline->create_run_params(camera_ent, &scn, &
camera);
120 auto result = pipeline->run_pipeline(scn,
camera, rview, dt, params, camera_comp.get_render_mask());
121 render_debug(camera_ent);
122 if(render_screen_space)
124 ui.render_screen_space(ctx, result, camera_ent, scn, dt);
135 [&](
auto e,
auto&& camera_comp)
137 auto handle = scn.create_handle(e);
138 output = render_scene(
handle, camera_comp, scn, dt,
true);
145 entt::handle camera_ent,
149 bool render_screen_space)
154 auto&
camera = pipeline_data.get_camera();
155 auto& pipeline = pipeline_data.get_pipeline();
159 bool process_input = render_screen_space;
161 ui.update_world_space(ctx, camera_ent, scn, process_input);
163 ui.render_world_space(ctx, camera_ent, scn, dt);
165 auto params = pipeline->create_run_params(camera_ent, &scn, &
camera);
167 render_debug(camera_ent);
168 if(render_screen_space)
170 ui.render_screen_space(ctx, output, camera_ent, scn, dt);
179 [&](
auto e,
auto&& camera_comp)
186void rendering_system::render_debug(entt::handle camera_entity)
188 if(debug_draw_callbacks_.empty())
195 auto& camera_comp = camera_entity.get<camera_component>();
196 const auto& rview = camera_comp.get_render_view();
197 const auto& camera = camera_comp.get_camera();
198 const auto&
view = camera.get_view();
199 const auto& proj = camera.get_projection();
200 const auto& obuffer = rview.fbo_get(
"OBUFFER");
203 pass.bind(obuffer.get());
204 pass.set_view_proj(
view, proj);
208 for(
const auto& callback : debug_draw_callbacks_)
216 debug_draw_callbacks_.emplace_back(callback);
std::shared_ptr< frame_buffer > ptr
Class that contains core camera data, used for rendering and other purposes.
auto get_pipeline_data() -> pipeline_camera &
auto get_render_mask() const -> layer_mask
Gets the effective render mask (include - exclude).
auto get_render_view() -> gfx::render_view &
Gets the render view.
Class representing a camera. Contains functionality for manipulating and updating a camera....
System that manages and updates particle emitters in the ECS.
void on_play_begin(hpp::span< const entt::handle > entities, delta_t dt)
auto init(rtti::context &ctx) -> bool
Initializes the rendering path with the given context.
void add_debugdraw_call(const std::function< void(gfx::dd_raii &dd)> &callback)
void on_frame_update(scene &scn, delta_t dt)
Prepares the scene for rendering.
void on_frame_before_render(scene &scn, delta_t dt)
void on_frame_end(rtti::context &ctx, delta_t)
auto release_pipeline_resources(scene &scn) -> bool
auto render_scene(scene &scn, delta_t dt) -> gfx::frame_buffer::ptr
Renders the scene and returns the frame buffer.
auto deinit(rtti::context &ctx) -> bool
Deinitializes the rendering path with the given context.
std::chrono::duration< float > delta_t
#define APPLOG_TRACE(...)
#define APP_SCOPE_PERF(name_literal)
Create a scoped performance timer that records to the timeline profiler. Only accepts string literals...
static auto context() -> rtti::context &
hpp::event< void(rtti::context &, delta_t)> on_frame_end
Represents a scene in the ACE framework, managing entities and their relationships.
std::unique_ptr< entt::registry > registry
The registry that manages all entities in the scene.
auto create_handle(entt::entity e) -> entt::handle
Creates an entity in the scene.
System responsible for managing user interface components and rendering.
void update_screen_space(rtti::context &ctx, entt::handle camera_entity, scene &scn, bool &process_input)
Update screen-space UI documents (common + screen-space specific). Call before render_screen_space.