mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 14:44:36 +00:00
add material tileScale
by request
This commit is contained in:
parent
0fb68936f9
commit
c0ce94f32a
8 changed files with 32 additions and 9 deletions
|
|
@ -364,6 +364,13 @@ Var* ShaderFeatureHLSL::getOutTexCoord( const char *name,
|
|||
texCoord->setStructName( "OUT" );
|
||||
texCoord->setType( type );
|
||||
|
||||
// create detail variable
|
||||
Var* tileScale = new Var;
|
||||
tileScale->setType("float2");
|
||||
tileScale->setName("tileScale");
|
||||
tileScale->uniform = true;
|
||||
tileScale->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
if ( useTexAnim )
|
||||
{
|
||||
inTex->setType( "float2" );
|
||||
|
|
@ -377,15 +384,15 @@ Var* ShaderFeatureHLSL::getOutTexCoord( const char *name,
|
|||
|
||||
// Statement allows for casting of different types which
|
||||
// eliminates vector truncation problems.
|
||||
String statement = String::ToString(" @ = (%s)mul(@, float4(@,1,1));\r\n", type);
|
||||
meta->addStatement( new GenOp( statement, texCoord, texMat, inTex ) );
|
||||
String statement = String::ToString(" @ = (%s)mul(@, float4(@,1,1))*@;\r\n", type);
|
||||
meta->addStatement( new GenOp( statement, texCoord, texMat, inTex, tileScale) );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Statement allows for casting of different types which
|
||||
// eliminates vector truncation problems.
|
||||
String statement = String::ToString( " @ = (%s)@;\r\n", type );
|
||||
meta->addStatement( new GenOp( statement, texCoord, inTex ) );
|
||||
String statement = String::ToString( " @ = (%s)(@ * @);\r\n", type );
|
||||
meta->addStatement( new GenOp( statement, texCoord, inTex, tileScale) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue