Fix to allow parallax mapping with dxtnm textures via the red channel.

This commit is contained in:
rextimmy 2014-07-03 17:56:47 +10:00
parent feec36731e
commit 3c56bf3a56
5 changed files with 52 additions and 8 deletions

View file

@ -345,8 +345,16 @@ void ParallaxFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
Var *normalMap = getNormalMapTex();
// Call the library function to do the rest.
meta->addStatement( new GenOp( " @.xy += parallaxOffset( @, @.xy, @, @ );\r\n",
texCoord, normalMap, texCoord, negViewTS, parallaxInfo ) );
if(fd.features.hasFeature( MFT_IsDXTnm, getProcessIndex() ))
{
meta->addStatement( new GenOp( " @.xy += parallaxOffsetDxtnm( @, @.xy, @, @ );\r\n",
texCoord, normalMap, texCoord, negViewTS, parallaxInfo ) );
}
else
{
meta->addStatement( new GenOp( " @.xy += parallaxOffset( @, @.xy, @, @ );\r\n",
texCoord, normalMap, texCoord, negViewTS, parallaxInfo ) );
}
// TODO: Fix second UV maybe?