No prob, man. Glad that you are taking a keen interest in these things Rigoletto.
Okay.... if it helps anyone else, here is some code to spark ideas.
What is it??:
An example to allow a bit of user interaction with a material effect applied to level geometry.
This example is very simple; It shows a bit of scaling and shifting of the block texture.
Code:
//////////////////////////////////////////////////
// Example of adjusting the material.matrix
// while using an FX file on _Level Geometry_.
// Enlists the help of a Starter Function to
// call additional functions.
//
// Here we adjust the scale with key 2, or key 4
// And also make it scroll in a direction.
//
// Eric Hendrickson-Lambert (Steempipe)
//
// 4/26/04: -Put into operation
//
// Todo: -Add more examples, etc.
// -Tighten up code
//
var d3d_automaterial=1;
//bind <ffp_scale.fx>;
// Material assignment for the level geometry
// The name of the texture in WED.
material floor_one
{
// Because my effect file is not too long,
// I will just use the effect string inside the material.
// NOTE: If you use <effect_load>, then take
// the effect string out of here.
effect = "
matrix matMtl;
texture entSkin1;
technique one
{
pass p0
{
Texture[0] = <entSkin1>;
TextureTransformFlags[0] = Count2;
TexCoordIndex[0]=0; //1
TextureTransform[0] = <matMtl>;
Colorop[0] = Modulate;
ColorArg1[0]=Texture;
ColorArg2[0] = Diffuse;
}
}
";
}
function load_shader()
{
//effect_load(floor_one,"ffp_scale.fx");
wait(1);
}
function scale_x2() {
floor_one.matrix11 = float(2);
floor_one.matrix22 = float(2);
};
function scale_x4() {
floor_one.matrix11 = float(4);
floor_one.matrix22 = float(4);
};
function scroll_tex() {
floor_one.skill1 -= time;
floor_one.matrix31 = floatd(floor_one.skill1,500);
floor_one.matrix32 = floatd(floor_one.skill1,500);
}
starter floor_init {
// Set a default texture scale
//
floor_one.matrix11 = float(1);
floor_one.matrix22 = float(1);
//floor_one.skill1 = 50;
// Pressing key 2 will scale texture x2
// Pressing key 4 will scale texture x4
while(1)
{
if (key_2) { scale_x2(); };
if (key_4) {scale_x4(); };
scroll_tex();
wait(1);
}
}