Added the directional light(s) to the lightmap shader too.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 12 years ago
parent 01ef7fd973
commit 6f396aa8f7

@ -1168,6 +1168,16 @@ namespace NL3D
ss << std::endl;
if( desc->lightingEnabled() )
{
addLightUniformsFS();
addLightInsFS();
ss << std::endl;
addLightsFunctionFS();
ss << std::endl;
}
if( desc->fogEnabled() )
addFogFunction();
@ -1207,6 +1217,9 @@ namespace NL3D
}
ss << "fragColor = texel;" << std::endl;
if( desc->lightingEnabled() )
addLightsFS();
if( desc->fogEnabled() )
addFog();

@ -401,19 +401,19 @@ namespace NL3D
int ldc = currentProgram->getUniformIndex( IProgramObject::EUniform( IProgramObject::Light0ColDiff + i ) );
if( ldc != -1 )
{
setUniform4f( ldc, 1.0f, 0.0f, 0.0f, 1.0f );
setUniform4f( ldc, 1.0f, 1.0f, 1.0f, 1.0f );
}
int lsc = currentProgram->getUniformIndex( IProgramObject::EUniform( IProgramObject::Light0ColSpec + i ) );
if( lsc != -1 )
{
setUniform4f( lsc, 0.0f, 1.0f, 0.0f, 1.0f );
setUniform4f( lsc, 1.0f, 1.0f, 1.0f, 1.0f );
}
int lac = currentProgram->getUniformIndex( IProgramObject::EUniform( IProgramObject::Light0ColAmb + i ) );
if( lac != -1 )
{
setUniform4f( lac, 0.0f, 0.0f, 0.3f, 1.0f );
setUniform4f( lac, 0.1f, 0.1f, 0.1f, 1.0f );
}
}

Loading…
Cancel
Save