mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:29:03 +02:00
Merge pull request #3883 from samcake/fbx
Adding a filter on the apartment model to get better lightmaps
This commit is contained in:
commit
ea62194057
3 changed files with 9 additions and 5 deletions
|
@ -835,11 +835,14 @@ void GeometryReader::run() {
|
||||||
fbxgeo = readSVO(_reply->readAll());
|
fbxgeo = readSVO(_reply->readAll());
|
||||||
} else {
|
} else {
|
||||||
bool grabLightmaps = true;
|
bool grabLightmaps = true;
|
||||||
|
float lightmapLevel = 1.0f;
|
||||||
// HACK: For monday 12/01/2014 we need to kill lighmaps loading in starchamber...
|
// HACK: For monday 12/01/2014 we need to kill lighmaps loading in starchamber...
|
||||||
if (_url.path().toLower().endsWith("loungev4_11-18.fbx")) {
|
if (_url.path().toLower().endsWith("loungev4_11-18.fbx")) {
|
||||||
grabLightmaps = false;
|
grabLightmaps = false;
|
||||||
|
} else if (_url.path().toLower().endsWith("apt8_reboot.fbx")) {
|
||||||
|
lightmapLevel = 4.0f;
|
||||||
}
|
}
|
||||||
fbxgeo = readFBX(_reply->readAll(), _mapping, grabLightmaps);
|
fbxgeo = readFBX(_reply->readAll(), _mapping, grabLightmaps, lightmapLevel);
|
||||||
}
|
}
|
||||||
QMetaObject::invokeMethod(geometry.data(), "setGeometry", Q_ARG(const FBXGeometry&, fbxgeo));
|
QMetaObject::invokeMethod(geometry.data(), "setGeometry", Q_ARG(const FBXGeometry&, fbxgeo));
|
||||||
|
|
||||||
|
|
|
@ -1194,7 +1194,7 @@ int matchTextureUVSetToAttributeChannel(const std::string& texUVSetName, const Q
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping, bool loadLightmaps) {
|
FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping, bool loadLightmaps, float lightmapLevel) {
|
||||||
QHash<QString, ExtractedMesh> meshes;
|
QHash<QString, ExtractedMesh> meshes;
|
||||||
QHash<QString, QString> modelIDsToNames;
|
QHash<QString, QString> modelIDsToNames;
|
||||||
QHash<QString, int> meshIDsToMeshIndices;
|
QHash<QString, int> meshIDsToMeshIndices;
|
||||||
|
@ -1954,6 +1954,7 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping,
|
||||||
|
|
||||||
FBXTexture emissiveTexture;
|
FBXTexture emissiveTexture;
|
||||||
glm::vec2 emissiveParams(0.f, 1.f);
|
glm::vec2 emissiveParams(0.f, 1.f);
|
||||||
|
emissiveParams.y = lightmapLevel;
|
||||||
QString emissiveTextureID = emissiveTextures.value(childID);
|
QString emissiveTextureID = emissiveTextures.value(childID);
|
||||||
QString ambientTextureID = ambientTextures.value(childID);
|
QString ambientTextureID = ambientTextures.value(childID);
|
||||||
if (!emissiveTextureID.isNull() || !ambientTextureID.isNull()) {
|
if (!emissiveTextureID.isNull() || !ambientTextureID.isNull()) {
|
||||||
|
@ -2372,10 +2373,10 @@ QByteArray writeMapping(const QVariantHash& mapping) {
|
||||||
return buffer.data();
|
return buffer.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
FBXGeometry readFBX(const QByteArray& model, const QVariantHash& mapping, bool loadLightmaps) {
|
FBXGeometry readFBX(const QByteArray& model, const QVariantHash& mapping, bool loadLightmaps, float lightmapLevel) {
|
||||||
QBuffer buffer(const_cast<QByteArray*>(&model));
|
QBuffer buffer(const_cast<QByteArray*>(&model));
|
||||||
buffer.open(QIODevice::ReadOnly);
|
buffer.open(QIODevice::ReadOnly);
|
||||||
return extractFBXGeometry(parseFBX(&buffer), mapping, loadLightmaps);
|
return extractFBXGeometry(parseFBX(&buffer), mapping, loadLightmaps, lightmapLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool addMeshVoxelsOperation(OctreeElement* element, void* extraData) {
|
bool addMeshVoxelsOperation(OctreeElement* element, void* extraData) {
|
||||||
|
|
|
@ -253,7 +253,7 @@ QByteArray writeMapping(const QVariantHash& mapping);
|
||||||
|
|
||||||
/// Reads FBX geometry from the supplied model and mapping data.
|
/// Reads FBX geometry from the supplied model and mapping data.
|
||||||
/// \exception QString if an error occurs in parsing
|
/// \exception QString if an error occurs in parsing
|
||||||
FBXGeometry readFBX(const QByteArray& model, const QVariantHash& mapping, bool loadLightmaps = true);
|
FBXGeometry readFBX(const QByteArray& model, const QVariantHash& mapping, bool loadLightmaps = true, float lightmapLevel = 1.0f);
|
||||||
|
|
||||||
/// Reads SVO geometry from the supplied model data.
|
/// Reads SVO geometry from the supplied model data.
|
||||||
FBXGeometry readSVO(const QByteArray& model);
|
FBXGeometry readSVO(const QByteArray& model);
|
||||||
|
|
Loading…
Reference in a new issue