Fix issue with texture not updating on property change for RenderablePointCloud

Fix issue with texture not being rendered when the texture file path is set during runtime
This commit is contained in:
Emma Broman
2024-06-18 13:47:35 +02:00
parent 14cf12d23e
commit 6cb4a7efef

View File

@@ -731,9 +731,6 @@ RenderablePointCloud::RenderablePointCloud(const ghoul::Dictionary& dictionary)
_textureMode = TextureInputMode::Single;
_hasSpriteTexture = true;
_texture.spriteTexturePath = absPath(*t.file).string();
_texture.spriteTexturePath.onChange(
[this]() { _spriteTextureIsDirty = true; }
);
}
_texture.enabled = t.enabled.value_or(_texture.enabled);
@@ -742,6 +739,10 @@ RenderablePointCloud::RenderablePointCloud(const ghoul::Dictionary& dictionary)
_texture.useAlphaChannel = t.useAlphaChannel.value_or(_texture.useAlphaChannel);
}
_texture.spriteTexturePath.onChange([this]() {
_spriteTextureIsDirty = true;
_hasSpriteTexture = !_texture.spriteTexturePath.value().empty();
});
_texture.allowCompression.onChange([this]() { _spriteTextureIsDirty = true; });
_texture.useAlphaChannel.onChange([this]() { _spriteTextureIsDirty = true; });