Skip to content

Commit

Permalink
Merge pull request #1641 from rextimmy/dx11_accumulation_fix
Browse files Browse the repository at this point in the history
DX11 accumulation shadergen fix.
  • Loading branch information
Areloch committed Jun 9, 2016
2 parents b1b235a + 9201733 commit c77e20a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Engine/source/shaderGen/HLSL/accuFeatureHLSL.cpp
Expand Up @@ -65,7 +65,11 @@ void AccuTexFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,

// accu map
Var *accuMap = new Var;
accuMap->setType( "sampler2D" );
if (mIsDirect3D11)
accuMap->setType("SamplerState");
else
accuMap->setType("sampler2D");

accuMap->setName( "accuMap" );
accuMap->uniform = true;
accuMap->sampler = true;
Expand Down Expand Up @@ -166,7 +170,7 @@ void AccuTexFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
meta->addStatement( new GenOp( " @.z *= @*2.0;\r\n", accuVec, accuDirection ) );

// saturate based on strength
meta->addStatement( new GenOp( " @ = saturate( dot( @, @.xyz * pow(@, 5) ) );\r\n", plcAccu, bumpNorm, accuVec, accuStrength ) );
meta->addStatement( new GenOp( " @ = saturate( dot( @.xyz, @.xyz * pow(@, 5) ) );\r\n", plcAccu, bumpNorm, accuVec, accuStrength ) );

// add coverage
meta->addStatement( new GenOp( " @.a += (2 * pow(@/2, 5)) - 0.5;\r\n", accuPlc, accuCoverage ) );
Expand Down

0 comments on commit c77e20a

Please sign in to comment.