Code style format.
This commit is contained in:
commit
669985c64c
|
@ -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],
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue