mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
Merge pull request #963 from Azaezel/alpha41/terrainNormSafety
terrain safeties
This commit is contained in:
commit
c1d417806a
|
|
@ -250,7 +250,7 @@ void TerrainBaseMapFeatGLSL::processVert( Vector<ShaderComponent*> &componentLis
|
|||
{
|
||||
Var* inNormal = (Var*)LangElement::find("normal");
|
||||
meta->addStatement(
|
||||
new GenOp(" @.z = dot( normalize( vec3( @.x, @.y, 0 ) ), vec3( 0, 1, 0 ) );\r\n",
|
||||
new GenOp(" @.z = abs(dot( normalize( vec3( @.x, @.y, 0.0001 ) ), vec3( 0, 1, 0 ) ));\r\n",
|
||||
outTex, inNormal, inNormal));
|
||||
meta->addStatement(
|
||||
new GenOp(" @.w = 1.0 - dot( normalize( @.xyz ), vec3( 0, 0, 1 ) );\r\n",
|
||||
|
|
@ -1300,7 +1300,7 @@ void TerrainHeightMapBlendGLSL::processPix(Vector<ShaderComponent*>& componentLi
|
|||
{
|
||||
Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", idx));
|
||||
Var* detailH = (Var*)LangElement::find(String::ToString("detailH%d", idx));
|
||||
meta->addStatement(new GenOp(" @ = (@-@.x)/(@.y-@.x);\r\n", detailH, detailH, heightRange, heightRange, heightRange));
|
||||
meta->addStatement(new GenOp(" @ = (@-@.x)/(@.y-@.x)-@.x;\r\n", detailH, detailH, heightRange, heightRange, heightRange));
|
||||
|
||||
}
|
||||
meta->addStatement(new GenOp("\r\n"));
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ void TerrainBaseMapFeatHLSL::processVert(Vector<ShaderComponent*>& componentList
|
|||
{
|
||||
Var* inNormal = (Var*)LangElement::find("normal");
|
||||
meta->addStatement(
|
||||
new GenOp(" @.z = dot( normalize( float3( @.x, @.y, 0 ) ), float3( 0, 1, 0 ) );\r\n",
|
||||
new GenOp(" @.z = abs(dot( normalize( float3( @.x, @.y, 0.0001 ) ), float3( 0, 1, 0 ) ));\r\n",
|
||||
outTex, inNormal, inNormal));
|
||||
meta->addStatement(
|
||||
new GenOp(" @.w = 1.0 - dot( normalize( @.xyz ), float3( 0, 0, 1 ) );\r\n",
|
||||
|
|
@ -1381,7 +1381,7 @@ void TerrainHeightMapBlendHLSL::processPix(Vector<ShaderComponent*>& componentLi
|
|||
{
|
||||
Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", idx));
|
||||
Var* detailH = (Var*)LangElement::find(String::ToString("detailH%d", idx));
|
||||
meta->addStatement(new GenOp(" @ = (@-@.x)/(@.y-@.x);\r\n", detailH, detailH, heightRange, heightRange, heightRange));
|
||||
meta->addStatement(new GenOp(" @ = (@-@.x)/(@.y-@.x)-@.x;\r\n", detailH, detailH, heightRange, heightRange, heightRange, heightRange));
|
||||
}
|
||||
meta->addStatement(new GenOp("\r\n"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue