glTF KHR_materials_specular fixes

pull/5388/head
Alexey Medvedev 2023-11-25 16:13:42 -08:00 committed by Kim Kulling
parent 213d73ebc6
commit a72289b327
3 changed files with 4 additions and 4 deletions

View File

@ -720,7 +720,7 @@ const vec4 defaultBaseColor = { 1, 1, 1, 1 };
const vec3 defaultEmissiveFactor = { 0, 0, 0 };
const vec4 defaultDiffuseFactor = { 1, 1, 1, 1 };
const vec3 defaultSpecularFactor = { 1, 1, 1 };
const vec3 defaultSpecularColorFactor = { 0, 0, 0 };
const vec3 defaultSpecularColorFactor = { 1, 1, 1 };
const vec3 defaultSheenFactor = { 0, 0, 0 };
const vec3 defaultAttenuationColor = { 1, 1, 1 };

View File

@ -1392,7 +1392,7 @@ inline void PbrSpecularGlossiness::SetDefaults() {
inline void MaterialSpecular::SetDefaults() {
//KHR_materials_specular properties
SetVector(specularColorFactor, defaultSpecularColorFactor);
specularFactor = 0.f;
specularFactor = 1.f;
}
inline void MaterialSheen::SetDefaults() {

View File

@ -730,8 +730,8 @@ bool glTF2Exporter::GetMatSpecular(const aiMaterial &mat, glTF2::MaterialSpecula
} else if (colorFactorIsZero) {
specular.specularColorFactor[0] = specular.specularColorFactor[1] = specular.specularColorFactor[2] = 1.0f;
}
GetMatTex(mat, specular.specularColorTexture, aiTextureType_SPECULAR);
GetMatTex(mat, specular.specularTexture, aiTextureType_SPECULAR);
GetMatTex(mat, specular.specularTexture, aiTextureType_SPECULAR, 0);
GetMatTex(mat, specular.specularColorTexture, aiTextureType_SPECULAR, 1);
return true;
}