lighting fix

This commit is contained in:
scrawl 2012-03-04 22:26:40 +01:00
parent b2109a1302
commit 332671b43d

View file

@ -396,7 +396,7 @@ void NIFLoader::createMaterial(const String &name,
for (int i=0; i<num_lights; ++i)
{
outStream <<
" float3 lightDir"<<i<<" = lightPositionObjSpace"<<i<<".xyz - positionObjSpace.xyz; \n"
" float3 lightDir"<<i<<" = lightPositionObjSpace"<<i<<".xyz - (positionObjSpace.xyz * lightPositionObjSpace"<<i<<".w); \n"
// pre-multiply light color with attenuation factor
" d = length( lightDir"<<i<<" ); \n"