Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Gekachelte Texturen auf HMP/Tiled textures on HMP #55566
09/19/05 10:45
09/19/05 10:45
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline OP
Member
zwecklos  Offline OP
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Guten Tag,
Ich möchte ein HMP mit 3 gekachelten Texturen und 2 blendmaps (alpha-maps) erstellen.
Ich habe die shaders von Steempipe und Wiki ausprobiert leider bringt mir die engine eine malfunction.



Ich wollte den Script von Steempipe zum laufen bringen, damit ich etwas pröbeln und testen kann da ich noch etwas
Grün bin was die shader-programmierung betrifft . Ich habe via die search-function heraus gefunden, dass der
Parameter "Zbias" ab DirectX9c "D3DRS_DEPTHBIAS" heisst. Darum habe ich versucht die beiden Zbias Parameter
mit dem D3DRS_DEPTHBIAS Parameter auszutauschen. Leider konnte ich so den Script trotzdem nicht zum funktionieren
bringen. Ich schätze die Umprogrammierung ist etwas komplexer als erwartet .
Kann mir jemand helfen den Script zum laufen zu bringen?
Ich wäre auch sehr dankbar wenn mir jemand gute Lektüre oder Links zum Thema shader-Programmierung empfehlen
könnte.

cheers

Zwecklos

Edit: Ich arbeite mit A6 Pro 6.31.4

Hi there,
I want to create an HMP with 3 tiled textures and 2 blendmaps (alpha-maps).
Ive tried the shaders from Steempipe and Wiki but the engine gives me a malfunction

(see the image above in the german text).

I want to get Steempipe's script running in order to test a little with shader-programming
because im kinda new to this topic. Ive found via the search-function that the parameter
"Zbias" is no longer valid since DiectX9c. Now its named "D3DRS_DEPTHBIAS". I tried to change the Zbias Parameter
into D3DRS_DEPTHBIAS but it still doesnt work. I guess it needs a little more programming to fix the problem.
Can anybody help me to get Steempipes or Wikis Script running?
Im also very thankfull to those who can recommend me some good lectures or links to the shader-programming topic.

cheers

Zwecklos

Edit: Im working with A6 Pro 6.31.4

Last edited by zwecklos; 09/19/05 10:47.
Re: Gekachelte Texturen auf HMP/Tiled textures on [Re: zwecklos] #55567
09/19/05 10:51
09/19/05 10:51
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
probier DEPTHBIAS ohne das D3DRS_ präfix. das gilt im übrigen generell für alle states usw.


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: Gekachelte Texturen auf HMP/Tiled textures on [Re: ello] #55568
09/19/05 11:14
09/19/05 11:14
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline OP
Member
zwecklos  Offline OP
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Oh ja hab ich auch schon versucht...sorry das ich des nicht erwähnt habe.
Wenn ich das so probiere kommt folgende malfunction:



Irgend ne Idee? will Multitexturing!

edit: kennt jemand einen guten script-editor für diese Art shader-programmierung? (am besten einen der die syntax erklärt )

Last edited by zwecklos; 09/19/05 11:41.
Re: Gekachelte Texturen auf HMP/Tiled textures on [Re: zwecklos] #55569
09/19/05 15:03
09/19/05 15:03
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline OP
Member
zwecklos  Offline OP
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Mann Geilo habs hingekriegt
Hab einfach die entsprechenden states auskommentiert...ka wieso aber des funzt.
HLSL Programmierung ist echt schwierig...werd mich mal richtig damit beschäfgtigen müssen.

cheers and thx

zwecklos

Re: Gekachelte Texturen auf HMP/Tiled textures on [Re: zwecklos] #55570
09/20/05 15:29
09/20/05 15:29
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline OP
Member
zwecklos  Offline OP
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Hi there
Bin immer noch am HLSL pröbeln und hab ein problem bei welchem mir vielleicht jemand helfen kann.
Ich bin ein bischen weiter gekommen und hab schon gute Resultate erzielt bin aber schon beim nächsten Problem angelangt. 2 meiner entskins haben einen anderen kontrast, sie sehen um einiges dunkler aus als die eine stein textur.
Ich denke es hat was mit dem shader zu tun. Hab schon einiges ausprobiert komme aber auf keinen grünen zweig.
Hier mal ein screeny von meinem Problem:



hier der script:
Code:
  

