From 351618f93bd081b4d2625538cf8a3ec994be5dce Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 8 Jan 2014 11:27:29 +0100 Subject: [PATCH] Fixed instancing not enabling in some conditions Former-commit-id: a6a29acd1896f44a7f82dd64fd53740b9021b422 --- src/Nazara/Graphics/ForwardRenderTechnique.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nazara/Graphics/ForwardRenderTechnique.cpp b/src/Nazara/Graphics/ForwardRenderTechnique.cpp index d8102ac98..8d9a4b4db 100644 --- a/src/Nazara/Graphics/ForwardRenderTechnique.cpp +++ b/src/Nazara/Graphics/ForwardRenderTechnique.cpp @@ -182,7 +182,7 @@ void NzForwardRenderTechnique::DrawOpaqueModels(const NzScene* scene) const // Nous utilisons de l'instancing que lorsqu'aucune lumière (autre que directionnelle) n'est active // Ceci car l'instancing n'est pas compatible avec la recherche des lumières les plus proches // (Le deferred shading n'a pas ce problème) - bool instancing = m_instancingEnabled && m_lights.IsEmpty() && renderQueueInstancing; + bool instancing = m_instancingEnabled && (!material->IsLightingEnabled() || m_lights.IsEmpty()) && renderQueueInstancing; // On commence par récupérer le programme du matériau const NzShaderProgram* program = material->GetShaderProgram(nzShaderTarget_Model, (instancing) ? nzShaderFlags_Instancing : 0);