Okay now i can map a cube but something is wropng with the texture...
see the script... the texture used is a simple texture:





//bmap bmp_envcube2 = <skycubesun+6.tga>; //cube image
bmap bmp_envcube2 = <water_shader.tga>; //a normal texture 2d

// generate a matrix that transforms camera space back to world space
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;
}

function mtl_env_init()
{
bmap_to_cubemap(mtl.skin1);

//bmap_to_uv(mtl.skin1);

mtl.event = mtl_env_view;
mtl.enable_view = on;
}

material mtl_envcube2 // environment cube
{
skin1 = bmp_envcube2;
event = mtl_env_init;
//skin1 = reptile; // set a reptile skin
effect=
"
texture mtlSkin1;
texture texSkin1;
matrix matMtl;
technique cubic_environment
{
pass p0
{
Texture[0]=<texSkin1>;
Texture[1]=<mtlSkin1>;
ColorArg1[0]=Texture;
ColorOp[0]=Modulate2x;
ColorArg2[0]=Diffuse;

ColorArg1[1]=Texture;
ColorOp[1]=AddSigned;
ColorArg2[1]=Current;

AddressU[1]=Clamp;
AddressV[1]=Clamp;
//TexCoordIndex[1]=CameraSpaceReflectionVector;
//TexCoordIndex[2]=cameraspaceposition | 1;


//TextureTransformFlags[1] =count3 | projected;
TextureTransformFlags[1]=Count3;
TextureTransform[1]=<matMtl>;


}
}
";

}



action shaders_A6_envcube2
{
my.material = mtl_envcube2;
}


Paste the script , and apply it to the terrain model (came with 3dgs)
///

Last edited by Unknot; 08/31/04 17:32.