Added in needed normal map processing for preview render

This commit is contained in:
Areloch 2021-01-27 12:26:33 -06:00
parent 85a9a9b608
commit 16438e1ab3

View file

@ -420,6 +420,9 @@ void NormalsOutFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
{ {
// Transform the normal to world space. // Transform the normal to world space.
Var *objTrans = getObjTrans( componentList, fd.features[MFT_UseInstancing], meta ); Var *objTrans = getObjTrans( componentList, fd.features[MFT_UseInstancing], meta );
if (String::compare((const char*)objTrans->type, "float4x4") == 0)
meta->addStatement(new GenOp(" @ = mul( @, normalize( float4(@,0) ) ).xyz;\r\n", outNormal, objTrans, inNormal));
else
meta->addStatement(new GenOp(" @ = mul( @, normalize( @ ) );\r\n", outNormal, objTrans, inNormal)); meta->addStatement(new GenOp(" @ = mul( @, normalize( @ ) );\r\n", outNormal, objTrans, inNormal));
} }
else else