nonbreaking 'specularcolor' to 'pbrConfig' var conversion. (TODO: specularMap entries)

This commit is contained in:
AzaezelX 2019-04-29 19:40:22 -05:00
parent cd937fca30
commit 2b997d2d9c
8 changed files with 40 additions and 42 deletions

View file

@ -71,8 +71,8 @@ void DeferredSpecMapHLSL::processPix( Vector<ShaderComponent*> &componentList, c
specularMapTex->constNum = specularMap->constNum;
LangElement *texOp = new GenOp(" @.Sample(@, @)", specularMapTex, specularMap, texCoord);
Var *specularColor = (Var*)LangElement::find("specularColor");
if (!specularColor) specularColor = new Var("specularColor", "float4");
Var * pbrConfig = (Var*)LangElement::find("pbrConfig");
if (!pbrConfig) pbrConfig = new Var("pbrConfig", "float4");
Var *metalness = (Var*)LangElement::find("metalness");
if (!metalness) metalness = new Var("metalness", "float");
Var *smoothness = (Var*)LangElement::find("smoothness");
@ -84,8 +84,8 @@ void DeferredSpecMapHLSL::processPix( Vector<ShaderComponent*> &componentList, c
if (fd.features[MFT_InvertSmoothness])
meta->addStatement(new GenOp(" @ = 1.0-@;\r\n", smoothness, smoothness));
meta->addStatement(new GenOp(" @ = @.ggga;\r\n", new DecOp(specularColor), texOp));
meta->addStatement(new GenOp(" @.bga = float3(@,@.g,@);\r\n", material, smoothness, specularColor, metalness));
meta->addStatement(new GenOp(" @ = @.ggga;\r\n", new DecOp(pbrConfig), texOp));
meta->addStatement(new GenOp(" @.bga = float3(@,@.g,@);\r\n", material, smoothness, pbrConfig, metalness));
output = meta;
}