Fixed forward shading point lights for real

Thanks to Raakz


Former-commit-id: a6c2b282a18d2dfa94732afb401811c8dd5d4b93
This commit is contained in:
Lynix 2014-01-18 09:08:42 +01:00
parent 4016d2fdcf
commit 9533f16e46
5 changed files with 5 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -169,7 +169,7 @@ void main()
float lightDirLength = length(lightDir);
lightDir /= lightDirLength; // Normalisation
float att = max(Lights[i].parameters1.w - Lights[i].parameters2.x*lightDirLength, 0.0);
float att = max(Lights[i].parameters1.w - Lights[i].parameters2.w*lightDirLength, 0.0);
// Ambient
lightAmbient += att * Lights[i].color.rgb * Lights[i].factors.x * (MaterialAmbient.rgb + SceneAmbient.rgb);

File diff suppressed because one or more lines are too long

View File

@ -175,7 +175,7 @@ void main()
float lightDirLength = length(lightDir);
lightDir /= lightDirLength; // Normalisation
float att = max(Lights[i].parameters1.w - Lights[i].parameters2.x*lightDirLength, 0.0);
float att = max(Lights[i].parameters1.w - Lights[i].parameters2.w*lightDirLength, 0.0);
// Ambient
lightAmbient += att * Lights[i].color.rgb * Lights[i].factors.x * (MaterialAmbient.rgb + SceneAmbient.rgb);

File diff suppressed because one or more lines are too long