DeferredBumpFeat order of operations corrections. Clean.

This commit is contained in:
LuisAntonRebollo 2015-03-08 22:30:03 +01:00
parent 0325aaf5bb
commit ae3128b28b
2 changed files with 23 additions and 21 deletions

View file

@ -216,39 +216,40 @@ 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]; 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] )
{ {
getOutTexCoord("texCoord", getOutTexCoord( "texCoord",
"vec2", "vec2",
true, true,
useTexAnim, useTexAnim,
meta, meta,
componentList); componentList );
} }
if (fd.features.hasFeature(MFT_DetailNormalMap))
addOutDetailTexCoord(componentList, if ( fd.features.hasFeature( MFT_DetailNormalMap ) )
meta, addOutDetailTexCoord( componentList,
useTexAnim); 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

@ -237,10 +237,11 @@ void DeferredBumpFeatHLSL::processVert( Vector<ShaderComponent*> &componentLis
meta, meta,
componentList ); componentList );
} }
if ( fd.features.hasFeature( MFT_DetailNormalMap ) ) if ( fd.features.hasFeature( MFT_DetailNormalMap ) )
addOutDetailTexCoord( componentList, addOutDetailTexCoord( componentList,
meta, meta,
useTexAnim ); useTexAnim );
output = meta; output = meta;
} }