Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, 1 invisible), 19,045 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
need help with terrain multitexturing #22485
01/28/04 08:03
01/28/04 08:03
Joined: Jan 2004
Posts: 53
CA
S
salem Offline OP
Junior Member
salem  Offline OP
Junior Member
S

Joined: Jan 2004
Posts: 53
CA
if anyone could help me please, i have absolutely nooooooooo idea how to get ventilator's shader script to work...

ive read through several of the posts on it and have done the following thus far:

created a 512 x 512 heightmap
put it in med
created 2 diff 256 x 256 tga's and set them as skins for the terrain
created 1 512 x 512 32 bit tga with alpha mapping and set it as the third skin in med...

when i run the level all i see is the third, alpha map texture that i applied...

at this point i am totally clueless- this is the first time ive ever even touched a shader sooo...

if im doing this completely wrong?? could someone please direct me in the correct procedure...im using the source code given here:

http://www.inode.at/baop/wiki/index.php?TerrainMultitexturing

any and all help will be greatly appreciated!!!

Re: need help with terrain multitexturing [Re: salem] #22486
01/28/04 08:15
01/28/04 08:15
Joined: Jun 2001
Posts: 2,006
USA
Darkstorm Offline
Senior Expert
Darkstorm  Offline
Senior Expert

Joined: Jun 2001
Posts: 2,006
USA
I'm just going to start spouting random ideas that you likely have thought of already. Did you include the wdl script with the action and shader in your level's wdl script? Did you assign the "terrain" action to your terrain?

We'll start simple and go from there .

Re: need help with terrain multitexturing [Re: Darkstorm] #22487
01/28/04 08:21
01/28/04 08:21
Joined: Jan 2004
Posts: 53
CA
S
salem Offline OP
Junior Member
salem  Offline OP
Junior Member
S

Joined: Jan 2004
Posts: 53
CA
yes, i applied the terrain action to the terrain and did an include<>; for the separate wdl for the shader in my main script

Re: need help with terrain multitexturing [Re: salem] #22488
01/28/04 08:35
01/28/04 08:35
Joined: Jun 2001
Posts: 2,006
USA
Darkstorm Offline
Senior Expert
Darkstorm  Offline
Senior Expert

Joined: Jun 2001
Posts: 2,006
USA
Man, I was hoping that was it because I know next to nothing when it come to shaders (and most other things come to think of it). Okay, another one. When you added the third skin with the alpha channel, did you uncheck the box that asks about adapting skin points?

Re: need help with terrain multitexturing [Re: Darkstorm] #22489
01/28/04 08:40
01/28/04 08:40
Joined: Jan 2004
Posts: 53
CA
S
salem Offline OP
Junior Member
salem  Offline OP
Junior Member
S

Joined: Jan 2004
Posts: 53
CA
it doesn't allow for me to uncheck the box...?

Re: need help with terrain multitexturing [Re: salem] #22490
01/28/04 08:44
01/28/04 08:44
Joined: Jun 2001
Posts: 2,006
USA
Darkstorm Offline
Senior Expert
Darkstorm  Offline
Senior Expert

Joined: Jun 2001
Posts: 2,006
USA
Most likely due to the fact that that skin is the same size as your hmp (512x512). That should be okay. Hmmm. Have to think about this a bit. If you a place where you could upload the level I could take a look. I'm more of a "hands on" type of person.

Re: need help with terrain multitexturing [Re: Darkstorm] #22491
01/28/04 08:48
01/28/04 08:48
Joined: Jan 2004
Posts: 53
CA
S
salem Offline OP
Junior Member
salem  Offline OP
Junior Member
S

Joined: Jan 2004
Posts: 53
CA
okay i will make a quick and dirty level for u to play with as the one im working on is currently my big project, check back in about 10 min

Re: need help with terrain multitexturing [Re: salem] #22492
01/28/04 09:00
01/28/04 09:00
Joined: Jan 2004
Posts: 53
CA
S
salem Offline OP
Junior Member
salem  Offline OP
Junior Member
S

Joined: Jan 2004
Posts: 53
CA

