blob: 75735635e812a62376262973ac7e426acd80f1bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/**
* @file pbr.h
* @brief PBR render pass
*/
#pragma once
#include "defines.h"
#include "camera.h"
#include "maths_types.h"
#include "ral/ral.h"
#include "ral/ral_common.h"
// PBR;
// --- Public API
typedef struct PBR_Storage PBR_Storage; // Stores all necessary data and handles
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 ao;
} 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;
// --- Internal
typedef struct MaterialMap MaterialMap;
typedef struct RenderEnt RenderEnt;
GPU_Renderpass* PBR_RPassCreate();
GPU_Pipeline* PBR_PipelineCreate(GPU_Renderpass* rpass);
void PBR_Execute(
PBR_Storage* storage,
Camera camera,
TextureHandle shadowmap_tex,
MaterialMap* materials, // map of String -> Material
RenderEnt* entities,
size_t entity_count
);
// Internally this will need to update material parameters
|