mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #1428 from Azaezel/sgCleanups
clean up shadergen ambient handling
This commit is contained in:
commit
0546eae408
|
|
@ -2212,9 +2212,13 @@ void RTLightingFeatGLSL::processPix( Vector<ShaderComponent*> &componentList,
|
|||
|
||||
Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
|
||||
|
||||
Var *ambient = new Var( "ambient", "vec4" );
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
Var* ambient = (Var*)LangElement::find("ambient");
|
||||
if (!ambient)
|
||||
{
|
||||
ambient = new Var("ambient", "vec4");
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
}
|
||||
|
||||
Var* lighting = new Var("lighting", "vec4");
|
||||
meta->addStatement(new GenOp(" @ = compute4Lights( @, @, @, @,\r\n"
|
||||
|
|
@ -3091,9 +3095,9 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
|
|||
Var *ambient = (Var *)LangElement::find("ambient");
|
||||
if (!ambient)
|
||||
{
|
||||
ambient = new Var("ambient", "vec3");
|
||||
eyePos->uniform = true;
|
||||
eyePos->constSortPos = cspPass;
|
||||
ambient = new Var("ambient", "vec4");
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
}
|
||||
meta->addStatement(new GenOp(" @.rgb *= @.rgb;\r\n", ibl, ambient));
|
||||
meta->addStatement(new GenOp(" @.rgb = @.rgb;\r\n", curColor, ibl));
|
||||
|
|
|
|||
|
|
@ -2284,9 +2284,13 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
|
|||
|
||||
Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
|
||||
|
||||
Var *ambient = new Var( "ambient", "float4" );
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
Var* ambient = (Var*)LangElement::find("ambient");
|
||||
if (!ambient)
|
||||
{
|
||||
ambient = new Var("ambient", "float4");
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
}
|
||||
|
||||
Var* lighting = new Var("lighting", "float4");
|
||||
meta->addStatement(new GenOp(" @ = compute4Lights( @, @, @, @,\r\n"
|
||||
|
|
@ -3179,9 +3183,9 @@ void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList
|
|||
Var *ambient = (Var *)LangElement::find("ambient");
|
||||
if (!ambient)
|
||||
{
|
||||
ambient = new Var("ambient","float3");
|
||||
eyePos->uniform = true;
|
||||
eyePos->constSortPos = cspPass;
|
||||
ambient = new Var("ambient","float4");
|
||||
ambient->uniform = true;
|
||||
ambient->constSortPos = cspPass;
|
||||
}
|
||||
meta->addStatement(new GenOp(" @.rgb *= @.rgb;\r\n", ibl, ambient));
|
||||
meta->addStatement(new GenOp(" @.rgb = @.rgb;\r\n", curColor, ibl));
|
||||
|
|
|
|||
Loading…
Reference in a new issue