From a5755be6819edf703b2d43289eaf338ebb82e774 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Tue, 6 Dec 2016 23:30:35 -0600 Subject: [PATCH] factoring in tangentW casues parallax (but not normals) to swap specular highlight directions. removed that, as well as a prior attempted workaround. --- Engine/source/shaderGen/GLSL/bumpGLSL.cpp | 8 -------- Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp | 2 -- Engine/source/shaderGen/HLSL/bumpHLSL.cpp | 8 -------- Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp | 2 -- 4 files changed, 20 deletions(-) diff --git a/Engine/source/shaderGen/GLSL/bumpGLSL.cpp b/Engine/source/shaderGen/GLSL/bumpGLSL.cpp index 56c8907e5..bc11a156f 100644 --- a/Engine/source/shaderGen/GLSL/bumpGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/bumpGLSL.cpp @@ -291,14 +291,6 @@ void ParallaxFeatGLSL::processVert( Vector &componentList, meta->addStatement( new GenOp( " @ = tMul( @, float3( @.xyz - @ ) );\r\n", outNegViewTS, objToTangentSpace, inPos, eyePos ) ); - // TODO: I'm at a loss at why i need to flip the binormal/y coord - // to get a good view vector for parallax. Lighting works properly - // with the TS matrix as is... but parallax does not. - // - // Someone figure this out! - // - meta->addStatement( new GenOp( " @.y = -@.y;\r\n", outNegViewTS, outNegViewTS ) ); - // If we have texture anim matrix the tangent // space view vector may need to be rotated. Var *texMat = (Var*)LangElement::find( "texMat" ); diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index cabedc14c..bada5d53d 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -67,8 +67,6 @@ LangElement * ShaderFeatureGLSL::setupTexSpaceMat( Vector &, / { 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 ) ); } diff --git a/Engine/source/shaderGen/HLSL/bumpHLSL.cpp b/Engine/source/shaderGen/HLSL/bumpHLSL.cpp index ee34f3e66..f6beb4cfc 100644 --- a/Engine/source/shaderGen/HLSL/bumpHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/bumpHLSL.cpp @@ -323,14 +323,6 @@ void ParallaxFeatHLSL::processVert( Vector &componentList, meta->addStatement( new GenOp( " @ = mul( @, float3( @.xyz - @ ) );\r\n", outNegViewTS, objToTangentSpace, inPos, eyePos ) ); - // TODO: I'm at a loss at why i need to flip the binormal/y coord - // to get a good view vector for parallax. Lighting works properly - // with the TS matrix as is... but parallax does not. - // - // Someone figure this out! - // - meta->addStatement( new GenOp( " @.y = -@.y;\r\n", outNegViewTS, outNegViewTS ) ); - // If we have texture anim matrix the tangent // space view vector may need to be rotated. Var *texMat = (Var*)LangElement::find( "texMat" ); diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index e37b23a9b..9172de6fa 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -67,8 +67,6 @@ LangElement * ShaderFeatureHLSL::setupTexSpaceMat( Vector &, / { 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 ) ); }