Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 672 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Need Help with Terrain Multitexturing Shader #42412
03/11/05 07:10
03/11/05 07:10
Joined: Mar 2004
Posts: 405
Wisconsin, USA
sarahlover_247 Offline OP
Senior Member
sarahlover_247  Offline OP
Senior Member

Joined: Mar 2004
Posts: 405
Wisconsin, USA
I am using the Shader from the Wiki, and I get this message:
Error in effect:
mat_terrain_multitexture(2) : syntax error

Heres the code I am using:
In the main wdl:

path "D:\\Miscellaneous\\3D Gamestudio Stuff\\work";
include <multitexture.wdl>;
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.material=mat_terrain_multitexture;
}

in the multitexture.wdl:
material mat_terrain_multitexture
{
effect=
"
texture entSkin1.tga;
texture entSkin2.tga;
texture entSkin3.tga;

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.tga>; // colormap1
texture[1]=<entSkin2.tga>; // colormap2
texture[2]=<entSkin3.tga>; // macromap

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 - colormap1
mul oT1.xy,v7.xy,c64.zw // output scaled uvs - colormap2
mov oT2.xy,v7.xy // output uvs - macromap

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.3
def c0,0,0,0,1
tex t0 // sample colormap1
tex t1 // sample colormap2
tex t2 // sample macromap

lrp r0.rgb,t2.a,t0,t1 // 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
};
}
}
";
}


Ganz deutsch spreche ich wurde übersetzt durch Babel Fish http://world.altavista.com/ AMD Athlon 64 3200+ 1GB DDR400 Mushkin RAM (CL=2.5) 200GB Seagate HD w/ 8mb buffer Saphire 9800 Pro Win XP Pro
Re: Need Help with Terrain Multitexturing Shader [Re: sarahlover_247] #42413
03/11/05 07:21
03/11/05 07:21
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
drop the ".tga" from your entskin declarations.

texture entSkin1.tga -->> texture entSkin1

Re: Need Help with Terrain Multitexturing Shader [Re: Steempipe] #42414
03/11/05 07:32
03/11/05 07:32
Joined: Mar 2004
Posts: 405
Wisconsin, USA
sarahlover_247 Offline OP
Senior Member
sarahlover_247  Offline OP
Senior Member

Joined: Mar 2004
Posts: 405
Wisconsin, USA
edit:oops, shoulda cropped
No errors just...
entSkin1 is my dirt texture
entSkin2 is my Grass texture
entSkin3 is my alpha map



Ganz deutsch spreche ich wurde übersetzt durch Babel Fish http://world.altavista.com/ AMD Athlon 64 3200+ 1GB DDR400 Mushkin RAM (CL=2.5) 200GB Seagate HD w/ 8mb buffer Saphire 9800 Pro Win XP Pro
Re: Need Help with Terrain Multitexturing Shader [Re: sarahlover_247] #42415
03/11/05 07:42
03/11/05 07:42
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Is your blendmap in the Alpha channel of entSkin3??

Re: Need Help with Terrain Multitexturing Shader [Re: Steempipe] #42416
03/11/05 07:46
03/11/05 07:46
Joined: Mar 2004
Posts: 405
Wisconsin, USA
sarahlover_247 Offline OP
Senior Member
sarahlover_247  Offline OP
Senior Member

Joined: Mar 2004
Posts: 405
Wisconsin, USA
huh?
I haven't read the C-Script manual, so i pretty much understand the basics, so please, be simple with me
heres the what skins im using





Ganz deutsch spreche ich wurde übersetzt durch Babel Fish http://world.altavista.com/ AMD Athlon 64 3200+ 1GB DDR400 Mushkin RAM (CL=2.5) 200GB Seagate HD w/ 8mb buffer Saphire 9800 Pro Win XP Pro
Re: Need Help with Terrain Multitexturing Shader [Re: sarahlover_247] #42417
03/11/05 08:43
03/11/05 08:43
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
So... you need to have the blendmap in the Alpha channel of the texture. Not in the RGB channels for your code.

You can try this file for entSkin3 and see if you have any better luck. And then maybe see what I am talking about.
11kb file

Re: Need Help with Terrain Multitexturing Shader [Re: Steempipe] #42418
03/11/05 10:50
03/11/05 10:50
Joined: Mar 2004
Posts: 405
Wisconsin, USA
sarahlover_247 Offline OP
Senior Member
sarahlover_247  Offline OP
Senior Member

Joined: Mar 2004
Posts: 405
Wisconsin, USA
It just made everything black. I'll try to explain what I did and see were im going wrong...
I inserted entskin1 as a skin on my terrain, then i made a new layer thingamabobber and inserverted enskin2, then made a new layer thingy again and put on the black thing you gave me, and attached the terrain behavior. Did I do something wrong?


Ganz deutsch spreche ich wurde übersetzt durch Babel Fish http://world.altavista.com/ AMD Athlon 64 3200+ 1GB DDR400 Mushkin RAM (CL=2.5) 200GB Seagate HD w/ 8mb buffer Saphire 9800 Pro Win XP Pro
Re: Need Help with Terrain Multitexturing Shader [Re: sarahlover_247] #42419
03/12/05 10:33
03/12/05 10:33
Joined: Mar 2004
Posts: 405
Wisconsin, USA
sarahlover_247 Offline OP
Senior Member
sarahlover_247  Offline OP
Senior Member

Joined: Mar 2004
Posts: 405
Wisconsin, USA
Anyone have any ideas?


Ganz deutsch spreche ich wurde übersetzt durch Babel Fish http://world.altavista.com/ AMD Athlon 64 3200+ 1GB DDR400 Mushkin RAM (CL=2.5) 200GB Seagate HD w/ 8mb buffer Saphire 9800 Pro Win XP Pro
Re: Need Help with Terrain Multitexturing Shader [Re: sarahlover_247] #42420
03/13/05 07:45
03/13/05 07:45
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Time is limimted...

Could you post a small level that replicates your problem. It would be quicker if I could run that and see what may be up.

Also, put your Gstudio, DX, and Vid Card specs in.

Re: Need Help with Terrain Multitexturing Shader [Re: Steempipe] #42421
03/13/05 13:05
03/13/05 13:05
Joined: Mar 2004
Posts: 405
Wisconsin, USA
sarahlover_247 Offline OP
Senior Member
sarahlover_247  Offline OP
Senior Member

Joined: Mar 2004
Posts: 405
Wisconsin, USA
6.22
DirectX 9.0C
---------------
Display Devices
---------------
Card name: RADEON 9800 PRO (Omega 2.5.90)
Manufacturer: ATI Technologies Inc. (Omega 2.5.90)
Chip type: RADEON 9800 AGP (0x4E48)
DAC type: Internal DAC(400MHz)
Device Key: Enum\PCI\VEN_1002&DEV_4E48&SUBSYS_00021002&REV_00
Display Memory: 128.0 MB
Current Mode: 1024 x 768 (32 bit) (60Hz)
Monitor: Plug and Play Monitor
Monitor Max Res: 1600,1200
Driver Name: ati2dvag.dll
Driver Version: 6.14.0010.6490 (English)
DDI Version: 9 (or higher)




http://www.geocities.com/saralvr247/Level.zip



Thanks for the help


Ganz deutsch spreche ich wurde übersetzt durch Babel Fish http://world.altavista.com/ AMD Athlon 64 3200+ 1GB DDR400 Mushkin RAM (CL=2.5) 200GB Seagate HD w/ 8mb buffer Saphire 9800 Pro Win XP Pro
Page 1 of 2 1 2

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