mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Added in needed normal map processing for preview render
This commit is contained in:
parent
85a9a9b608
commit
16438e1ab3
1 changed files with 4 additions and 1 deletions
|
|
@ -420,7 +420,10 @@ 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 );
|
||||||
meta->addStatement( new GenOp( " @ = mul( @, normalize( @ ) );\r\n", outNormal, objTrans, inNormal ) );
|
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));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue