mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 08:15:44 +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* ShaderFeatureGLSL::getOutTexCoord( const char *name,
|
|||
texCoord->setStructName( "OUT" );
|
||||
texCoord->setType( type );
|
||||
|
||||
// create detail variable
|
||||
Var* tileScale = new Var;
|
||||
tileScale->setType("vec2");
|
||||
tileScale->setName("tileScale");
|
||||
tileScale->uniform = true;
|
||||
tileScale->constSortPos = cspPotentialPrimitive;
|
||||
|
||||
if( useTexAnim )
|
||||
{
|
||||
inTex->setType( "vec4" );
|
||||
|
|
@ -377,15 +384,15 @@ Var* ShaderFeatureGLSL::getOutTexCoord( const char *name,
|
|||
|
||||
// Statement allows for casting of different types which
|
||||
// eliminates vector truncation problems.
|
||||
String statement = String::ToString( " @ = %s(tMul(@, @).xy);\r\n", type );
|
||||
meta->addStatement( new GenOp( statement , texCoord, texMat, inTex ) );
|
||||
String statement = String::ToString( " @ = %s(tMul(@, @).xy * @);\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