mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +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
|
|
@ -2235,6 +2235,22 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
|
|||
lightSpotParams->arraySize = 4;
|
||||
lightSpotParams->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
Var* hasVectorLight = new Var("hasVectorLight", "int");
|
||||
hasVectorLight->uniform = true;
|
||||
hasVectorLight->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
Var* vectorLightDirection = new Var("vectorLightDirection", "float4");
|
||||
vectorLightDirection->uniform = true;
|
||||
vectorLightDirection->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
Var* vectorLightColor = new Var("vectorLightColor", "float4");
|
||||
vectorLightColor->uniform = true;
|
||||
vectorLightColor->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
Var* vectorLightBrightness = new Var("vectorLightBrightness", "float");
|
||||
vectorLightBrightness->uniform = true;
|
||||
vectorLightBrightness->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
Var* surface = getSurface(componentList, meta, fd);
|
||||
if (!surface)
|
||||
{
|
||||
|
|
@ -2253,8 +2269,9 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
|
|||
|
||||
Var* lighting = new Var("lighting", "float4");
|
||||
meta->addStatement(new GenOp(" @ = compute4Lights( @, @, @, @,\r\n"
|
||||
" @, @, @);\r\n",
|
||||
new DecOp(lighting), surface, lightMask, inLightPos, inLightConfigData, inLightColor, inLightSpotDir, lightSpotParams));
|
||||
" @, @, @, @, @, @, @);\r\n",
|
||||
new DecOp(lighting), surface, lightMask, inLightPos, inLightConfigData, inLightColor, inLightSpotDir, lightSpotParams,
|
||||
hasVectorLight, vectorLightDirection, vectorLightColor, vectorLightBrightness));
|
||||
|
||||
meta->addStatement(new GenOp(" @.rgb += @.rgb;\r\n", curColor, lighting));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue