DeferredBumpFeat order of operations corrections

This commit is contained in:
Azaezel 2015-02-23 15:35:10 -06:00
parent 098fa19abb
commit ea29f5203d
2 changed files with 24 additions and 26 deletions

View file

@ -216,40 +216,39 @@ void DeferredRTLightingFeatGLSL::setTexData( Material::StageData &stageDat,
void DeferredBumpFeatGLSL::processVert( Vector<ShaderComponent*> &componentList, void DeferredBumpFeatGLSL::processVert( Vector<ShaderComponent*> &componentList,
const MaterialFeatureData &fd ) const MaterialFeatureData &fd )
{ {
if( fd.features[MFT_PrePassConditioner] ) if (fd.features[MFT_PrePassConditioner])
{ {
// There is an output conditioner active, so we need to supply a transform // There is an output conditioner active, so we need to supply a transform
// to the pixel shader. // to the pixel shader.
MultiLine *meta = new MultiLine; MultiLine *meta = new MultiLine;
// We need the view to tangent space transform in the pixel shader. // We need the view to tangent space transform in the pixel shader.
getOutViewToTangent( componentList, meta, fd ); getOutViewToTangent(componentList, meta, fd);
const bool useTexAnim = fd.features[MFT_TexAnim];
// Make sure there are texcoords // Make sure there are texcoords
if( !fd.features[MFT_Parallax] && !fd.features[MFT_DiffuseMap] ) if (!fd.features[MFT_Parallax] && !fd.features[MFT_DiffuseMap])
{ {
const bool useTexAnim = fd.features[MFT_TexAnim];
getOutTexCoord( "texCoord", getOutTexCoord("texCoord",
"vec2", "float2",
true, true,
useTexAnim, useTexAnim,
meta, meta,
componentList ); componentList);
if ( fd.features.hasFeature( MFT_DetailNormalMap ) )
addOutDetailTexCoord( componentList,
meta,
useTexAnim );
} }
if (fd.features.hasFeature(MFT_DetailNormalMap))
addOutDetailTexCoord(componentList,
meta,
useTexAnim);
output = meta; output = meta;
} }
else if ( fd.materialFeatures[MFT_NormalsOut] || else if (fd.materialFeatures[MFT_NormalsOut] ||
fd.features[MFT_ForwardShading] || fd.features[MFT_ForwardShading] ||
!fd.features[MFT_RTLighting] ) !fd.features[MFT_RTLighting])
{ {
Parent::processVert( componentList, fd ); Parent::processVert(componentList, fd);
return; return;
} }
else else

View file

@ -225,10 +225,10 @@ void DeferredBumpFeatHLSL::processVert( Vector<ShaderComponent*> &componentLis
// We need the view to tangent space transform in the pixel shader. // We need the view to tangent space transform in the pixel shader.
getOutViewToTangent( componentList, meta, fd ); getOutViewToTangent( componentList, meta, fd );
const bool useTexAnim = fd.features[MFT_TexAnim];
// Make sure there are texcoords // Make sure there are texcoords
if( !fd.features[MFT_Parallax] && !fd.features[MFT_DiffuseMap] ) if( !fd.features[MFT_Parallax] && !fd.features[MFT_DiffuseMap] )
{ {
const bool useTexAnim = fd.features[MFT_TexAnim];
getOutTexCoord( "texCoord", getOutTexCoord( "texCoord",
"float2", "float2",
@ -236,12 +236,11 @@ void DeferredBumpFeatHLSL::processVert( Vector<ShaderComponent*> &componentLis
useTexAnim, useTexAnim,
meta, meta,
componentList ); componentList );
if ( fd.features.hasFeature( MFT_DetailNormalMap ) )
addOutDetailTexCoord( componentList,
meta,
useTexAnim );
} }
if ( fd.features.hasFeature( MFT_DetailNormalMap ) )
addOutDetailTexCoord( componentList,
meta,
useTexAnim );
output = meta; output = meta;
} }