Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AbrahamR, AndrewAMD), 1,305 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simple texture scaling #30050
07/08/04 05:46
07/08/04 05:46
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline OP
Expert
Marco_Grubert  Offline OP
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
There were no responses in the German thread so let's try it in English:
I am trying to scale/tile an entity's skin during runtime. The following code is what I thought should work, but despite not creating any errors it does not affect the scale at all :
Code:

function mtl_scale_init;
material mtl_scale
{
event=mtl_scale_init; // init function
effect="
texture entSkin1; // first entity skin
matrix matmtl; // default texture matrix

// default technique
technique scaleTex
{
pass P0
{
// bind skin to tex1 and modulate with color
Texture[0] = <entSkin1>;
//use texture matrix
TexCoordIndex[0]=0;
TextureTransform[0]=<matmtl>;
TextureTransformFlags[0] = Count2; //2d texture
AddressU[0]=wrap;
AddressV[0]=wrap;
ColorArg1[0] = Diffuse; //just a lit texture
ColorOp[0] = Modulate2x;
ColorArg2[0] = Texture;
}
}
";
}

// init function sets scaling
function mtl_scale_init
{
mtl_scale.matrix11=float(8); // *8 in u,v direction
mtl_scale.matrix22=float(8);
}


When replacing
Code:
TextureTransform[0]=<matmtl>;


with the resulting matrix though it works as expected:
Code:
TextureTransform[0]=
{8,0,0,0,0,8,0,0,
0,0,0,0,0,0,0,0 };


Why ?

Re: Simple texture scaling [Re: Marco_Grubert] #30051
07/08/04 06:34
07/08/04 06:34
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
Change your "matmtl" to "matMtl". Seems it is case-sensitive.


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: Simple texture scaling [Re: qwerty823] #30052
07/13/04 08:37
07/13/04 08:37
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline OP
Expert
Marco_Grubert  Offline OP
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
How odd.
Thanks for the help !


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1