summaryrefslogtreecommitdiff
path: root/indra/newview/gltfscenemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/gltfscenemanager.cpp')
-rw-r--r--indra/newview/gltfscenemanager.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp
index 8273c707f9..4e3439ea5c 100644
--- a/indra/newview/gltfscenemanager.cpp
+++ b/indra/newview/gltfscenemanager.cpp
@@ -82,6 +82,7 @@ void GLTFSceneManager::load(const std::string& filename)
LLPointer<Asset> asset = new Asset();
*asset = model;
+ gDebugProgram.bind(); // bind a shader to satisfy LLVertexBuffer assertions
asset->allocateGLResources(filename, model);
asset->updateTransforms();
@@ -114,7 +115,25 @@ void GLTFSceneManager::renderAlpha()
render(false);
}
-void GLTFSceneManager::render(bool opaque)
+void GLTFSceneManager::update()
+{
+ for (U32 i = 0; i < mObjects.size(); ++i)
+ {
+ if (mObjects[i]->isDead() || mObjects[i]->mGLTFAsset == nullptr)
+ {
+ mObjects.erase(mObjects.begin() + i);
+ --i;
+ continue;
+ }
+
+ Asset* asset = mObjects[i]->mGLTFAsset;
+
+ asset->update();
+
+ }
+}
+
+void GLTFSceneManager::render(bool opaque, bool rigged)
{
// for debugging, just render the whole scene as opaque
// by traversing the whole scenegraph
@@ -144,7 +163,7 @@ void GLTFSceneManager::render(bool opaque)
matMul(mat, modelview, modelview);
asset->updateRenderTransforms(modelview);
- asset->render(opaque);
+ asset->render(opaque, rigged);
gGL.popMatrix();
}