Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 609 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help a noob out #39299
01/16/05 11:16
01/16/05 11:16
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline OP
Developer
Braxton  Offline OP
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
hello,

I was wondering how to call a shader to a certain model (like, mat_model = shader). But the only problem is that the shader is in a different script and is a '.fx' file, not '.wdl'.

Thanks in advanced,

Braxton


"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh
Re: Help a noob out [Re: Braxton] #39300
01/16/05 12:33
01/16/05 12:33
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
do it this way:
define your material here:

material mat_test
{
//can set flags and assign material skins if you need to
// flags = tangent;
// skin1=whatever...
}

then in a starter function:

starter
{
effect_load(mat_test,"mat_test.fx");
}

then in the action for your entity:
my.material=mat_test;

Re: Help a noob out [Re: Matt_Aufderheide] #39301
01/16/05 12:36
01/16/05 12:36
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline OP
Developer
Braxton  Offline OP
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
I am not following you... the script that holds the shader is all in the '.fx' file.


"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh
Re: Help a noob out [Re: Braxton] #39302
01/16/05 13:01
01/16/05 13:01
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
an A6 material is broken into 2 parts, the material definition and the effect string. You can include the effect string in the material definition, or put it into an .fx file. If you have an .fx file then you need to have a material definition in script. Just do exactly as i have shown and it will work.

remember the effect string is direct3d code, not c-script. C-script has no idea what is in the effect string at all.. it just needs to know where it is and what material it is applied to. In practice, you can define a bunch of seperate materials in script and then have them all use the same .fx file for the shader. That way you can have many different material properties and not have to write a bunch of seperate .fx files or material scripts.

Last edited by Matt_Aufderheide; 01/16/05 13:05.
Re: Help a noob out [Re: Matt_Aufderheide] #39303
01/16/05 13:11
01/16/05 13:11
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline OP
Developer
Braxton  Offline OP
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
so what do i put int he material mat_test part???


"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh
Re: Help a noob out [Re: Braxton] #39304
01/16/05 13:13
01/16/05 13:13
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
put wherever you want in your script, just make sure it is defined BEFORE you assign it to an enity or it will give an error--just like any function..it needs be declared before it is called/set

Re: Help a noob out [Re: Matt_Aufderheide] #39305
01/16/05 13:20
01/16/05 13:20
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline OP
Developer
Braxton  Offline OP
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
so i could do:

mat_test
{
my.flare == off;
}

then call it and it will do the shader???


"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh
Re: Help a noob out [Re: Braxton] #39306
01/16/05 13:54
01/16/05 13:54
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
no you cant do this.. sorry but you need to look at other examples and learn a few things before messing about with materials.. as they say it's 'non-trivial'.

Re: Help a noob out [Re: Matt_Aufderheide] #39307
01/20/05 09:59
01/20/05 09:59
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline OP
Developer
Braxton  Offline OP
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
do you know of any tutorials or places where i can learn. I love scripting and want to learn how to make shaders, particles, and really neat stuff with C-Script.

Please help me out,
Braxton


"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh

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