From dadf5c00206120502928ee948998d3c21944d595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 25 Jul 2019 10:28:09 +0200 Subject: [PATCH] Fix white ambient in STL loader. A problem that sneaked in from #1293 (f84851e8931fb04e7074d487c91c3b3faa566994) due to insufficient code review, later reported in #2059 but not fixed properly. Having a white ambient practically means all other color information is ignored and the model stays bright white no matter how you set up your lighting, so putting it back to how it was before the commit above. --- code/STL/STLLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/STL/STLLoader.cpp b/code/STL/STLLoader.cpp index c7144e444..199a84a44 100644 --- a/code/STL/STLLoader.cpp +++ b/code/STL/STLLoader.cpp @@ -225,7 +225,7 @@ void STLImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS } pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_DIFFUSE); pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_SPECULAR); - clrDiffuse = aiColor4D( ai_real(1.0), ai_real(1.0), ai_real(1.0), ai_real(1.0)); + clrDiffuse = aiColor4D( ai_real(0.05), ai_real(0.05), ai_real(0.05), ai_real(1.0)); pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_AMBIENT); pScene->mNumMaterials = 1;