Posted By: XNASorcerer
Real enviroment refletion for cars? - 05/19/05 00:40
Hi.
I am using this to make a fake enviroment refletion in my cars.
Does anyone knows how can I make a real enviroment refletion for cars?
And why I can not have shadow with this?
Code:
I am using this to make a fake enviroment refletion in my cars.
Does anyone knows how can I make a real enviroment refletion for cars?
And why I can not have shadow with this?
Code:
bmap bmpcube = <enviroment.tga>;
function enviroment_shader_view()
{
mat_set(mtl.matrix,matViewInv);
mtl.matrix41=0;
mtl.matrix42=0;
mtl.matrix43=0;
}
function enviroment_shader_init()
{
bmap_to_cubemap(mtl.skin1);
mtl.event=enviroment_shader_view;
mtl.enable_view=on;
}
material enviroment_Shader
{
skin1=bmpcube;
event=enviroment_shader_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%
colorOp[1]=blendFactorAlpha;
addressU[1]=Clamp;
addressV[1]=Clamp;
texCoordIndex[1]=cameraSpaceReflectionVector;
textureTransformFlags[1]=Count3;
textureTransform[1]=<matMtl>; // transform camera space back to world space
}
}
";
}