Skip to content

Commit

Permalink
Merge pull request #1856 from Azaezel/bitangentBlunder
Browse files Browse the repository at this point in the history
uts bitangent direction determinant back
  • Loading branch information
Areloch authored Dec 12, 2016
2 parents 6309495 + c6e2563 commit 274bfb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ LangElement * ShaderFeatureGLSL::setupTexSpaceMat( Vector<ShaderComponent*> &, /
{
if(dStricmp((char*)T->type, "vec4") == 0)
meta->addStatement( new GenOp( " tSetMatrixRow(@, 1, cross( @, normalize(@) ) * @.w);\r\n", *texSpaceMat, T, N, T ) );
else if(tangentW)
meta->addStatement( new GenOp( " tSetMatrixRow(@, 1, cross( @, normalize(@) ) * @);\r\n", *texSpaceMat, T, N, tangentW ) );
else
meta->addStatement( new GenOp( " tSetMatrixRow(@, 1, cross( @, normalize(@) ));\r\n", *texSpaceMat, T, N ) );
}
Expand Down
2 changes: 2 additions & 0 deletions Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ LangElement * ShaderFeatureHLSL::setupTexSpaceMat( Vector<ShaderComponent*> &, /
{
if(dStricmp((char*)T->type, "float4") == 0)
meta->addStatement( new GenOp( " @[1] = cross( @, normalize(@) ) * @.w;\r\n", *texSpaceMat, T, N, T ) );
else if (tangentW)
meta->addStatement(new GenOp(" @[1] = cross( @, normalize(@) ) * @;\r\n", *texSpaceMat, T, N, tangentW));
else
meta->addStatement( new GenOp( " @[1] = cross( @, normalize(@) );\r\n", *texSpaceMat, T, N ) );
}
Expand Down

0 comments on commit 274bfb2

Please sign in to comment.