Fixed debug shader not compiling on some configurations

Former-commit-id: 7e31eec475dc5e40491f480e9f45476acab5fdb6
This commit is contained in:
Lynix
2014-04-04 14:56:45 +02:00
parent 3b48e556aa
commit f88c6cf0d7
5 changed files with 10 additions and 6 deletions

View File

@@ -176,6 +176,8 @@ bool NzDeferredPhongLightingPass::Process(const NzScene* scene, unsigned int fir
NzRenderer::SetFaceFilling(nzFaceFilling_Line);
const NzShader* shader = NzShaderLibrary::Get("DebugSimple");
static int colorLocation = shader->GetUniformLocation("Color");
NzRenderer::SetShader(shader);
for (const NzLight* light : m_renderQueue->pointLights)
{
@@ -184,7 +186,7 @@ bool NzDeferredPhongLightingPass::Process(const NzScene* scene, unsigned int fir
NzRenderer::SetMatrix(nzMatrixType_World, lightMatrix);
shader->SendColor(0, light->GetColor());
shader->SendColor(colorLocation, light->GetColor());
NzRenderer::DrawIndexedPrimitives(nzPrimitiveMode_TriangleList, 0, indexBuffer->GetIndexCount());
}
@@ -243,6 +245,8 @@ bool NzDeferredPhongLightingPass::Process(const NzScene* scene, unsigned int fir
NzRenderer::SetFaceFilling(nzFaceFilling_Line);
const NzShader* shader = NzShaderLibrary::Get("DebugSimple");
static int colorLocation = shader->GetUniformLocation("Color");
NzRenderer::SetShader(shader);
for (const NzLight* light : m_renderQueue->spotLights)
{
@@ -251,7 +255,7 @@ bool NzDeferredPhongLightingPass::Process(const NzScene* scene, unsigned int fir
NzRenderer::SetMatrix(nzMatrixType_World, lightMatrix);
shader->SendColor(0, light->GetColor());
shader->SendColor(colorLocation, light->GetColor());
NzRenderer::DrawIndexedPrimitives(nzPrimitiveMode_TriangleList, 0, indexBuffer->GetIndexCount());
}