mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-19 19:35:26 +00:00
Add vector light support to forward materials.
This commit is contained in:
parent
38b0d0f1fe
commit
ebe2c2dead
11 changed files with 96 additions and 4 deletions
|
|
@ -240,7 +240,11 @@ float4 compute4Lights( Surface surface,
|
|||
float4 inLightConfigData[4],
|
||||
float4 inLightColor[4],
|
||||
float4 inLightSpotDir[4],
|
||||
float4 lightSpotParams[4] )
|
||||
float4 lightSpotParams[4],
|
||||
int hasVectorLight,
|
||||
float4 vectorLightDirection,
|
||||
float4 vectorLightingColor,
|
||||
float vectorLightBrightness )
|
||||
{
|
||||
float3 finalLighting = 0.0.xxx;
|
||||
|
||||
|
|
@ -280,6 +284,17 @@ float4 compute4Lights( Surface surface,
|
|||
}
|
||||
finalLighting += lighting;
|
||||
}
|
||||
|
||||
//Vector light
|
||||
[branch]
|
||||
if(hasVectorLight)
|
||||
{
|
||||
SurfaceToLight surfaceToVecLight = createSurfaceToLight(surface, -vectorLightDirection.xyz);
|
||||
|
||||
float3 vecLighting = getDirectionalLight(surface, surfaceToVecLight, vectorLightingColor.rgb, vectorLightBrightness, 1);
|
||||
finalLighting += vecLighting;
|
||||
}
|
||||
|
||||
finalLighting *= shadowMask.rgb;
|
||||
|
||||
return float4(finalLighting,1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue