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
1 registered members (TipmyPip), 18,449 guests, and 6 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
Idiots guide to get this thing going. #19046
10/30/03 08:53
10/30/03 08:53
Joined: Aug 2003
Posts: 145
Beorn Offline OP
Member
Beorn  Offline OP
Member

Joined: Aug 2003
Posts: 145
I wonder if someone would be so kind and just write a step by step instruction on how to get a shader going. Im not looking for explanations, but really an idiots guide to apply one - any kind - of shader.

Now im gonna practice my banjo some more....


Re: Idiots guide to get this thing going. [Re: Beorn] #19047
10/30/03 10:41
10/30/03 10:41
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
fist of course you need to be a beta tester..

then just copy one of the shaders from this forum into your material.wdl
then in the action you assign to an object apply that material.. it should show up then..


Sphere Engine--the premier A6 graphics plugin.
Re: Idiots guide to get this thing going. [Re: Matt_Aufderheide] #19048
10/30/03 13:24
10/30/03 13:24
Joined: Aug 2003
Posts: 145
Beorn Offline OP
Member
Beorn  Offline OP
Member

Joined: Aug 2003
Posts: 145
Thanks. Im a beta tester. Thats not the problem. I assume there is somekind of description on how to assign materials somewhere too...


Re: Idiots guide to get this thing going. [Re: Matt_Aufderheide] #19049
10/30/03 13:36
10/30/03 13:36
Joined: Aug 2003
Posts: 145
Beorn Offline OP
Member
Beorn  Offline OP
Member

Joined: Aug 2003
Posts: 145
Ok, got it going on.
Thx again.

Re: Idiots guide to get this thing going. [Re: Beorn] #19050
10/30/03 17:18
10/30/03 17:18
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
There's two ways I do it, for testing...
As a simple action or called as a material in an action
-------------------------------------------------------
-Add your code to a wdl file called something like shaders.wdl
-add the script to your level (file-->add script)

Here is an example of how I implement a reflection shader made by Ventilator...(Huge thanks, hope its ok to post it):
Ventilator's Environment mapping thread

-Add this code to a text file named shaders.wdl
-add it to level
- notice below, in the action you call the material...
- use a texture for your reflection named reflect.tga

action Shaders_Reflection {

the material is called with this line:
my.material=mat_envmap;

I think thats about it...

Code:
 ///////////////////////////////////////////////////////

//Ventilators reflection shader (Environment mapping
//////////////////////////////////////////////////////
bmap b_envmap=<reflect.tga>;

//--------------------------------------------mat_envmap

material mat_envmap

{

skin1=b_envmap;

effect=

"

texture mtlSkin1;

texture texSkin1;

matrix matWorldViewProj;

matrix matWorld;

matrix matWorldView;



technique envmap

{

pass p0

{

Texture[0]=<mtlSkin1>;

Texture[1]=<texSkin1>;


VertexShaderConstant[0]=<matWorldViewProj>;

VertexShaderConstant[4]=<matWorld>;

VertexShaderConstant[8]=<matWorldView>;

VertexShaderConstant[95]=(0.5f,1.0f,2.0f,0.0f);


VertexShader=

decl

{

stream 0;

float v0[3]; //position

float v3[3]; //normal

float v7[3]; //uv1

float v8[3]; //uv2 or tangent

}

asm

{

vs.1.1



m4x4 oPos,v0,c0 // transform position to clip space

mov oT1,v7 // output uvs for colormap



m4x4 r10,v0,c4 // transform position to world space

sub r10,c10,r10 // direction to view

dp3 r10.w,r10,r10 // renormalize it

rsq r10.w,r10.w

mul r10,r10,r10.w



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

// calculate reflection vector

dp3 r2.xyz,r10,r0 // v.n

mul r1,r0,c95.z // 2n

mad oT0.xyz,r2,r1,-r10 // 2n(v.n)-v

};



PixelShader=

asm

{

ps.1.3

tex t0 // sample cubemap

tex t1 // sample colormap

mov r0,t0

//add r0,t0,t1_bias

};

}

}

";

}


starter mat_envmap_init

{

bmap_to_cubemap(bmap_to_mipmap(mat_envmap.skin1));

}

//i use this like that:

entity* blurp;
action Shaders_Reflection {
blurp=me;
my.material=mat_envmap;
my.pan=random(360); //rotation
my.tilt=random(360); //rotation
my.roll=random(360); //rotation
while(1) { //rotation
my.pan+=sin(my.tilt)/2*time; //rotation
my.tilt+=cos(my.roll)/2*time; //rotation
my.roll+=sin(my.pan)/2*time; //rotation
wait(1);
}
}




Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: Idiots guide to get this thing going. [Re: Drew] #19051
10/30/03 22:04
10/30/03 22:04
Joined: Aug 2003
Posts: 145
Beorn Offline OP
Member
Beorn  Offline OP
Member

Joined: Aug 2003
Posts: 145
Thanks,
I got it gioing oin. Now the only trouble is that my hardware isnt good enough according to acknex.
This i found pretty odd, i got a gefiorce2go (mobile chip) and i thought that it should be able to handle vertex shaders.

Anyone got a simple vertex shader i could test?


Re: Idiots guide to get this thing going. [Re: Beorn] #19052
10/31/03 10:52
10/31/03 10:52
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
Basically, there are two kind of effects you can use: Fixed function effects and shaders. The fixed function effects should run on older cards like a GeForce or your GeForce 2. However if you want to use shaders you need newer cards: For hardware vertex shader support and simple pixel shader support a GeForce 3 or higher is needed. For true pixel shader support, you would at least need a fourth generation GPU (GeForce FX).

Re: Idiots guide to get this thing going. [Re: Alexander Esslinger] #19053
11/01/03 00:07
11/01/03 00:07
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
The geforce2 does not support shaders, and can only handle vertex shaders by software emulation. The next beta will support software vertex shader emulation.

However we've found that the emulation mode has several severe performance and functional disadvantages, so it's for testing only, but not recommended for publishing games.

Re: Idiots guide to get this thing going. [Re: jcl] #19054
11/01/03 01:08
11/01/03 01:08
Joined: Aug 2003
Posts: 145
Beorn Offline OP
Member
Beorn  Offline OP
Member

Joined: Aug 2003
Posts: 145
Thanks a lot, now i can give it up for now;)


Re: Idiots guide to get this thing going. [Re: Drew] #19055
11/05/03 10:48
11/05/03 10:48
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline
Serious User
indiGLOW  Offline
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
I have followed intructions, but I am getting a ream of errors, I must be doing something wrong.

So far I have created a new beta folder, got my template_6 and copied to data, made a new wdl with a copy of ventilators code, added this shader script, along with material, camera and dumbiped.....

I get a load of errors. I have been at this for about 22hours and must go to bed now. I hope someone can help me tommorow...

This is my first time setting up beta so any help would really be appreciated.


The Art of Conversation is dead : Discuss
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