2 registered members (VoroneTZ, 7th_zorro),
1,071
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Different Matrices in FFP
#68385
03/27/06 13:47
03/27/06 13:47
|
Joined: Aug 2002
Posts: 3,258 Mainz
oliver2s
OP
Expert
|
OP
Expert
Joined: Aug 2002
Posts: 3,258
Mainz
|
I have this Code: Code:
TEXTURE entSkin1; //Blendmap1 TEXTURE entSkin2; //Blendmap1 TEXTURE entSkin3; //Blendmap1 TEXTURE entSkin4; //Shadowmap
TEXTURE mtlSkin1; TEXTURE mtlSkin2; TEXTURE mtlSkin3; TEXTURE mtlSkin4;
matrix matMtl;
technique ffp_terrain_tex { pass P0 ////////////////////////////////////////////////////// //// Lets lay the first TEXTURE down. no alpha work //// This will tile across the entire HMP ////////////////////////////////////////////////////// { alphablendenable=false; alphatestenable=false; //zenable=true; //zwriteenable=true; //////////////////////////////////////// // Stage 0 ///////////////////////////////////////
TEXTURE[0] = <mtlSkin4>;
magFilter[0]=linear; minFilter[0]=linear; mipFilter[0]=linear; zenable=true; zwriteenable=true;
magFilter[0]=linear; minFilter[0]=linear; mipFilter[0]=linear; TEXTURETransformFlags[0] = Count2; TextureTransform[0]=<matMtl>; texcoordindex[0]=1;
COLORARG1[0] = TEXTURE; ColorOp[0] = MODULATE; ALPHAARG1[0] = CURRENT | ALPHAREPLICATE; alphaop[0]=disable; ////////////////////////////////////// //stage 1 //////////////////////////////////////
colorop[1]=disable; alphaop[1]=disable; }
pass P1 ////////////////////////////////////////////////////// //// Now we blend another TEXTURE using an alphamap //// This TEXTURE will be blended ////////////////////////////////////////////////////// { ////////////////////////////////////// // Stage 0 - Setup the alphamap //////////////////////////////////////
// We need to enable alphablending alphablendenable=true; srcblend=srcalpha; destblend=invsrcalpha; // AlphaTestEnable uses the AlphaRef and AlphaFunc to // determine which pixels get drawn. // In this case, anything greater that 0 will be drawn. alphatestenable=true; alpharef=0x00000000; //Reference Value alphafunc=Greater; //Comparison Function TEXTURE[0] = <entSkin1>;
magFilter[0]=linear; minFilter[0]=linear; mipFilter[0]=linear; // // We don't want the alphamap to tile // TEXTURETransformFlags[0] = disable; texcoordindex[0]=0; COLORARG1[0] = CURRENT; ColorOp[0] = SELECTARG1; ALPHAARG1[0] = TEXTURE | ALPHAREPLICATE; alphaop[0]=selectarg1;
////////////////////////////////////////////// // Stage 1 -- This is the TEXTURE to splat //////////////////////////////////////////////
TEXTURE[1] = <mtlSkin1>;
// Zenable is supposed to default to true. // This enables depth testing to determine what pixels // are visible to the viewer //zenable=true; //zwriteenable=true;
magFilter[1]=linear; minFilter[1]=linear; mipFilter[1]=linear; TEXTURETransformFlags[1] = Count2; TextureTransform[1]=<matMtl>; texcoordindex[1]=1;
COLORARG1[1] = TEXTURE; ColorOp[1] = MODULATE; ALPHAARG1[1] = CURRENT | ALPHAREPLICATE; alphaop[1]=disable; /////////////////////////////////////////////// // Stage 2 /////////////////////////////////////////////// colorop[2]=disable; alphaop[2]=disable; }
pass P2 //////////////////////////////////////////////////// //// A ditto of Pass p1 but with different a different //// TEXTURE and alphamap /////////////////////////////////////////////////// { //////////////////////////////////////// // Stage 0 ////////////////////////////////////////
alphablendenable=true; srcblend=srcalpha; destblend=invsrcalpha; alphatestenable=true; alpharef=0x00000000; alphafunc=Greater; TEXTURE[0] = <entSkin2>; magFilter[0]=linear; minFilter[0]=linear; mipFilter[0]=linear; TEXTURETransformFlags[0] = disable; texcoordindex[0]=0; COLORARG1[0] = CURRENT; ColorOp[0] = selectarg1; ALPHAARG1[0] = TEXTURE | ALPHAREPLICATE; alphaop[0]=selectarg1;
///////////////////////////////////////// // Stage 1 ///////////////////////////////////////// TEXTURE[1] = <mtlSkin2>;
//zenable=true; //zwriteenable=true; magFilter[1]=linear; minFilter[1]=linear; mipFilter[1]=linear; TEXTURETransformFlags[1] = Count2; TextureTransform[1]=<matMtl>; texcoordindex[1]=1;
COLORARG1[1] = TEXTURE; ColorOp[1] = modulate; ALPHAARG1[1] = CURRENT | ALPHAREPLICATE; alphaop[1]=disable; //////////////////////////////////////// // Stage 2 //////////////////////////////////////// colorop[2]=disable; alphaop[2]=disable;
} // End of Pass P2
pass P3 //////////////////////////////////////////////////// //// A ditto of Pass p1 but with different a different //// TEXTURE and alphamap /////////////////////////////////////////////////// { //////////////////////////////////////// // Stage 0 ////////////////////////////////////////
alphablendenable=true; srcblend=srcalpha; destblend=invsrcalpha; alphatestenable=true; alpharef=0x00000000; alphafunc=Greater; TEXTURE[0] = <entSkin3>; magFilter[0]=linear; minFilter[0]=linear; mipFilter[0]=linear; TEXTURETransformFlags[0] = disable; texcoordindex[0]=1; COLORARG1[0] = CURRENT; ColorOp[0] = selectarg1; ALPHAARG1[0] = TEXTURE | ALPHAREPLICATE; alphaop[0]=selectarg1;
///////////////////////////////////////// // Stage 1 ///////////////////////////////////////// TEXTURE[1] = <mtlSkin3>;
//zenable=true; //zwriteenable=true; magFilter[1]=linear; minFilter[1]=linear; mipFilter[1]=linear; TEXTURETransformFlags[1] = Count2; TextureTransform[1]=<matMtl>; texcoordindex[1]=0;
COLORARG1[1] = TEXTURE; ColorOp[1] = modulate; ALPHAARG1[1] = CURRENT | ALPHAREPLICATE; alphaop[1]=disable; //////////////////////////////////////// // Stage 2 //////////////////////////////////////// colorop[2]=disable; alphaop[2]=disable;
} // End of Pass P3 pass p4 { alphablendenable=true; srcblend=zero; destblend=srccolor; //zenable=true; // zwriteenable=true; ditherenable=true; COLORARG1[0] = DIFFUSE; ColorOp[0] = Modulate2x; ColorArg2[0] = Current; alphaop[0]=disable; Texture[1] = <entSkin4>; magFilter[1]=linear; minFilter[1]=linear; mipFilter[1]=linear; COLORARG1[1] = TEXTURE; ColorOp[1] = Modulate2x; TexCoordIndex[1]=0; TextureTransformFlags[1]=Count2; TextureTransform[1]= { 1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0 }; } } I want to change the u v of EACH of the yellow-marked lines. But how can I use different matrices to change every texture scale ones? Code:
TextureTransform[1]= { 1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0 };
|
|
|
Re: Different Matrices in FFP
[Re: oliver2s]
#68386
03/28/06 13:45
03/28/06 13:45
|
Joined: Aug 2002
Posts: 3,258 Mainz
oliver2s
OP
Expert
|
OP
Expert
Joined: Aug 2002
Posts: 3,258
Mainz
|
|
|
|
Re: Different Matrices in FFP
[Re: Alexander Esslinger]
#68391
03/29/06 16:50
03/29/06 16:50
|
Joined: Aug 2002
Posts: 3,258 Mainz
oliver2s
OP
Expert
|
OP
Expert
Joined: Aug 2002
Posts: 3,258
Mainz
|
I have now typed the matrix directly in the effect-string. This works fine: Code:
float4x4 matScale1 = float4x4(1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0);
But with this: Code:
float mtlSkill1;
float4x4 matScale1 = float4x4(mtlSkill1,0,0,0,0,mtlSkill1,0,0,0,0,0,0,0,0,0,0);
I get an error: "'matScale1': initial value must be a literal expression".
|
|
|
|