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());
}

View File

@ -1,7 +1,7 @@
#version 110
/********************Uniformes********************/
layout(location = 0) uniform vec4 Color;
uniform vec4 Color;
/********************Fonctions********************/
void main()

View File

@ -1 +1 @@
35,118,101,114,115,105,111,110,32,49,49,48,13,10,13,10,47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,85,110,105,102,111,114,109,101,115,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,13,10,108,97,121,111,117,116,40,108,111,99,97,116,105,111,110,32,61,32,48,41,32,117,110,105,102,111,114,109,32,118,101,99,52,32,67,111,108,111,114,59,13,10,13,10,47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,70,111,110,99,116,105,111,110,115,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,13,10,118,111,105,100,32,109,97,105,110,40,41,13,10,123,13,10,9,103,108,95,70,114,97,103,67,111,108,111,114,32,61,32,67,111,108,111,114,59,13,10,125,
35,118,101,114,115,105,111,110,32,49,49,48,13,10,13,10,47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,85,110,105,102,111,114,109,101,115,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,13,10,117,110,105,102,111,114,109,32,118,101,99,52,32,67,111,108,111,114,59,13,10,13,10,47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,70,111,110,99,116,105,111,110,115,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,13,10,118,111,105,100,32,109,97,105,110,40,41,13,10,123,13,10,9,103,108,95,70,114,97,103,67,111,108,111,114,32,61,32,67,111,108,111,114,59,13,10,125,

View File

@ -4,7 +4,7 @@
out vec4 RenderTarget0;
/********************Uniformes********************/
layout(location = 0) uniform vec4 Color;
uniform vec4 Color;
/********************Fonctions********************/
void main()

View File

@ -1 +1 @@
35,118,101,114,115,105,111,110,32,49,52,48,13,10,13,10,47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,83,111,114,116,97,110,116,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,13,10,111,117,116,32,118,101,99,52,32,82,101,110,100,101,114,84,97,114,103,101,116,48,59,13,10,13,10,47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,85,110,105,102,111,114,109,101,115,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,13,10,108,97,121,111,117,116,40,108,111,99,97,116,105,111,110,32,61,32,48,41,32,117,110,105,102,111,114,109,32,118,101,99,52,32,67,111,108,111,114,59,13,10,13,10,47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,70,111,110,99,116,105,111,110,115,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,13,10,118,111,105,100,32,109,97,105,110,40,41,13,10,123,13,10,9,82,101,110,100,101,114,84,97,114,103,101,116,48,32,61,32,67,111,108,111,114,59,13,10,125,
35,118,101,114,115,105,111,110,32,49,52,48,13,10,13,10,47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,83,111,114,116,97,110,116,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,13,10,111,117,116,32,118,101,99,52,32,82,101,110,100,101,114,84,97,114,103,101,116,48,59,13,10,13,10,47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,85,110,105,102,111,114,109,101,115,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,13,10,117,110,105,102,111,114,109,32,118,101,99,52,32,67,111,108,111,114,59,13,10,13,10,47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,70,111,110,99,116,105,111,110,115,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,13,10,118,111,105,100,32,109,97,105,110,40,41,13,10,123,13,10,9,82,101,110,100,101,114,84,97,114,103,101,116,48,32,61,32,67,111,108,111,114,59,13,10,125,