diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-10 14:06:15 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-10 14:06:15 +1000 |
commit | 9cb4bfacc69b2a95ce8e9250afc33fb04d1ba548 (patch) | |
tree | fbe75da188ac83b34153ac79c367b9d57e0d5ff9 /src/render/pbr.h | |
parent | 071a635e63536e50abfad7d5aeca1208dba58025 (diff) |
remove old code
Diffstat (limited to 'src/render/pbr.h')
-rw-r--r-- | src/render/pbr.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/render/pbr.h b/src/render/pbr.h new file mode 100644 index 0000000..cbdc577 --- /dev/null +++ b/src/render/pbr.h @@ -0,0 +1,61 @@ +/** + * @file pbr.h + * @brief PBR render pass + */ + +#pragma once +#include "backend_opengl.h" +#include "camera.h" +#include "defines.h" +#include "maths_types.h" +#include "ral_types.h" +#include "render_types.h" + +// --- Public API +typedef struct PBR_Storage { + GPU_Renderpass* pbr_pass; + GPU_Pipeline* pbr_pipeline; + +} PBR_Storage; // Stores all necessary data and handles + +typedef struct PBRMaterialUniforms { + Material mat; +} PBRMaterialUniforms; + +PUB void PBR_Init(PBR_Storage* storage); + +// NOTE: For simplicity's sake we will render this pass directly to the default framebuffer +PUB void PBR_Run(PBR_Storage* storage + // light data + // camera + // geometry + // materials +); + +typedef struct PBR_Params { + Vec3 albedo; + f32 metallic; + f32 roughness; + f32 ambient_occlusion; +} PBR_Params; + +typedef struct PBR_Textures { + TextureHandle albedo_map; + TextureHandle normal_map; + bool metal_roughness_combined; + TextureHandle metallic_map; + TextureHandle roughness_map; + TextureHandle ao_map; +} PBR_Textures; + +PUB Material PBRMaterialDefault(); +PUB ShaderDataLayout PBRMaterial_GetLayout(void* data); + +// --- Internal + +GPU_Renderpass* PBR_RPassCreate(); + +GPU_Pipeline* PBR_PipelineCreate(GPU_Renderpass* rpass); + +void PBR_Execute(PBR_Storage* storage, Camera camera, TextureHandle shadowmap_tex, + RenderEnt* entities, size_t entity_count); |