Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 7th_zorro), 1,203 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Different Matrices in FFP #68385
03/27/06 13:47
03/27/06 13:47
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline 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 Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Have no one an idea?

Re: Different Matrices in FFP [Re: oliver2s] #68387
03/28/06 14:13
03/28/06 14:13
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
I'm not sure what you want...


Sphere Engine--the premier A6 graphics plugin.
Re: Different Matrices in FFP [Re: Matt_Aufderheide] #68388
03/28/06 14:42
03/28/06 14:42
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
All 4 textures which are yellow-marked are scaled by one matrix. But I want that I can scale every of the 4 textures differently by C-Script, not only one value for all textures.

Re: Different Matrices in FFP [Re: oliver2s] #68389
03/29/06 08:34
03/29/06 08:34
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
i dont know whats possible using the ffp, but cant you use the material skills for passing those changed values?


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: Different Matrices in FFP [Re: ello] #68390
03/29/06 12:03
03/29/06 12:03
Joined: Oct 2000
Posts: 1,543
Germany
A
Alexander Esslinger Offline
Senior Developer
Alexander Esslinger  Offline
Senior Developer
A

Joined: Oct 2000
Posts: 1,543
Germany
You have two different matrices to choose from in your effect, that's matMtl and matEffect (in beta). Changing their values between passes is not possible - thus you can only change two fixed function texture-coordinates in realtime. Anyway, you can still enter the matrices directly, like you did in your last pass.

What you could try (I'm not sure if it works), is entering the matrix directly and use the vecSkill-vectors for the _m11 and _m22 entries.

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 Offline OP
Expert
oliver2s  Offline 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".

Re: Different Matrices in FFP [Re: oliver2s] #68392
03/29/06 17:57
03/29/06 17:57
Joined: Oct 2000
Posts: 1,543
Germany
A
Alexander Esslinger Offline
Senior Developer
Alexander Esslinger  Offline
Senior Developer
A

Joined: Oct 2000
Posts: 1,543
Germany
Then changing more than two matricis in realtime does not work.

Re: Different Matrices in FFP [Re: Alexander Esslinger] #68393
03/29/06 18:18
03/29/06 18:18
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Hmm oke....but thanks for your help.

Re: Different Matrices in FFP [Re: oliver2s] #68394
04/01/06 19:37
04/01/06 19:37
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Rhuarc Offline
Expert
Rhuarc  Offline
Expert

Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
use <mtlSkill1> I think... I've done this before....

-Rhuarc


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1