mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 14:44:36 +00:00
Add blend contrast slider
This commit is contained in:
parent
6f23dd191d
commit
1ffec9ab56
7 changed files with 152 additions and 29 deletions
|
|
@ -1425,6 +1425,16 @@ void TerrainHeightMapBlendHLSL::processPix(Vector<ShaderComponent*>& componentLi
|
|||
blendDepth->constSortPos = cspPrimitive;
|
||||
}
|
||||
|
||||
Var* blendContrast = (Var*)LangElement::find(String::ToString("blendContrast%d", idx));
|
||||
if (!blendContrast)
|
||||
{
|
||||
blendContrast = new Var;
|
||||
blendContrast->setType("float");
|
||||
blendContrast->setName(String::ToString("blendContrast%d", idx));
|
||||
blendContrast->uniform = true;
|
||||
blendContrast->constSortPos = cspPrimitive;
|
||||
}
|
||||
|
||||
Var* detailH = (Var*)LangElement::find(String::ToString("detailH%d", idx));
|
||||
if (!detailH)
|
||||
{
|
||||
|
|
@ -1445,6 +1455,10 @@ void TerrainHeightMapBlendHLSL::processPix(Vector<ShaderComponent*>& componentLi
|
|||
meta->addStatement(new GenOp(" @ = clamp(0.5 + @, 0.0, 1.0);\r\n",
|
||||
detailH, blendDepth));
|
||||
}
|
||||
|
||||
meta->addStatement(new GenOp(" @ = ((@ - 0.5f) * max(@, 0.0f)) + 0.5f;\r\n",
|
||||
detailH, detailH, blendContrast));
|
||||
|
||||
meta->addStatement(new GenOp(" }\r\n"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue