diff --git a/include/Nazara/3D/Scene.hpp b/include/Nazara/3D/Scene.hpp index 99a988714..c7dff02b0 100644 --- a/include/Nazara/3D/Scene.hpp +++ b/include/Nazara/3D/Scene.hpp @@ -34,6 +34,7 @@ class NAZARA_API NzScene void Cull(); void Draw(); + const NzCamera* GetActiveCamera() const; NzBackground* GetBackground() const; NzSceneNode& GetRoot() const; float GetUpdateTime() const; diff --git a/src/Nazara/3D/Scene.cpp b/src/Nazara/3D/Scene.cpp index 84deb6b0b..3accfb0af 100644 --- a/src/Nazara/3D/Scene.cpp +++ b/src/Nazara/3D/Scene.cpp @@ -269,7 +269,8 @@ void NzScene::Draw() if (instancing) { - shader->SendInteger(lightCountLocation, lightIndex); + if (lightCountLocation != -1) + shader->SendInteger(lightCountLocation, lightIndex); unsigned int count = 0; for (const NzMatrix4f& matrix : subMeshIt.second) @@ -322,6 +323,11 @@ void NzScene::Draw() drawable->Draw(); } +const NzCamera* NzScene::GetActiveCamera() const +{ + return m_impl->camera; +} + NzBackground* NzScene::GetBackground() const { return m_impl->background.get();