summaryrefslogtreecommitdiff
path: root/src/renderer
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-06-12 00:16:51 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-06-12 00:16:51 +1000
commit26fb1fcafa552c600a70b2680c868f7355b138e4 (patch)
tree2fb77c8b14a5610584a316e57fd8db2795847a0f /src/renderer
parent76216f91aee936bc57d7e1a1b2c2b63a03ce976a (diff)
wip: uvsphere mesh gen and pbr shader first pass
Diffstat (limited to 'src/renderer')
-rw-r--r--src/renderer/render_types.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/renderer/render_types.h b/src/renderer/render_types.h
index b8ed512..1485ae4 100644
--- a/src/renderer/render_types.h
+++ b/src/renderer/render_types.h
@@ -13,6 +13,7 @@
#include "defines.h"
#include "ral.h"
#include "ral_types.h"
+#include "colours.h"
#if defined(CEL_PLATFORM_WINDOWS)
// #include "backend_dx11.h"
#endif
@@ -31,7 +32,7 @@ typedef struct geometry_data {
vertex_darray* vertices; // TODO: make it not a pointer
bool has_indices;
u32_darray* indices;
- vec3 colour; /** Optional: set vertex colours */
+ rgba colour; /** Optional: set vertex colours */
} geometry_data;
// 'Upload' a geometry_data (to GPU) -> get back a mesh
@@ -65,9 +66,10 @@ typedef struct texture_data {
typedef enum material_kind {
MAT_BLINN_PHONG,
MAT_PBR,
+ MAT_PBR_PARAMS, // uses float values to represent a surface uniformly
MAT_COUNT
} material_kind;
-static const char* material_kind_names[] = { "Blinn Phong", "PBR", "Count (This should be an error)"};
+static const char* material_kind_names[] = { "Blinn Phong", "PBR (Textures)", "PBR (Params)", "Count (This should be an error)"};
typedef struct blinn_phong_material {
char name[256];
@@ -85,7 +87,10 @@ typedef struct blinn_phong_material {
// typedef blinn_phong_material material;
typedef struct pbr_parameters {
-
+ vec3 albedo;
+ f32 metallic;
+ f32 roughness;
+ f32 ao;
} pbr_parameters;
typedef struct pbr_material {
@@ -101,6 +106,7 @@ typedef struct material {
material_kind kind;
union {
blinn_phong_material blinn_phong;
+ pbr_parameters pbr_params;
pbr_material pbr;
} mat_data;
char* name;