mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:03:53 +02:00
Require model fixup if tex is transparent
This commit is contained in:
parent
3b62e203f7
commit
a89a76dc4b
2 changed files with 24 additions and 5 deletions
|
@ -74,6 +74,21 @@ Model::~Model() {
|
|||
|
||||
AbstractViewStateInterface* Model::_viewState = NULL;
|
||||
|
||||
bool Model::needsFixupInScene() {
|
||||
if (readyToAddToScene()) {
|
||||
// Once textures are loaded, fixup if they are now transparent
|
||||
if (!_needsReload && _needsUpdateTransparentTextures && _geometry->isLoadedWithTextures()) {
|
||||
_needsUpdateTransparentTextures = false;
|
||||
if (_hasTransparentTextures != _geometry->hasTransparentTextures()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (!_readyWhenAdded) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Model::setTranslation(const glm::vec3& translation) {
|
||||
_translation = translation;
|
||||
|
@ -728,6 +743,8 @@ void Model::setURL(const QUrl& url) {
|
|||
}
|
||||
|
||||
_needsReload = true;
|
||||
_needsUpdateTransparentTextures = true;
|
||||
_hasTransparentTextures = false;
|
||||
_meshGroupsKnown = false;
|
||||
invalidCalculatedMeshBoxes();
|
||||
deleteGeometry();
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
|
||||
// new Scene/Engine rendering support
|
||||
void setVisibleInScene(bool newValue, std::shared_ptr<render::Scene> scene);
|
||||
bool needsFixupInScene() { return !_readyWhenAdded && readyToAddToScene(); }
|
||||
bool needsFixupInScene();
|
||||
bool readyToAddToScene(RenderArgs* renderArgs = nullptr) {
|
||||
return !_needsReload && isRenderable() && isActive() && isLoaded();
|
||||
}
|
||||
|
@ -365,10 +365,12 @@ protected:
|
|||
|
||||
QSet<std::shared_ptr<MeshPartPayload>> _renderItemsSet;
|
||||
QMap<render::ItemID, render::PayloadPointer> _renderItems;
|
||||
bool _readyWhenAdded = false;
|
||||
bool _needsReload = true;
|
||||
bool _needsUpdateClusterMatrices = true;
|
||||
bool _showCollisionHull = false;
|
||||
bool _readyWhenAdded { false };
|
||||
bool _needsReload { true };
|
||||
bool _needsUpdateClusterMatrices { true };
|
||||
bool _needsUpdateTransparentTextures { true };
|
||||
bool _hasTransparentTextures { false };
|
||||
bool _showCollisionHull { false };
|
||||
|
||||
friend class ModelMeshPartPayload;
|
||||
RigPointer _rig;
|
||||
|
|
Loading…
Reference in a new issue