浏览代码

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.
Vladimír Vondruš 6 年之前
父节点
当前提交
dadf5c0020
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      code/STL/STLLoader.cpp

+ 1 - 1
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_DIFFUSE);
     pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_SPECULAR);
     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);
     pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_AMBIENT);
 
 
     pScene->mNumMaterials = 1;
     pScene->mNumMaterials = 1;