mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 16:58:28 +02:00
Avoid setting null texs on uncaching models
This commit is contained in:
parent
d899d7d696
commit
fc19b60f8a
2 changed files with 3 additions and 2 deletions
|
@ -232,7 +232,7 @@ std::shared_ptr<NetworkGeometry> ModelCache::getGeometry(const QUrl& url, const
|
||||||
GeometryExtra geometryExtra = { mapping, textureBaseUrl };
|
GeometryExtra geometryExtra = { mapping, textureBaseUrl };
|
||||||
GeometryResource::Pointer resource = getResource(url, QUrl(), true, &geometryExtra).staticCast<GeometryResource>();
|
GeometryResource::Pointer resource = getResource(url, QUrl(), true, &geometryExtra).staticCast<GeometryResource>();
|
||||||
if (resource) {
|
if (resource) {
|
||||||
if (resource->isLoaded() && !resource->hasTextures()) {
|
if (resource->isLoaded() && resource->shouldSetTextures()) {
|
||||||
resource->setTextures();
|
resource->setTextures();
|
||||||
}
|
}
|
||||||
return std::make_shared<NetworkGeometry>(resource);
|
return std::make_shared<NetworkGeometry>(resource);
|
||||||
|
|
|
@ -107,7 +107,8 @@ protected:
|
||||||
friend class GeometryMappingResource;
|
friend class GeometryMappingResource;
|
||||||
|
|
||||||
// Geometries may not hold onto textures while cached - that is for the texture cache
|
// Geometries may not hold onto textures while cached - that is for the texture cache
|
||||||
bool hasTextures() const { return !_materials.empty(); }
|
// Instead, these methods clear and reset textures from the geometry when caching/loading
|
||||||
|
bool shouldSetTextures() const { return _geometry && _materials.empty(); }
|
||||||
void setTextures();
|
void setTextures();
|
||||||
void resetTextures();
|
void resetTextures();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue