git-svn-id: svn://db.shs.com.ru/libs@701 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -112,16 +112,15 @@ Material * assimpMaterial(const aiMaterial * m) {
|
||||
// qDebug()<< fromAiString(m->mProperties[i]->mKey);// << "=" << aiMatFloat(m, m->mProperties[i]->mKey.C_Str(), 0, 0);
|
||||
//}
|
||||
ret->color_diffuse = aiMatColor(m, AI_MATKEY_COLOR_DIFFUSE);
|
||||
ret->color_specular = aiMatColor(m, AI_MATKEY_COLOR_SPECULAR);
|
||||
ret->color_emission = aiMatColor(m, AI_MATKEY_COLOR_EMISSIVE);
|
||||
float shine = aiMatFloat(m, AI_MATKEY_SHININESS, -1.f);
|
||||
if (shine >= 0) {
|
||||
ret->map_roughness.color_amount = 1.f - (shine / 100.f);
|
||||
ret->map_roughness.color_amount = 0.8f - (shine / 100.f * 0.6f);
|
||||
//qDebug() << "shine" << shine;
|
||||
}
|
||||
ret->map_diffuse .bitmap_path = aiMatString(m, AI_MATKEY_TEXTURE_DIFFUSE(0));
|
||||
ret->map_normal .bitmap_path = aiMatString(m, AI_MATKEY_TEXTURE_NORMALS(0));
|
||||
ret->map_specular .bitmap_path = aiMatString(m, AI_MATKEY_TEXTURE_SPECULAR(0));
|
||||
//ret->map_metalness.bitmap_path = aiMatString(m, AI_MATKEY_TEXTURE_SPECULAR(0));
|
||||
ret->map_roughness.bitmap_path = aiMatString(m, AI_MATKEY_TEXTURE_SHININESS(0));
|
||||
ret->map_emission .bitmap_path = aiMatString(m, AI_MATKEY_TEXTURE_EMISSIVE(0));
|
||||
ret->transparency = 1.f - aiMatFloat(m, AI_MATKEY_OPACITY, 1.f);
|
||||
|
||||
Reference in New Issue
Block a user