27 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
28 auto& ev = ctx.get_cached<
events>();
32 debug_draw_callbacks_.reserve(128);
38 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
45 debug_draw_callbacks_.clear();
81 auto& pipeline_data = camera_comp.get_pipeline_data();
82 auto&
camera = pipeline_data.get_camera();
83 auto& pipeline = pipeline_data.get_pipeline();
84 auto& rview = camera_comp.get_render_view();
86 auto params = pipeline->create_run_params(camera_ent);
88 auto result = pipeline->run_pipeline(scn,
camera, rview, dt, params, camera_comp.get_render_mask());
90 render_debug(camera_ent);
99 [&](
auto e,
auto&& camera_comp)
101 auto handle = scn.create_handle(e);
102 output = render_scene(
handle, camera_comp, scn, dt);
110 entt::handle camera_ent,
116 auto&
camera = pipeline_data.get_camera();
117 auto& pipeline = pipeline_data.get_pipeline();
120 auto params = pipeline->create_run_params(camera_ent);
124 render_debug(camera_ent);
131 [&](
auto e,
auto&& camera_comp)
138void rendering_system::render_debug(entt::handle camera_entity)
140 if(debug_draw_callbacks_.empty())
145 auto& camera_comp = camera_entity.get<camera_component>();
147 const auto& camera = camera_comp.get_camera();
148 const auto& view = camera.get_view();
149 const auto& proj = camera.get_projection();
150 const auto& obuffer = rview.fbo_get(
"OBUFFER");
153 pass.bind(obuffer.get());
154 pass.set_view_proj(view, proj);
158 for(
const auto& callback : debug_draw_callbacks_)
166 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 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(...)
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.