diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-10 23:35:36 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-10 23:35:36 +1000 |
commit | 7bd1560cf2b49018a842fb42cda2c17b347957aa (patch) | |
tree | edffefe296db5106023822f6fdf90bdcf6e5e18d /src | |
parent | ee1b7fd3bc66501b252ce9e3e5ba89ac9aa54632 (diff) |
comment PBR functions
Diffstat (limited to 'src')
-rw-r--r-- | src/render/pbr.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/render/pbr.h b/src/render/pbr.h index cbdc577..d7b660b 100644 --- a/src/render/pbr.h +++ b/src/render/pbr.h @@ -1,6 +1,6 @@ /** * @file pbr.h - * @brief PBR render pass + * @brief PBR render pass and uniforms */ #pragma once @@ -12,19 +12,22 @@ #include "render_types.h" // --- Public API + +/** @brief Holds data for the PBR pipeline */ typedef struct PBR_Storage { GPU_Renderpass* pbr_pass; GPU_Pipeline* pbr_pipeline; - -} PBR_Storage; // Stores all necessary data and handles +} PBR_Storage; typedef struct PBRMaterialUniforms { Material mat; } PBRMaterialUniforms; +/** @brief */ PUB void PBR_Init(PBR_Storage* storage); // NOTE: For simplicity's sake we will render this pass directly to the default framebuffer +// internally this defers to `PBR_Execute()` PUB void PBR_Run(PBR_Storage* storage // light data // camera @@ -32,6 +35,7 @@ PUB void PBR_Run(PBR_Storage* storage // materials ); +/** @brief Parameters that get passed as a uniform block to the PBR shader */ typedef struct PBR_Params { Vec3 albedo; f32 metallic; @@ -39,6 +43,7 @@ typedef struct PBR_Params { f32 ambient_occlusion; } PBR_Params; +/** @brief Textures that will get passed into the PBR shader if they're not `INVALID_TEX_HANDLE` */ typedef struct PBR_Textures { TextureHandle albedo_map; TextureHandle normal_map; @@ -48,14 +53,16 @@ typedef struct PBR_Textures { TextureHandle ao_map; } PBR_Textures; +/** @brief Returns a default white matte material */ PUB Material PBRMaterialDefault(); + PUB ShaderDataLayout PBRMaterial_GetLayout(void* data); // --- Internal -GPU_Renderpass* PBR_RPassCreate(); +GPU_Renderpass* PBR_RPassCreate(); /** @brief Create the PBR Renderpass */ -GPU_Pipeline* PBR_PipelineCreate(GPU_Renderpass* rpass); +GPU_Pipeline* PBR_PipelineCreate(GPU_Renderpass* rpass); /** @brief Create the PBR Pipeline */ void PBR_Execute(PBR_Storage* storage, Camera camera, TextureHandle shadowmap_tex, RenderEnt* entities, size_t entity_count); |