From f926234600af1883c2be259360b44173bb7c12b4 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:03:21 +1000 Subject: updating docs --- src/new_render/render_frame.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/new_render/render_frame.h (limited to 'src/new_render/render_frame.h') diff --git a/src/new_render/render_frame.h b/src/new_render/render_frame.h new file mode 100644 index 0000000..11b24f2 --- /dev/null +++ b/src/new_render/render_frame.h @@ -0,0 +1,27 @@ +#pragma once +#include "camera.h" +#include "defines.h" +#include "ral_types.h" +#include "render_types.h" + +// Frame lifecycle on CPU + +// 1. extract +// 2. culling +// 3. render +// 4. dispatch (combined with render for now) + +typedef struct Cull_Result { + u64 n_visible_objects; + u64 n_culled_objects; + u32* visible_ent_indices; // allocated on frame arena + size_t index_count; +} Cull_Result; + +// everything that can be in the world, knows how to extract rendering data +typedef void (*ExtractRenderData)(void* world_data); + +typedef struct Renderer Renderer; + +/** @brief Produces a smaller set of only those meshes visible in the camera frustum on the CPU */ +Cull_Result Frame_Cull(Renderer* ren, RenderEnt* entities, size_t entity_count, Camera *camera); \ No newline at end of file -- cgit v1.2.3-70-g09d2