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
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 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
make something shine like metal (commercial versio #79975
06/29/06 21:01
06/29/06 21:01
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
is there an easy understandable shader that makes an object shine like metal, the kinda shine that is used with the easy water code and stuff but then without the waves i hope i made myself clear and someone can help me thank you.

Re: make something shine like metal (commercial ve [Re: Toon] #79976
06/29/06 21:07
06/29/06 21:07
Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
S
Sebe Offline
Serious User
Sebe  Offline
Serious User
S

Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
Cubic Environment Mapping

It's from the wiki, there you also find an explanation etc.

And that's the code:

Code:

bmap bcube=<cube+6.tga>;

function mtl_envmap_view()
{
mat_set(mtl.matrix,matViewInv);
mtl.matrix41=0;
mtl.matrix42=0;
mtl.matrix43=0;
}

function mtl_envmap_init()
{
//...maybe you should copy the mat_model properties here...
bmap_to_cubemap(mtl.skin1);
mtl.event=mtl_envmap_view;
mtl.enable_view=on;
}

material mtl_envmap
{
skin1=bcube;
event=mtl_envmap_init;

effect=
"
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique envmap
{
pass p0
{
texture[0]=<entSkin1>;
texture[1]=<mtlSkin1>;

zWriteEnable=true;
alphaBlendEnable=false;

colorArg1[0]=Texture;
colorOp[0]=Modulate2x;
colorArg2[0]=Diffuse;

colorArg1[1]=Texture;
colorOp[1]=blendCurrentAlpha;
addressU[1]=Clamp;
addressV[1]=Clamp;
texCoordIndex[1]=cameraSpaceReflectionVector;
textureTransformFlags[1]=Count3;
textureTransform[1]=<matMtl>; // transform camera space back to world space
}
}
";
}



Re: make something shine like metal (commercial ve [Re: Sebe] #79977
06/29/06 21:18
06/29/06 21:18
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
Ok i tryed to add the code but i totally have no idea what to do next ^^ yeah im noob with shaderstuff ^^ ..should i call the mtl_envmap_init in main?

Re: make something shine like metal (commercial ve [Re: Toon] #79978
06/30/06 18:13
06/30/06 18:13
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
no you set my.material = mat_envmap to your object's action.

Re: make something shine like metal (commercial ve [Re: Joey] #79979
08/28/06 17:35
08/28/06 17:35
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
ah okej it works now its impressive this shaderstuff

does anyone know (where) can i find a manual for shader-programming? i wanno let the metal shine but still seeing the texture...its for a sci-fi game..to apply to a few doors and boxes and stuff

Re: make something shine like metal (commercial ve [Re: Toon] #79980
08/28/06 22:25
08/28/06 22:25
Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
S
Sebe Offline
Serious User
Sebe  Offline
Serious User
S

Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
Here's a tutorial for using Environment Mapping with an Alpha Channel so that you can choose which parts of your model have a certain "metal shine"

http://homepage.sunrise.ch/mysunrise/lordsebe/envmap_tut_eng.htm

But it has been written a) by me, and b) a long time ago, so don't expect it to be easy to understand ^^'

Re: make something shine like metal (commercial ve [Re: Sebe] #79981
01/22/07 09:07
01/22/07 09:07
Joined: Aug 2003
Posts: 716
Canada, Toronto
thegamedesigner Offline
User
thegamedesigner  Offline
User

Joined: Aug 2003
Posts: 716
Canada, Toronto
Can anyone tell me where to get cube+6.tga?

thanks
thegamedesigner


My games - www.spyeart.com
Re: make something shine like metal (commercial ve [Re: thegamedesigner] #79982
01/22/07 11:52
01/22/07 11:52
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline
Expert
EX Citer  Offline
Expert

Joined: May 2002
Posts: 2,541
Berlin
thats a place holder. You can use any sky cube you like. Of course you have to rename the file to make it work.

http://www.coniserver.net/coni_users/web_users/pirvu/au/textures/zips/skycube5.zip


:L

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