Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,438 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 6 1 2 3 4 5 6
Re: @Steempipe (urgent) [Re: oliver2s] #25156
04/28/04 07:49
04/28/04 07:49
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
Okay. I changed most of my terrain. No big textures or so but I still get this dumb error message while your level works fine.


Follow me on twitter
Re: @Steempipe (urgent) [Re: mk_1] #25157
04/28/04 07:52
04/28/04 07:52
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline OP
Serious User
Steempipe  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Is this a "small" test level you have?? If so, could you get it to me, then I can explore what may be different. I had alot of crap go wrong before it went right for me, and usually it was something small.

Eric

Re: @Steempipe (urgent) [Re: Steempipe] #25158
04/28/04 08:18
04/28/04 08:18
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
send me your adress so I can send you my level.


Follow me on twitter
Re: @Steempipe (urgent) [Re: mk_1] #25159
01/07/05 00:27
01/07/05 00:27
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
Sorry to push this thread but it looks like the code doesn't work with 6.31.4/dx9c anymore. Could you please check it out?


Follow me on twitter
Re: @Steempipe (urgent) [Re: mk_1] #25160
01/07/05 04:50
01/07/05 04:50
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline OP
Serious User
Steempipe  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Here is the (2) texture version of the old code redone.

BTW: If you want to utilize HLSL, for more flexibility, then you can
modify code in this thread here.

Code:
 
///////////////////////////////////////////////////////////
// FFP Terrain MultiTexturing Effect
//
// Blending (2) Textures
//
// By: Eric A. Hendrickson-Lambert (Steempipe)
//
//
// 1/6/05: Update original code for MK_1
// to build with A6.31.4 & DX9.00c
//
//////////////////////////////////////////////////////////


//*****************************************************
//** I had strange results with putting the alphamaps
//** in to the HMP as entSkins.
//** Just load them as mtlSkins.
//*****************************************************

// RGB Channels are blank
// The A channel has the blending weight (pattern)
bmap blendmap = <blendmap.tga>; // Blender for Pass p1


//*****************************************************
//** entSkins 1-4 are tilable textures
//** Be sure to add mipmaps to them in MED
//*****************************************************


var Detail_Size = 0;


function mtl_terraintex_init()
{

bmap_to_mipmap(mtl.skin1);


//
// Adjust the texture transform to do some tiling of the textures
//

mtl.matrix11 = float(28); // default u scale
mtl.matrix22 = float(28); // default v scale

}

///////////////////////////////////////////////////////////////////////
//The Material
///////////////////////////////////////////////////////////////////////

material mat_terraintex
{

skin1 = blendmap;



// define a material effect string

event = mtl_terraintex_init;

effect =
"
matrix matMtl;

texture mtlSkin1; // Blending map for Pass P1

texture entSkin1; // Tileable Tex
texture entSkin2; // Tileable Tex




///////////////////////////////////////////////////////////////////////
//The Technique
///////////////////////////////////////////////////////////////////////

technique ffp_terrain_tex
{
pass P0
//////////////////////////////////////////////////////
//// Lets lay the first texture down. no alpha work
//////////////////////////////////////////////////////
{

AlphaBlendEnable=False;
AlphaTestEnable=False;

Lighting = True;

zEnable=True;
zWriteEnable=True;

////////////////////////////////////////
// Stage 0
///////////////////////////////////////

Texture[0] = <entSkin1>;

magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;

TextureTransformFlags[0] = Count2;
TextureTransform[0] = <matMtl>;
texcoordindex[0]=1;

ColorArg1[0] = Texture;
ColorOp[0] = Modulate;
ColorArg2[0] = Diffuse;
AlphaOp[0]=Disable;

//////////////////////////////////////
//stage 1
//////////////////////////////////////

ColorOp[1]=Disable;
AlphaOp[1]=Disable;

}

pass P1
//////////////////////////////////////////////////////
//// Now we blend another texture using an alphamap
//////////////////////////////////////////////////////
{

//////////////////////////////////////
// Stage 0
//////////////////////////////////////

// We need to enable alphablending

AlphaBlendEnable=True;
SrcBlend=SrcAlpha;
DestBlend=InvSrcAlpha;

zEnable=False;
zWriteEnable=False;

Texture[0] = <mtlSkin1>;

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;
AlphaOp[0]=SelectArg1;

//////////////////////////////////////////////
// Stage 1
//////////////////////////////////////////////

Texture[1] = <entSkin2>;

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;
AlphaOp[1]=Disable;

///////////////////////////////////////////////
// Stage 2
///////////////////////////////////////////////
ColorOp[2]=Disable;
AlphaOp[2]=Disable;


}



} // End of Technique

"; // end of the effect string

} // End of Material


///////////////////////////////////////////////////////////////////////
//The Action we assign in WED
///////////////////////////////////////////////////////////////////////

action ffp_TerrainTex
{
my.transparent=off;
my.material = mat_terraintex;


}





Re: @Steempipe (urgent) [Re: Steempipe] #25161
01/07/05 05:48
01/07/05 05:48
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
Alright, I have this code now:
Code:
material mat_ffp_multitex
{
event = mtl_terraintex_init;
skin1 = blendmap1; //Blendmap for texture 2
skin2 = blendmap2; //Blendmap for texture 3
effect
"
TEXTURE entSkin1;
TEXTURE entSkin2;
TEXTURE entSkin3;

TEXTURE mtlSkin1;
TEXTURE mtlSkin2;


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] = <entSkin1>;

magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;

TEXTURETransformFlags[0] = Count2;
TEXTURETransform[0] = <matMtl>;
texcoordindex[0]=0;

ColorArg1[0] = TEXTURE;
ColorOp[0] = SELECTARG1;

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] = <mtlSkin1>;

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] = <entSkin2>;


// 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
{

////////////////////////////////////////
// Stage 0
////////////////////////////////////////

alphablendenable=true;
srcblend=srcalpha;
destblend=invsrcalpha;

alphatestenable=true;
alpharef=0x00000000;
alphafunc=Greater;

TEXTURE[0] = <mtlSkin2>;

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] = <entSkin3>;

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 P2

} // End of Technique
";
}


three textures, they all blend perfectly. Now a last question: Is it possible to use dynamic lights on them? This is really important for the game.

The terrains reacts on fog but not dynamic light.


Follow me on twitter
Re: @Steempipe (urgent) [Re: mk_1] #25162
01/07/05 06:50
01/07/05 06:50
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline OP
Serious User
Steempipe  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Yes... make your dynamic lights and since we already have lighting-true in the FFP. It should work out.



Re: @Steempipe (urgent) [Re: Steempipe] #25163
01/08/05 01:21
01/08/05 01:21
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Mmmm, it's tiny little off topic, but does anyone knows what parameters I have to use for multitexturing based on height?


Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: @Steempipe (urgent) [Re: PHeMoX] #25164
01/08/05 17:59
01/08/05 17:59
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
just use your heightmap as blendmap.

EDIT:
@steempipe:
Could you add a third texture (for shadows) please?


Follow me on twitter
Re: @Steempipe (urgent) [Re: mk_1] #25165
01/08/05 22:13
01/08/05 22:13
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline OP
Serious User
Steempipe  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
MK_1: Getting your code finished. Just need to add comments and things this weekend.

You will have:
-Blending (2) textures
-Adding of dynamic lights
-Diffuse Lighting from the engine
-Modulating a shadowmap




Page 4 of 6 1 2 3 4 5 6

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