|
@@ -1,15 +1,19 @@
|
|
|
#ifdef LIGHT{X}
|
|
|
- #ifndef SPECULARTERM
|
|
|
- vec3 vLightSpecular{X} = vec3(0.0);
|
|
|
- #endif
|
|
|
- #ifdef SPOTLIGHT{X}
|
|
|
- info = computeSpotLighting(viewDirectionW, normalW, vLightData{X}, vLightDirection{X}, vLightDiffuse{X}.rgb, vLightSpecular{X}, vLightDiffuse{X}.a, roughness, NdotV, specularEnvironmentR90, NdotL);
|
|
|
- #endif
|
|
|
- #ifdef HEMILIGHT{X}
|
|
|
- info = computeHemisphericLighting(viewDirectionW, normalW, vLightData{X}, vLightDiffuse{X}.rgb, vLightSpecular{X}, vLightGround{X}, roughness, NdotV, specularEnvironmentR90, NdotL);
|
|
|
- #endif
|
|
|
- #if defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})
|
|
|
- info = computeLighting(viewDirectionW, normalW, vLightData{X}, vLightDiffuse{X}.rgb, vLightSpecular{X}, vLightDiffuse{X}.a, roughness, NdotV, specularEnvironmentR90, NdotL);
|
|
|
+ #if defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})
|
|
|
+ //No light calculation
|
|
|
+ #else
|
|
|
+ #ifndef SPECULARTERM
|
|
|
+ vec3 vLightSpecular{X} = vec3(0.0);
|
|
|
+ #endif
|
|
|
+ #ifdef SPOTLIGHT{X}
|
|
|
+ info = computeSpotLighting(viewDirectionW, normalW, vLightData{X}, vLightDirection{X}, vLightDiffuse{X}.rgb, vLightSpecular{X}, vLightDiffuse{X}.a, roughness, NdotV, specularEnvironmentR90, NdotL);
|
|
|
+ #endif
|
|
|
+ #ifdef HEMILIGHT{X}
|
|
|
+ info = computeHemisphericLighting(viewDirectionW, normalW, vLightData{X}, vLightDiffuse{X}.rgb, vLightSpecular{X}, vLightGround{X}, roughness, NdotV, specularEnvironmentR90, NdotL);
|
|
|
+ #endif
|
|
|
+ #if defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})
|
|
|
+ info = computeLighting(viewDirectionW, normalW, vLightData{X}, vLightDiffuse{X}.rgb, vLightSpecular{X}, vLightDiffuse{X}.a, roughness, NdotV, specularEnvironmentR90, NdotL);
|
|
|
+ #endif
|
|
|
#endif
|
|
|
|
|
|
#ifdef SHADOW{X}
|
|
@@ -34,17 +38,27 @@
|
|
|
notShadowLevel = 1.;
|
|
|
#endif
|
|
|
|
|
|
- lightDiffuseContribution += info.diffuse * notShadowLevel;
|
|
|
-
|
|
|
- #ifdef OVERLOADEDSHADOWVALUES
|
|
|
- if (NdotL < 0.000000000011)
|
|
|
- {
|
|
|
- notShadowLevel = 1.;
|
|
|
- }
|
|
|
- shadowedOnlyLightDiffuseContribution *= notShadowLevel;
|
|
|
- #endif
|
|
|
+ #if defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})
|
|
|
+ lightDiffuseContribution += lightmapColor * notShadowLevel;
|
|
|
+
|
|
|
+ #ifdef SPECULARTERM
|
|
|
+ #ifndef LIGHTMAPNOSPECULAR{X}
|
|
|
+ lightSpecularContribution += info.specular * notShadowLevel * lightmapColor;
|
|
|
+ #endif
|
|
|
+ #endif
|
|
|
+ #else
|
|
|
+ lightDiffuseContribution += info.diffuse * notShadowLevel;
|
|
|
+
|
|
|
+ #ifdef OVERLOADEDSHADOWVALUES
|
|
|
+ if (NdotL < 0.000000000011)
|
|
|
+ {
|
|
|
+ notShadowLevel = 1.;
|
|
|
+ }
|
|
|
+ shadowedOnlyLightDiffuseContribution *= notShadowLevel;
|
|
|
+ #endif
|
|
|
|
|
|
- #ifdef SPECULARTERM
|
|
|
- lightSpecularContribution += info.specular * notShadowLevel;
|
|
|
+ #ifdef SPECULARTERM
|
|
|
+ lightSpecularContribution += info.specular * notShadowLevel;
|
|
|
+ #endif
|
|
|
#endif
|
|
|
#endif
|