25 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
26 auto& ev = ctx.get_cached<
events>();
30 debug_draw_callbacks_.reserve(128);
36 APPLOG_TRACE(
"{}::{}", hpp::type_name_str(*
this), __func__);
43 debug_draw_callbacks_.clear();
77 auto& pipeline_data = camera_comp.get_pipeline_data();
78 auto&
camera = pipeline_data.get_camera();
79 auto& pipeline = pipeline_data.get_pipeline();
80 auto& rview = camera_comp.get_render_view();
82 auto params = pipeline->create_run_params(camera_ent);
84 auto result = pipeline->run_pipeline(scn,
camera, rview, dt, params, camera_comp.get_render_mask());
86 render_debug(camera_ent);
95 [&](
auto e,
auto&& camera_comp)
97 auto handle = scn.create_handle(e);
98 output = render_scene(
handle, camera_comp, scn, dt);
106 entt::handle camera_ent,
112 auto&
camera = pipeline_data.get_camera();
113 auto& pipeline = pipeline_data.get_pipeline();
116 auto params = pipeline->create_run_params(camera_ent);
119 render_debug(camera_ent);
126 [&](
auto e,
auto&& camera_comp)
133void rendering_system::render_debug(entt::handle camera_entity)
135 if(debug_draw_callbacks_.empty())
140 auto& camera_comp = camera_entity.get<camera_component>();
142 const auto& camera = camera_comp.get_camera();
143 const auto& view = camera.get_view();
144 const auto& proj = camera.get_projection();
145 const auto& obuffer = rview.fbo_get(
"OBUFFER");
148 pass.bind(obuffer.get());
149 pass.set_view_proj(view, proj);
153 for(
const auto& callback : debug_draw_callbacks_)
161 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....
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.