diff options
author | Omniscient <omniscient.oce@gmail.com> | 2024-07-11 18:03:29 +1000 |
---|---|---|
committer | Omniscient <omniscient.oce@gmail.com> | 2024-07-11 18:03:29 +1000 |
commit | 65d74bdb26af833b5380046dec204f685f745cc1 (patch) | |
tree | 6a913e8b47787fff9f4650963074ea3f8ab5de27 /src/new_render/shadows.h | |
parent | 3103f383751a12f8a0bdb22309704f1f826d204c (diff) |
changing styles plus simplifying a bit
Diffstat (limited to 'src/new_render/shadows.h')
-rw-r--r-- | src/new_render/shadows.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/new_render/shadows.h b/src/new_render/shadows.h new file mode 100644 index 0000000..4f10f35 --- /dev/null +++ b/src/new_render/shadows.h @@ -0,0 +1,30 @@ +/** + * @file shadows.h + * @brief Functions for adding shadows to scene rendering. +*/ + + +#pragma once +#include "defines.h" +#include "ral/ral_types.h" + +typedef struct Shadow_Storage Shadow_Storage; + +typedef struct RenderEnt RenderEnt; +typedef struct Camera Camera; +typedef struct Mat4 Mat4; + +// --- Public API +PUB void Shadow_Init(Shadow_Storage* storage); + +/** @brief Run shadow map generation for given entities, and store in a texture. + * @note Uses active directional light for now */ +PUB void Shadow_Run(Shadow_Storage* storage, RenderEnt* entities, size_t entity_count); + +/** @brief Get the shadow texture generated from shadowmap pass */ +PUB Handle Shadow_GetShadowMapTexture(Shadow_Storage* storage); + +// --- Internal +GPU_Renderpass* Shadow_RPassCreate(); // Creates the render pass +GPU_Pipeline* Shadow_PipelineCreate(GPU_Renderpass* rpass); // Creates the pipeline +void Shadow_ShadowmapExecute(Shadow_Storage* storage, Mat4 light_space_transform, RenderEnt* entites, size_t entity_count); |