/////////////////////////////////////////////////////////////////////////////////////////
envmap.fx
/////////////////////////////////////////////////////////////////////////////////////////
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique envmap
{
pass one
{
AddressU[0] = Clamp; // don't wrap around edges
AddressV[0] = Clamp;
TexCoordIndex[0] = CameraSpaceReflectionVector;
TextureTransformFlags[0] = Count3;
TextureTransform[0] = <matMtl>; // transform camera space back to world space
Texture[0] = <mtlSkin1>;
ColorArg1[0] = Texture;
ColorArg2[0] = Diffuse;
ColorOp[0] = Modulate2x;
Texture[1] = <entSkin1>;
TextureFactor = 0x40FFFFFF;
ColorArg1[1] = Texture;
ColorArg2[1] = Current;
ColorOp[1] = BlendFactorAlpha; // blend by 25% (= 0x40)
}
}
technique fallback { pass one { } }
///////////////////////////////////////////////////////////////////////////////////////////
#include<acknex.h>
#include <default.c>
ENTITY* ent;
int count = 1;
BMAP* tilesfloorDOT3 = "tilesfloorDOT3.tga";
MATERIAL* tilesfloor=
{
skin1 =tilesfloorDOT3;
flags=tangent;
}
action fass()
{
me.material =tilesfloor;
}
function fnloadShaders()
{
d3d_automaterial=1;
effect_load(tilesfloor,"envmap.fx");
wait(5);
}
function main()
{
video_screen=2;
level_load("small.hmp");
wait(3);
ent = ent_create ("Fass.mdl", vector(110,10,15), fass);
fnloadShaders();
while(1)
{
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
wait(1);
}
}
////////////////////////////////////////////////////////////////////////////////////////////
my textute file = "tilesfloorDOT3.tga";
i am using game Studio A7 engine.Am using the above code for applying texture using .fx file.I want to apply texture transformation to an object.
How do i do that in run time?
/////////////////////////////////////////////////