2 registered members (AndrewAMD, Ayumi),
853
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Projection texture (FFP)
[Re: Pappenheimer]
#315503
03/16/10 07:42
03/16/10 07:42
|
Joined: Aug 2008
Posts: 482
bart_the_13th
Senior Member
|
Senior Member
Joined: Aug 2008
Posts: 482
|
Try this material for your level blocks
//Apply this material to levelblocks
MATERIAL* mtl_pTexBlock =
{
effect = "
////////////////////////////////////////////////////////
// Projected texture (FFP) by Xd1Vo
// Adapted for level blocks by bart_the_13th
////////////////////////////////////////////////////////
float4x4 matEffect3;
texture mtlSkin1;
texture entSkin1;
texture entSkin2;
texture StencilMap;//I was planning to modulate the flashlight to the stencilmap too, but my A7E version doesnt allow it :P
technique proj_tex
{
pass p0
{
Texture[0] = <entSkin1>; // texture
Texture[1] = <entSkin2>; // light map
Texture[2] = <mtlSkin1>; // projected shadow/flashlight
FogEnable=1;
ColorArg1[0] = Texture;
ColorArg2[0] = Diffuse;
ColorOp[0] = Modulate; //use selectArg1 if not using dynamic lights
ResultArg[0] = Temp; //Temp = texture + diffuse
ColorArg1[1] = Texture;
ColorArg2[1] = Current;
ColorOp[1] = Modulate2X;
ColorArg1[2] = Texture;
ColorArg2[2] = Current;
ColorOp[2] = Add;
magfilter[2] = linear;
minfilter[2] = linear;
mipfilter[2] = linear;
AddressU[2] = BORDER;
AddressV[2] = BORDER;
BorderColor[2] = 0x000001;
texcoordindex[2] = cameraspaceposition ;
TextureTransformFlags[2] = count3 |projected;
TextureTransform[2] = <matEffect3>;
ColorArg1[3] = temp; // (shadow map + vertex lighting)
ColorArg2[3] = Current; // (color map + detail map)
ColorOp[3] = Modulate2X; // modulate (color map + detail map) with (shadow map + vertex lighting)
magfilter[3] = linear;
minfilter[3] = linear;
mipfilter[3] = linear;
}
}
";
}
/* Add these lines to main function
if(flashlite!=NULL)
{
create_dxmat(mat_effect3,flashlite.x,flashlite.pan,focus,mtl_pTexBlock.skin3); //eagle
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
*/
This one is a modififed pTex from XD1V0.
|
|
|
|