Hello Ello
I tried what you sent me via PM but A) I did it wrong, or B) it didn´t worked. Depending on the value the model was dark (ambient = -100) or not shaded (ambient=100) and transparent.
I am using this code:
bmap acube=<tropic+6.tga>;
function mtl_envmap_view()
{
mat_set(mtl.matrix,matViewInv);
mtl.matrix41=0;
mtl.matrix42=0;
mtl.matrix43=0;
}
function mtl_envmap_init()
{
//...maybe you should copy the mat_model properties here...
bmap_to_cubemap(mtl.skin1);
mtl.event=mtl_envmap_view;
mtl.enable_view=on;
}
material mtl_env1map
{
skin1=acube;
event=mtl_envmap_init;
effect=
"
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique envmap
{
pass p0
{
texture[0]=<entSkin1>;
texture[1]=<mtlSkin1>;
zWriteEnable=true;
alphaBlendEnable=false;
colorArg1[0]=Texture;
colorOp[0]=Modulate2x;
colorArg2[0]=Diffuse;
colorArg1[1]=Texture;
colorOp[1]=blendCurrentAlpha;
addressU[1]=Clamp;
addressV[1]=Clamp;
texCoordIndex[1]=cameraSpaceReflectionVector;
textureTransformFlags[1]=Count3;
textureTransform[1]=<matMtl>; // transform camera space back to world space
}
}
";
}
and this
material mtl_env2map
{
skin1=acube;
event=mtl_envmap_init;
effect=
"
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique envmap
{
pass p0
{
texture[0]=<entSkin1>;
texture[1]=<mtlSkin1>;
zWriteEnable=true;
alphaBlendEnable=false;
colorArg1[0]=Texture;
colorOp[0]=Modulate2x;
colorArg2[0]=Diffuse;
colorArg1[1]=Texture;
textureFactor=0x40FFFFFF; // -> C0=75%, 80=50%, 40=25% //delete this
colorOp[1]=blendFactorAlpha; //and this for alpha map
addressU[1]=Clamp;
addressV[1]=Clamp;
texCoordIndex[1]=cameraSpaceReflectionVector;
textureTransformFlags[1]=Count3;
textureTransform[1]=<matMtl>; // transform camera space back to world space
}
}
";
}
EX Citer