diff options
| author | Ray <[email protected]> | 2019-08-19 12:17:02 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2019-08-19 12:17:02 +0200 |
| commit | 973d32f9a73c921dde2d75a6cc3fa9ee111e3e11 (patch) | |
| tree | 5be3bafa1a731369acc7f0459d187ab09845879b /src/models.c | |
| parent | 049a1c8f6d6c0535f39273c54fffda25c7570546 (diff) | |
| download | raylib-973d32f9a73c921dde2d75a6cc3fa9ee111e3e11.tar.gz raylib-973d32f9a73c921dde2d75a6cc3fa9ee111e3e11.zip | |
Reviewed issue #943
Diffstat (limited to 'src/models.c')
| -rw-r--r-- | src/models.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/models.c b/src/models.c index fd139e00..711576da 100644 --- a/src/models.c +++ b/src/models.c @@ -3419,7 +3419,7 @@ static Model LoadGLTF(const char *fileName) Texture2D texture = { 0 }; const char *texPath = GetDirectoryPath(fileName); - if (data->materials[i].pbr_metallic_roughness.base_color_factor) + if (data->materials[i].has_pbr_metallic_roughness) { tint.r = (unsigned char)(data->materials[i].pbr_metallic_roughness.base_color_factor[0]*255.99f); tint.g = (unsigned char)(data->materials[i].pbr_metallic_roughness.base_color_factor[1]*255.99f); @@ -3428,13 +3428,13 @@ static Model LoadGLTF(const char *fileName) } else { - tint.r = 1.f; - tint.g = 1.f; - tint.b = 1.f; - tint.a = 1.f; + tint.r = 1.0f; + tint.g = 1.0f; + tint.b = 1.0f; + tint.a = 1.0f; } - if (data->materials[i].pbr_metallic_roughness.base_color_texture.texture) + if (data->materials[i].has_pbr_metallic_roughness) { cgltf_image *img = data->materials[i].pbr_metallic_roughness.base_color_texture.texture->image; |
