add material tileScale

by request
This commit is contained in:
AzaezelX 2025-12-25 19:52:06 -06:00
parent 0fb68936f9
commit c0ce94f32a
8 changed files with 32 additions and 9 deletions

View file

@ -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) );
}
}