ok ive gotten environmental bump mapping to work.. here is the code:

Code:
function mtl_env_view()
{
mat_set(mtl.matrix,matViewInv);
// reset the translation part of the matrix
mtl.matrix41 = 0;
mtl.matrix42 = 0;
mtl.matrix43 = 0;

// mat_scale(mtl.matrix,0.5,0.5,0.5);
}

function mtl_water_init
{
vec_set(mtl.emissive_blue,mat_model.emissive_blue);
vec_set(mtl.ambient_blue,mat_model.ambient_blue);
vec_set(mtl.diffuse_blue,mat_model.diffuse_blue);
vec_set(mtl.specular_blue,mat_model.specular_blue);
mtl.power=mat_model.power;
mtl.albedo=mat_model.albedo;
bmap_to_cubemap(mtl.skin3);
mtl.enable_render=on;
mtl.event=mtl_env_view;
}

bmap water = <water_1.tga>;
bmap caustic = <water_1_caustic.tga>;
bmap enviromap = <envmap+6.tga>;

material mat_water
{
event=mtl_water_init;
skin1=water;
skin2=caustic;
skin3=enviromap;

effect=
"
texture mtlSkin1;
texture mtlSkin2;
texture mtlSkin3;
matrix matMtl;
matrix matWorld;

technique envcube
{
pass p0
{
Lighting = True;
SpecularEnable = True;

ADDRESSU[0]=wrap;
ADDRESSV[0]=wrap;
ADDRESSU[1]=wrap;
ADDRESSV[1]=wrap;
ADDRESSU[2]=wrap;
ADDRESSV[2]=wrap;


// Stage0
MinFilter[0] = Linear;
MagFilter[0] = Linear;
MipFilter[0] = Point;


Texture[0] = <mtlSkin1>;
//TextureTransform[0] = <matWorld>;
//TextureTransformFlags[0] = Count2;

ColorOp[0] = SelectArg1;
ColorArg1[0] = Texture;
AlphaOp[0] = SelectArg2;
AlphaArg2[0] = Current;

// Stage1
MinFilter[1] = Linear;
MagFilter[1] = Linear;
MipFilter[1] = Point;

Texture[1] = <mtlSkin2>;
// TextureTransform[1] = <matWorld>;
// TextureTransformFlags[1] = Count2;

ColorOp[1] = bumpenvmap;
ColorArg1[1] = Texture;
ColorArg2[1] = Current;
AlphaOp[1] = SelectArg2;
AlphaArg2[1] = Current;


// Stage2
MinFilter[2] = Linear;
MagFilter[2] = Linear;
MipFilter[2] = Point;

Texture[2] = <mtlSkin3>;
TextureTransform[2] = <matMtl>;
TextureTransformFlags[2] = Count3;
TexCoordIndex[2] = cameraspacereflectionvector;

ColorOp[2] = modulate;
ColorArg1[2] = Texture;
ColorArg2[2] = Current;
AlphaOp[2] = SelectArg2;
AlphaArg2[2] = Current;


}
}
";
}




Sphere Engine--the premier A6 graphics plugin.