summaryrefslogtreecommitdiff
path: root/src/resources/gltf.c
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-10 02:59:59 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-10 02:59:59 +1000
commitdcb9f65b25e59edb21c9c3cac7b32d70ca19eb72 (patch)
treece99b01a070c57ecc6f3f4073b8298608706f9a0 /src/resources/gltf.c
parenta0592bdb9966b204373bc4a258da47a603c70969 (diff)
wip
Diffstat (limited to 'src/resources/gltf.c')
-rw-r--r--src/resources/gltf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/resources/gltf.c b/src/resources/gltf.c
index 91816d8..ce6a83b 100644
--- a/src/resources/gltf.c
+++ b/src/resources/gltf.c
@@ -554,11 +554,14 @@ size_t GLTF_LoadMaterials(cgltf_data *data, Str8 relative_path, Material_darray
} else {
our_material.albedo_map = Render_GetWhiteTexture();
WARN("GLTF model has no albedo map");
+ our_material.base_colour = vec3_create(pbr.base_color_factor[0],pbr.base_color_factor[1], pbr.base_color_factor[2]);
}
// -- metallic
cgltf_texture_view metal_rough_tex_view = pbr.metallic_roughness_texture;
// bool has_metal_
+ printf("Metal factor: %f\n", pbr.metallic_factor);
+ printf("Roughness factor: %f\n", pbr.roughness_factor);
if (metal_rough_tex_view.texture != NULL) {
char metal_rough_map_path[1024];
snprintf(metal_rough_map_path, sizeof(metal_rough_map_path), "%s/%s", relative_path.buf,
@@ -566,6 +569,8 @@ size_t GLTF_LoadMaterials(cgltf_data *data, Str8 relative_path, Material_darray
our_material.metallic_roughness_map = TextureLoadFromFile(metal_rough_map_path);
} else {
WARN("GLTF model has no metal/roughness map");
+ our_material.metallic = pbr.metallic_factor;
+ our_material.roughness = pbr.roughness_factor;
}
cgltf_texture_view normal_tex_view = gltf_material.normal_texture;