Re: need help with terrain multitexturing [Re: salem] #22493
01/28/04 09:09
01/28/04 09:09
Joined: Jun 2001
Posts: 2,006
USA
Darkstorm Offline
Senior Expert
Darkstorm  Offline
Senior Expert

Joined: Jun 2001
Posts: 2,006
USA
From looking at your hmp, it looks like you put the skin with the alpha channel first instead of third. If so, that needs to be changed. Also, when I pasted the code that I'm using over yours it worked. Here is what I'm using:

Code:

material mat_terrain_multitexture
{
effect=
"
texture entSkin1;
texture entSkin2;
texture entSkin3;

matrix matWorldViewProj;
matrix matWorld;
matrix matWorldView;

vector vecSunDir;
vector vecDiffuse;
vector vecAmbient;
vector vecLight;
vector vecFog;
vector vecSkill41;

technique multitexture
{
pass p
{
texture[0]=<entSkin1>;
texture[1]=<entSkin2>;
texture[2]=<entSkin3>;

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

zWriteEnable=true;

vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[4]=<matWorld>;
vertexShaderConstant[8]=<matWorldView>;

vertexShaderConstant[16]=<vecSunDir>;
vertexShaderConstant[17]=<vecDiffuse>;
vertexShaderConstant[18]=<vecAmbient>;
vertexShaderConstant[19]=<vecLight>;
vertexShaderConstant[20]=<vecFog>;

vertexShaderConstant[64]=<vecSkill41>; //(u_scale1, v_scale1, u_scale2, v_scale2)
vertexShaderConstant[95]=(0.0f,0.0f,0.0f,0.0f);

vertexShader=
decl
{
stream 0;
float v0[3]; //position
float v3[3]; //normal
float v7[2]; //uv
}
asm
{
vs.1.1
m4x4 oPos,v0,c0 // transform position to clip space

mul oT0.xy,v7.xy,c64.xy // output scaled uvs - stage 0
mul oT1.xy,v7.xy,c64.zw // output scaled uvs - stage 1
mov oT2.xy,v7.xy // output uvs - stage 2

m3x3 r0,v3,c4 // transform normal to world space
dp3 r0.w,r0,r0 // renormalize it
rsq r0.w,r0.w
mul r0,r0,r0.w

dp3 r0,r0,-c16 // normal.light -> lighting constant
mul r0.xyz,r0,c17 // modulate against material diffuse color
add oD0.xyz,r0,c19 // add environment light

mov r1.w,c20.w // r1.w=1
dp4 r0,v0,c10 // distance to camera position
add r0,r0,-c20.x // distance-fog_start
mad r0.x,-r0.x,c20.z,r1.w // 1-(distance-fog_start)*(1/(fog_end-fog_start))
max oFog.x,r0.x,c95.w // clamp with custom max value
};

pixelShader=
asm
{
ps.1.1
def c0,0,0,0,1
tex t0 // sample t0
tex t1 // sample t1
tex t2 // sample t2
/* lrp r0.rgb,t2.a,t0,t1 // blend t0 with t1 using the alpha channel of t2 */
mov r1,t1
lrp r0.rgb,t2.a,t0,r1 // blend t0 with t1 using the alpha channel of t2
+mov r0.a,c0
//add r0.rgb,r0,t2_bias // add(signed) rgb of t2
mul r0.rgb,r0,v0 // modulate with diffuse vertex lighting
};
}
}
";
}

action terrain
{
my.skill41=float(10);
my.skill42=float(20);
my.skill43=float(5);
my.skill44=float(10);

my.flare = off;
my.transparent = off;
my.albedo = 0;
my.material = mat_terrain_multitexture;
}



Re: need help with terrain multitexturing [Re: Darkstorm] #22494
01/28/04 09:18
01/28/04 09:18
Joined: Jan 2004
Posts: 53
CA
S
salem Offline OP
Junior Member
salem  Offline OP
Junior Member
S

Joined: Jan 2004
Posts: 53
CA
thank you soo much! this has really helped me out, i appreciate ur patience, maybe now i can start to analyze what all this seemingly mumbojumbo code is supposed to do

Page 1 of 4 1 2 3 4

Moderated by  Blink, Hummel, Superku 

Gamestudio download | 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