///////////////////////////////////////////////////////////
// FFP Terrain MultiTexturing Effect
//
// By: Eric A. Hendrickson-Lambert (Steempipe)
//
// Notes:
// Use the FFP to tile and blend some terrain textures.
// This code uses (3) passes because more than 2 stages would be needed
// for 1 pass.
//
// 4/7/04 -- Removed Cullmode instructions as recommened by our wise ventilator
// 4/7/04 -- Added a bunch of "Z" stuff.
// Evidentally, certain "Z" functions are supposed
// to default to true. In case they don't I added
// them.
// 4/7/04 -- Added Alpha states to help ensure things go as planned.
// 4/7/04 -- Updated to remove the fallback passes.
// 4/7/04 -- Commented the code
// 4/7/04 -- Added Pass P2 to splat another texture
//////////////////////////////////////////////////////////


//*****************************************************
//** Strange results will occur by putting the alphamaps
//** in to the HMP as entSkins. Just load them as mtlSkins.
//*****************************************************

//******************************************************
//** Basically, to use this, supply 2 alpha channel
//** TGA's and change the names as needed.
//*****************************************************
//** Supply (3) tileable textures in your HMP.
//** These will be entSkins1,2 & 3
//** Be sure to add mipmaps to them in MED
//*****************************************************


// 32bpp RGBA TGA file. In the black color alphachannel white will be
// where the texture gets blended.
// RGB Channels are blank, the A channel has the blending weight (pattern)

bmap blendmap = <blendmap.tga>; // Blender for Pass p1
bmap blendmap2 = <blendmap2.tga>; // Blender for Pass p2


function mtl_terraintex_init()
{

bmap_to_mipmap(mtl.skin1);
bmap_to_mipmap(mtl.skin2);

//
// 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;
Skin2 = blendmap2;


// define a material effect string

event = mtl_terraintex_init;

effect =
"
matrix matMtl;

texture mtlSkin1; // Blending map for Pass P1
texture mtlSkin2; // Blending map for Pass P2
texture entSkin1; // Tileable Tex for Pass P0
texture entSkin2; // Tileable Tex for Pass P2
texture entSkin3; // Tileable Tex for Pass P3



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

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

//DEPTHbias=10; // To help with depth testing in this pass

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] = alphareplicate | texture;
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
////////////////////////////////////////////////////
//// 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;

//DEPTHbias=1;

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] = alphareplicate | texture;
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

"; // End of the effect string

} // End of Material


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

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





Wie gesagt, den code hab ich von steempipe und den skycube-textur ist von Frank G.
Wäre dankbar für jeden noch so kleinen Tip.


cheers

Re: Gekachelte Texturen auf HMP/Tiled textures on [Re: zwecklos] #55571
09/20/05 15:39
09/20/05 15:39
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
"the A channel has the blending weight"
mal ne frage, wie sieht denn deine alpha-map aus?

Re: Gekachelte Texturen auf HMP/Tiled textures on [Re: broozar] #55572
09/20/05 16:38
09/20/05 16:38
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline OP
Member
zwecklos  Offline OP
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Danke für die Antwort,
ich habe die Blendmaps mit Photoshop 7.0 erstellt.
Wenn ich einen Alpha-Kanal hinzufüge und als TGA abspeichern will, fällt der Alphakanal raus.
Meine Blendmaps haben eine schwarze Fläche auf einem leeren (transparenten) Hintergrund, wobei die schwarze Fläche die Texturen überblendet:


hier sind die original alphamaps(2.4MB zipped): blendmaps

liegt der fehler an den blendmaps...?
wäre weiterhin dankbar für alle tipps!!!

cheers

zwecklos

Re: Gekachelte Texturen auf HMP/Tiled textures on [Re: zwecklos] #55573
09/20/05 17:14
09/20/05 17:14
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
hmmm... daran liegts schonmal nicht, alles so wies sein soll. keine ahnung. frag mal die, die den schader gebastelt haben.

Re: Gekachelte Texturen auf HMP/Tiled textures on [Re: broozar] #55574
09/20/05 20:10
09/20/05 20:10
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline OP
Member
zwecklos  Offline OP
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Habs hingekriegt...Der Trick ist das standard A5 script zu wählen unter map properties.
nachdem ich das A5 standard script eingestellt hab läuft der shader problemlos.
Anscheinend mag der shader keine A6 template scripts...von wegen level_load(grid) und so kein plan.

Hier guggst du resultat:




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