mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 14:30:35 +02:00
Revert "Disabled texture loading for agent"
This reverts commit a0aae43386
.
This commit is contained in:
parent
7fdd4aef11
commit
bf601dfa6e
4 changed files with 8 additions and 13 deletions
|
@ -108,6 +108,7 @@ Agent::Agent(ReceivedMessage& message) :
|
||||||
|
|
||||||
DependencyManager::set<ModelFormatRegistry>();
|
DependencyManager::set<ModelFormatRegistry>();
|
||||||
DependencyManager::set<ModelCache>();
|
DependencyManager::set<ModelCache>();
|
||||||
|
DependencyManager::set<TextureCache>();
|
||||||
|
|
||||||
// Needed to ensure the creation of the DebugDraw instance on the main thread
|
// Needed to ensure the creation of the DebugDraw instance on the main thread
|
||||||
DebugDraw::getInstance();
|
DebugDraw::getInstance();
|
||||||
|
@ -848,6 +849,7 @@ void Agent::aboutToFinish() {
|
||||||
|
|
||||||
DependencyManager::destroy<ModelFormatRegistry>();
|
DependencyManager::destroy<ModelFormatRegistry>();
|
||||||
DependencyManager::destroy<ModelCache>();
|
DependencyManager::destroy<ModelCache>();
|
||||||
|
DependencyManager::destroy<TextureCache>();
|
||||||
|
|
||||||
DependencyManager::destroy<PluginManager>();
|
DependencyManager::destroy<PluginManager>();
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,9 @@ static AnimPose composeAnimPose(const HFMJoint& joint, const glm::quat rotation,
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptableAvatar::update(float deltatime) {
|
void ScriptableAvatar::update(float deltatime) {
|
||||||
|
// TODO: the current decision to use geometry resource results in loading textures, but it works way better
|
||||||
|
// than previous choice of loading avatar as animation, which was missing data such as joint names hash,
|
||||||
|
// and also didn't support glTF models. Optimizing this will be left fot future PR.
|
||||||
if (!_geometryResource && !_skeletonModelFilenameURL.isEmpty()) { // AvatarData will parse the .fst, but not get the .fbx skeleton.
|
if (!_geometryResource && !_skeletonModelFilenameURL.isEmpty()) { // AvatarData will parse the .fst, but not get the .fbx skeleton.
|
||||||
_geometryResource = DependencyManager::get<ModelCache>()->getGeometryResource(_skeletonModelFilenameURL);
|
_geometryResource = DependencyManager::get<ModelCache>()->getGeometryResource(_skeletonModelFilenameURL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -355,12 +355,8 @@ void GeometryResource::deleter() {
|
||||||
|
|
||||||
void GeometryResource::setTextures() {
|
void GeometryResource::setTextures() {
|
||||||
if (_hfmModel) {
|
if (_hfmModel) {
|
||||||
if (DependencyManager::get<TextureCache>()) {
|
for (const HFMMaterial& material : _hfmModel->materials) {
|
||||||
for (const HFMMaterial& material : _hfmModel->materials) {
|
_materials.push_back(std::make_shared<NetworkMaterial>(material, _textureBaseURL));
|
||||||
_materials.push_back(std::make_shared<NetworkMaterial>(material, _textureBaseURL));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
qDebug() << "GeometryResource::setTextures: TextureCache dependency not available, skipping textures";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -865,13 +865,7 @@ graphics::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& baseUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto url = getTextureUrl(baseUrl, hfmTexture);
|
const auto url = getTextureUrl(baseUrl, hfmTexture);
|
||||||
auto textureCache = DependencyManager::get<TextureCache>();
|
const auto texture = DependencyManager::get<TextureCache>()->getTexture(url, type, hfmTexture.content, hfmTexture.maxNumPixels, hfmTexture.sourceChannel);
|
||||||
NetworkTexturePointer texture;
|
|
||||||
if (textureCache) {
|
|
||||||
textureCache->getTexture(url, type, hfmTexture.content, hfmTexture.maxNumPixels, hfmTexture.sourceChannel);
|
|
||||||
} else {
|
|
||||||
qDebug() << "GeometryResource::setTextures: TextureCache dependency not available, skipping textures";
|
|
||||||
}
|
|
||||||
_textures[channel] = Texture { hfmTexture.name, texture };
|
_textures[channel] = Texture { hfmTexture.name, texture };
|
||||||
|
|
||||||
auto map = std::make_shared<graphics::TextureMap>();
|
auto map = std::make_shared<graphics::TextureMap>();
|
||||||
|
|
Loading…
Reference in a new issue