mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Merge pull request #1641 from rextimmy/dx11_accumulation_fix
DX11 accumulation shadergen fix.
This commit is contained in:
commit
c77e20a9a9
1 changed files with 6 additions and 2 deletions
|
|
@ -65,7 +65,11 @@ void AccuTexFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
|
||||||
|
|
||||||
// accu map
|
// accu map
|
||||||
Var *accuMap = new Var;
|
Var *accuMap = new Var;
|
||||||
accuMap->setType( "sampler2D" );
|
if (mIsDirect3D11)
|
||||||
|
accuMap->setType("SamplerState");
|
||||||
|
else
|
||||||
|
accuMap->setType("sampler2D");
|
||||||
|
|
||||||
accuMap->setName( "accuMap" );
|
accuMap->setName( "accuMap" );
|
||||||
accuMap->uniform = true;
|
accuMap->uniform = true;
|
||||||
accuMap->sampler = true;
|
accuMap->sampler = true;
|
||||||
|
|
@ -166,7 +170,7 @@ void AccuTexFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
|
||||||
meta->addStatement( new GenOp( " @.z *= @*2.0;\r\n", accuVec, accuDirection ) );
|
meta->addStatement( new GenOp( " @.z *= @*2.0;\r\n", accuVec, accuDirection ) );
|
||||||
|
|
||||||
// saturate based on strength
|
// 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
|
// add coverage
|
||||||
meta->addStatement( new GenOp( " @.a += (2 * pow(@/2, 5)) - 0.5;\r\n", accuPlc, accuCoverage ) );
|
meta->addStatement( new GenOp( " @.a += (2 * pow(@/2, 5)) - 0.5;\r\n", accuPlc, accuCoverage ) );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue