Skip to content

Commit

Permalink
Fix type of clearcoat.clearcoatNormalTexture
Browse files Browse the repository at this point in the history
  • Loading branch information
wsw0108 committed Oct 16, 2024
1 parent 84bb3ff commit 6a9dc9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/fastgltf/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ namespace fastgltf {
Optional<TextureInfo> clearcoatTexture;
num clearcoatRoughnessFactor = 0.0f;
Optional<TextureInfo> clearcoatRoughnessTexture;
Optional<TextureInfo> clearcoatNormalTexture;
Optional<NormalTextureInfo> clearcoatNormalTexture;
};

FASTGLTF_EXPORT struct MaterialSheen {
Expand Down
6 changes: 3 additions & 3 deletions src/fastgltf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2637,9 +2637,9 @@ fg::Error fg::Parser::parseMaterialExtensions(simdjson::dom::object &object, fas
return error;
}

TextureInfo clearcoatNormalTexture;
NormalTextureInfo clearcoatNormalTexture;
if (auto error = parseTextureInfo(clearcoatObject, "clearcoatNormalTexture",
&clearcoatNormalTexture, config.extensions); error ==
&clearcoatNormalTexture, config.extensions, TextureInfoType::NormalTexture); error ==
Error::None) {
clearcoat->clearcoatNormalTexture = std::move(clearcoatNormalTexture);
} else if (error != Error::MissingField) {
Expand Down Expand Up @@ -4738,7 +4738,7 @@ void fg::Exporter::writeMaterials(const Asset& asset, std::string& json) {
if (it->clearcoat->clearcoatNormalTexture.has_value()) {
if (json.back() != '{') json += ',';
json += "\"clearcoatNormalTexture\":";
writeTextureInfo(json, &it->clearcoat->clearcoatNormalTexture.value());
writeTextureInfo(json, &it->clearcoat->clearcoatNormalTexture.value(), TextureInfoType::NormalTexture);
}
json += '}';
}
Expand Down

0 comments on commit 6a9dc9a

Please sign in to comment.