I was sitting down to do some scaling and shifting.

Gstudio 6.31.4 Pro. When I ran into a situation where I could only scale the texture "hardcoded" into the effect file.

Here are (2) level blocks. Left one is using material floor_two. Right one is using material floor_one. They are identical texture images. They are only different in the way I attempt scaling.

Could you advise?? It follows.

Thanks,
Eric




Code:
 var d3d_automaterial=1;


function mtl_scale()
{

mtl.matrix11 = float(10);
mtl.matrix12 = float(0);
mtl.matrix13 = float(0);
mtl.matrix14 = float(0);

mtl.matrix21 = float(0);
mtl.matrix22 = float(10);
mtl.matrix23 = float(0);
mtl.matrix24 = float(0);

mtl.matrix31 = float(0);
mtl.matrix32 = float(0);
mtl.matrix33 = float(0);
mtl.matrix34 = float(0);

mtl.matrix41 = float(0);
mtl.matrix42 = float(0);
mtl.matrix43 = float(0);
mtl.matrix44 = float(0);

}

material floor_one
{

effect = "

texture entSkin1;

technique one
{

pass p0
{

Texture[0] = (entSkin1);
TextureTransformFlags[0] = Count2;

TextureTransform[0]=
{
10.0, 0.0, 0.0, 0.0,
0.0, 10.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0
};


Colorop[0] = Modulate;
ColorArg1[0]=Texture;
ColorArg2[0] = Diffuse;
ColorOp[1] = Disable;

}
}

";
}

//////////////////////////////////////////////////
// Material Floor_Two
//

material floor_two
{
event = mtl_scale;

effect = "

matrix matMtl;
texture entSkin1;

technique one
{

pass p0
{

Texture[0] = (entSkin1);
TextureTransformFlags[0] = Count2;

TextureTransform[0] = (matMtl);

Colorop[0] = Modulate;
ColorArg1[0]=Texture;
ColorArg2[0] = Diffuse;
ColorOp[1] = Disable;

}
}

";
}