mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 23:09:52 +02:00
Fix polyline crash and flicker
This commit is contained in:
parent
523d099f70
commit
75e7146c5b
1 changed files with 2 additions and 1 deletions
|
@ -126,6 +126,7 @@ void PolyLineEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer&
|
||||||
auto textures = entity->getTextures();
|
auto textures = entity->getTextures();
|
||||||
QString path = textures.isEmpty() ? PathUtils::resourcesPath() + "images/paintStroke.png" : textures;
|
QString path = textures.isEmpty() ? PathUtils::resourcesPath() + "images/paintStroke.png" : textures;
|
||||||
if (!_texture || _lastTextures != path) {
|
if (!_texture || _lastTextures != path) {
|
||||||
|
_lastTextures = path;
|
||||||
_texture = DependencyManager::get<TextureCache>()->getTexture(QUrl(path));
|
_texture = DependencyManager::get<TextureCache>()->getTexture(QUrl(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,7 +221,7 @@ void PolyLineEntityRenderer::doRender(RenderArgs* args) {
|
||||||
batch.setModelTransform(Transform{ _modelTransform }.setScale(vec3(1)));
|
batch.setModelTransform(Transform{ _modelTransform }.setScale(vec3(1)));
|
||||||
batch.setUniformBuffer(PAINTSTROKE_UNIFORM_SLOT, _uniformBuffer);
|
batch.setUniformBuffer(PAINTSTROKE_UNIFORM_SLOT, _uniformBuffer);
|
||||||
|
|
||||||
if (_texture->isLoaded()) {
|
if (_texture && _texture->isLoaded()) {
|
||||||
batch.setResourceTexture(PAINTSTROKE_TEXTURE_SLOT, _texture->getGPUTexture());
|
batch.setResourceTexture(PAINTSTROKE_TEXTURE_SLOT, _texture->getGPUTexture());
|
||||||
} else {
|
} else {
|
||||||
batch.setResourceTexture(PAINTSTROKE_TEXTURE_SLOT, nullptr);
|
batch.setResourceTexture(PAINTSTROKE_TEXTURE_SLOT, nullptr);
|
||||||
|
|
Loading…
Reference in a new issue