From 42e90ad3fb7cbb5b5fa9c78baa8875e4ea2e8d46 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 5 Oct 2021 14:46:37 -0500 Subject: [PATCH] RTLightingFeat work. 1) we do *not* in fact want to early out in the presence of MFT_ImposterVert. it mangles the position-send. 2) dx sucessfuly handles the if ( !fd.features[MFT_NormalMap] ) case, so use the same for gl --- Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp | 6 ++---- Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp | 3 --- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index 73bb56fd1..6df9a01bf 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -2070,7 +2070,6 @@ RTLightingFeatGLSL::RTLightingFeatGLSL() void RTLightingFeatGLSL::processVert( Vector &componentList, const MaterialFeatureData &fd ) { - if (fd.features[MFT_ImposterVert]) return; MultiLine *meta = new MultiLine; ShaderConnector *connectComp = dynamic_cast( componentList[C_CONNECTOR] ); @@ -2124,8 +2123,7 @@ void RTLightingFeatGLSL::processVert( Vector &componentList, // If there isn't a normal map then we need to pass // the world space normal to the pixel shader ourselves. - //Temporarily disabled while we figure out how to better handle normals without a normal map - /*if ( !fd.features[MFT_NormalMap] ) + if ( !fd.features[MFT_NormalMap] ) { Var *outNormal = connectComp->getElement( RT_TEXCOORD ); outNormal->setName( "wsNormal" ); @@ -2137,7 +2135,7 @@ void RTLightingFeatGLSL::processVert( Vector &componentList, // Transform the normal to world space. meta->addStatement( new GenOp( " @ = tMul( @, vec4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) ); - }*/ + } } diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index ecd4619d0..eae07aa95 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -2136,8 +2136,6 @@ RTLightingFeatHLSL::RTLightingFeatHLSL() void RTLightingFeatHLSL::processVert( Vector &componentList, const MaterialFeatureData &fd ) { - if (fd.features[MFT_ImposterVert]) return; - MultiLine *meta = new MultiLine; ShaderConnector *connectComp = dynamic_cast( componentList[C_CONNECTOR] ); @@ -2192,7 +2190,6 @@ void RTLightingFeatHLSL::processVert( Vector &componentList, // If there isn't a normal map then we need to pass // the world space normal to the pixel shader ourselves. - //Temporarily disabled while we figure out how to better handle normals without a normal map if ( !fd.features[MFT_NormalMap] ) { Var *outNormal = connectComp->getElement( RT_TEXCOORD );