Fix white ambient in STL loader.

A problem that sneaked in from #1293 (f84851e893) 
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.
pull/2563/head
Vladimír Vondruš 2019-07-25 10:28:09 +02:00 committed by GitHub
parent d1b206a8ea
commit dadf5c0020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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;