git-svn-id: svn://db.shs.com.ru/libs@44 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -156,7 +156,7 @@ QVector<Material> readMTL(QString obj_path, QString path) {
|
||||
}
|
||||
if (line.startsWith("Ks")) {
|
||||
Vector3d v = readVector3d(line.mid(2).trimmed());
|
||||
mat.shine_strength = v.length();
|
||||
mat.specular = v.length();
|
||||
double mc = qMax(v.x, qMax(v.y, v.z));
|
||||
if (mc > 0.) v /= mc;
|
||||
mat.color_specular = QColor::fromRgbF(v.x, v.y, v.z);
|
||||
@@ -164,7 +164,7 @@ QVector<Material> readMTL(QString obj_path, QString path) {
|
||||
continue;
|
||||
}
|
||||
if (line.startsWith("Ns")) {
|
||||
mat.shine = line.mid(2).trimmed().toDouble();
|
||||
mat.roughness = 2. / exp(line.mid(2).trimmed().toDouble());
|
||||
continue;
|
||||
}
|
||||
if (line.startsWith("d")) {
|
||||
@@ -172,7 +172,7 @@ QVector<Material> readMTL(QString obj_path, QString path) {
|
||||
continue;
|
||||
}
|
||||
if (line.startsWith("map_Kd")) {
|
||||
mat.diffuse.bitmap_path = findFile(line.mid(6).trimmed(), sp);
|
||||
mat.map_diffuse.bitmap_path = findFile(line.mid(6).trimmed(), sp);
|
||||
continue;
|
||||
}
|
||||
if (line.startsWith("map_bump")) {
|
||||
@@ -181,9 +181,9 @@ QVector<Material> readMTL(QString obj_path, QString path) {
|
||||
line = line.mid(3).trimmed();
|
||||
QString sv = line.left(line.indexOf(" "));
|
||||
line = line.mid(sv.size()).trimmed();
|
||||
mat.bump_scale = sv.toDouble();
|
||||
mat.map_bump.color_amount = sv.toDouble();
|
||||
}
|
||||
mat.bump.bitmap_path = findFile(line, sp);
|
||||
mat.map_bump.bitmap_path = findFile(line, sp);
|
||||
//qDebug() << "BUMP" << mat.name << mat.bump_scale << mat.bump.bitmap_path;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user