Code style format.

This commit is contained in:
K. S. Ernest (iFire) Lee 2021-11-28 12:06:46 -08:00
commit 669985c64c
5 changed files with 17 additions and 16 deletions

View File

@ -469,7 +469,7 @@ static void ReadMesh(
const RawMaterialType materialType = const RawMaterialType materialType =
GetMaterialType(raw, textures, vertexTransparency, skinning.IsSkinned()); GetMaterialType(raw, textures, vertexTransparency, skinning.IsSkinned());
const int rawMaterialIndex = raw.AddMaterial( const int rawMaterialIndex = raw.AddMaterial(
materialId, materialName, materialType, textures, rawMatProps, userProperties, false ); materialId, materialName, materialType, textures, rawMatProps, userProperties, false);
raw.AddTriangle( raw.AddTriangle(
rawVertexIndices[0], rawVertexIndices[0],

View File

@ -393,12 +393,12 @@ ModelData* Raw2Gltf(
}, },
false); false);
if (aoMetRoughTex != nullptr) { if (aoMetRoughTex != nullptr) {
// if we successfully built a texture, factors are just multiplicative identity // if we successfully built a texture, factors are just multiplicative identity
metallic = roughness = 1.0f; metallic = roughness = 1.0f;
} else { } else {
// no shininess texture, // no shininess texture,
roughness = getRoughness(props->shininess); roughness = getRoughness(props->shininess);
} }
} else { } else {

View File

@ -94,13 +94,14 @@ MaterialData::MaterialData(
pbrMetallicRoughness(pbrMetallicRoughness) {} pbrMetallicRoughness(pbrMetallicRoughness) {}
json MaterialData::serialize() const { json MaterialData::serialize() const {
json result = {{"name", name}, json result = {
{"alphaMode", isTransparent ? "BLEND" : "OPAQUE"}, {"name", name},
{"doubleSided", isDoubleSided}, {"alphaMode", isTransparent ? "BLEND" : "OPAQUE"},
{"extras", {"doubleSided", isDoubleSided},
{{"fromFBX", {"extras",
{{"shadingModel", Describe(shadingModel)}, {{"fromFBX",
{"isTruePBR", shadingModel == RAW_SHADING_MODEL_PBR_MET_ROUGH}}}}}}; {{"shadingModel", Describe(shadingModel)},
{"isTruePBR", shadingModel == RAW_SHADING_MODEL_PBR_MET_ROUGH}}}}}};
if (normalTexture != nullptr) { if (normalTexture != nullptr) {
result["normalTexture"] = *normalTexture; result["normalTexture"] = *normalTexture;

View File

@ -150,7 +150,7 @@ int RawModel::AddMaterial(
const int textures[RAW_TEXTURE_USAGE_MAX], const int textures[RAW_TEXTURE_USAGE_MAX],
std::shared_ptr<RawMatProps> materialInfo, std::shared_ptr<RawMatProps> materialInfo,
const std::vector<std::string>& userProperties, const std::vector<std::string>& userProperties,
const bool isDoubleSided ) { const bool isDoubleSided) {
for (size_t i = 0; i < materials.size(); i++) { for (size_t i = 0; i < materials.size(); i++) {
if (materials[i].name != name) { if (materials[i].name != name) {
continue; continue;

View File

@ -383,7 +383,7 @@ class RawModel {
const int textures[RAW_TEXTURE_USAGE_MAX], const int textures[RAW_TEXTURE_USAGE_MAX],
std::shared_ptr<RawMatProps> materialInfo, std::shared_ptr<RawMatProps> materialInfo,
const std::vector<std::string>& userProperties, const std::vector<std::string>& userProperties,
const bool isDoubleSided ); const bool isDoubleSided);
int AddLight( int AddLight(
const char* name, const char* name,
RawLightType lightType, RawLightType lightType,