From 60d1e086242940993432a40a934241dc40b7382c Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sun, 16 Jun 2024 01:21:12 +1000 Subject: uniform blocks working. fix spec highlight bug tomorrow --- src/renderer/builtin_materials.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/renderer/builtin_materials.h') diff --git a/src/renderer/builtin_materials.h b/src/renderer/builtin_materials.h index 8d84e53..7748599 100644 --- a/src/renderer/builtin_materials.h +++ b/src/renderer/builtin_materials.h @@ -44,16 +44,19 @@ typedef struct pbr_params_material_uniforms { f32 metallic; f32 roughness; f32 ao; + f32 pad[2]; } pbr_params_material_uniforms; typedef struct pbr_point_light { vec3 pos; + f32 pad; vec3 color; + f32 pad2; } pbr_point_light; typedef struct pbr_params_light_uniforms { - vec3 viewPos; - /* pbr_point_light pointLights[4]; */ + pbr_point_light pointLights[4]; + vec4 viewPos; } pbr_params_light_uniforms; typedef struct pbr_params_bindgroup { @@ -81,13 +84,13 @@ static shader_data_layout pbr_params_shader_layout(void* data) { .stores_data = has_data, .data = { .bytes = { .size = sizeof(pbr_params_light_uniforms) } } }; - printf("Size %d \n", b3.data.bytes.size); if (has_data) { + // printf("Size %d \n", b3.data.bytes.size); b1.data.bytes.data = &d->mvp_matrices; b2.data.bytes.data = &d->material; /* d->lights.viewPos = vec3(0, 1, 0); */ b3.data.bytes.data = &d->lights; - print_vec3(d->lights.viewPos); + // print_vec3(d->lights.viewPos); } return (shader_data_layout){ .name = "pbr_params", .bindings = { b1, b2, b3 }, .bindings_count = 3 -- cgit v1.2.3-70-g09d2