mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 05:50:31 +00:00
preliminary glowmap+glowmul feature augmentation math
This commit is contained in:
parent
f284524dd0
commit
070a9845a2
6 changed files with 22 additions and 2 deletions
|
|
@ -83,7 +83,7 @@ void PBRConfigMapHLSL::processPix( Vector<ShaderComponent*> &componentList, cons
|
|||
pbrConfigMapTex->uniform = true;
|
||||
pbrConfigMapTex->texture = true;
|
||||
pbrConfigMapTex->constNum = pbrConfigMap->constNum;
|
||||
LangElement *texOp = new GenOp(" @.Sample(@, @)", pbrConfigMapTex, pbrConfigMap, texCoord);
|
||||
LangElement *texOp = new GenOp("@.Sample(@, @)", pbrConfigMapTex, pbrConfigMap, texCoord);
|
||||
|
||||
Var *metalness = (Var*)LangElement::find("metalness");
|
||||
if (!metalness) metalness = new Var("metalness", "float");
|
||||
|
|
@ -103,6 +103,21 @@ void PBRConfigMapHLSL::processPix( Vector<ShaderComponent*> &componentList, cons
|
|||
}
|
||||
meta->addStatement(new GenOp(" @ = @.g;\r\n", new DecOp(ao), pbrConfig));
|
||||
meta->addStatement(new GenOp(" @ = @.a;\r\n", new DecOp(metalness), pbrConfig));
|
||||
|
||||
if (fd.features[MFT_GlowMap])
|
||||
{
|
||||
Var* glowMul = new Var("glowMul", "float");
|
||||
glowMul->uniform = true;
|
||||
glowMul->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
ShaderFeature::OutputTarget targ = ShaderFeature::DefaultTarget;
|
||||
if (fd.features[MFT_isDeferred])
|
||||
targ = ShaderFeature::RenderTarget1;
|
||||
|
||||
Var* diffuseColor = (Var*)LangElement::find(getOutputTargetVarName(targ));
|
||||
if (diffuseColor)
|
||||
meta->addStatement(new GenOp(" @.rgb += @.rgb*float3(@,@,@)*@.aaa;\r\n", diffuseColor, diffuseColor, glowMul, glowMul, glowMul, texOp));
|
||||
}
|
||||
output = meta;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue