mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Merge pull request #1027 from bpay/ambient-normals
Allow normals on shadowed surfaces
This commit is contained in:
commit
84d072f25c
4 changed files with 4 additions and 2 deletions
|
|
@ -36,6 +36,7 @@ uniform float4 inLightColor[4];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uniform float4 ambient;
|
uniform float4 ambient;
|
||||||
|
#define ambientCameraFactor 0.3
|
||||||
uniform float specularPower;
|
uniform float specularPower;
|
||||||
uniform float4 specularColor;
|
uniform float4 specularColor;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ float4 main( FarFrustumQuadConnectP IN,
|
||||||
|
|
||||||
float Sat_NL_Att = saturate( dotNL * shadowed ) * lightBrightness;
|
float Sat_NL_Att = saturate( dotNL * shadowed ) * lightBrightness;
|
||||||
float3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
|
float3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
|
||||||
float4 addToResult = lightAmbient;
|
float4 addToResult = (lightAmbient * (1 - ambientCameraFactor)) + ( lightAmbient * ambientCameraFactor * saturate(dot(normalize(-IN.vsEyeRay), normal)) );
|
||||||
|
|
||||||
// TODO: This needs to be removed when lightmapping is disabled
|
// TODO: This needs to be removed when lightmapping is disabled
|
||||||
// as its extra work per-pixel on dynamic lit scenes.
|
// as its extra work per-pixel on dynamic lit scenes.
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ uniform float4 inLightColor[4];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uniform float4 ambient;
|
uniform float4 ambient;
|
||||||
|
#define ambientCameraFactor 0.3
|
||||||
uniform float specularPower;
|
uniform float specularPower;
|
||||||
uniform float4 specularColor;
|
uniform float4 specularColor;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ float4 main( FarFrustumQuadConnectP IN,
|
||||||
|
|
||||||
float Sat_NL_Att = saturate( dotNL * shadowed ) * lightBrightness;
|
float Sat_NL_Att = saturate( dotNL * shadowed ) * lightBrightness;
|
||||||
float3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
|
float3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
|
||||||
float4 addToResult = lightAmbient;
|
float4 addToResult = (lightAmbient * (1 - ambientCameraFactor)) + ( lightAmbient * ambientCameraFactor * saturate(dot(normalize(-IN.vsEyeRay), normal)) );
|
||||||
|
|
||||||
// TODO: This needs to be removed when lightmapping is disabled
|
// TODO: This needs to be removed when lightmapping is disabled
|
||||||
// as its extra work per-pixel on dynamic lit scenes.
|
// as its extra work per-pixel on dynamic lit scenes.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue