Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
How to apply a material to a entity #91440
09/25/06 15:53
09/25/06 15:53
Joined: Sep 2006
Posts: 15
Rome, Italy
Mehdi_Mahdloo Offline OP
Newbie
Mehdi_Mahdloo  Offline OP
Newbie

Joined: Sep 2006
Posts: 15
Rome, Italy
Hi. I'm tring to use the Toon Shader made by "ello" (check the Shaders topics), but i have a problem. I don't know how to apply the toon material to a entity. I have included the "shaders.wdl" in my project but I don't know what to do next. please help me!!!!

Thanks


mehdimahdloo.altervista.org mehdimahdloo.spaces.msn.com
Re: How to apply a material to a entity [Re: Mehdi_Mahdloo] #91441
09/25/06 16:01
09/25/06 16:01
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Assign the material mtl_toon to your entity: my.material = mtl_toon;

Re: How to apply a material to a entity [Re: demiGod] #91442
09/25/06 16:17
09/25/06 16:17
Joined: Sep 2006
Posts: 15
Rome, Italy
Mehdi_Mahdloo Offline OP
Newbie
Mehdi_Mahdloo  Offline OP
Newbie

Joined: Sep 2006
Posts: 15
Rome, Italy
Thanks demiGOD but in which WDL file I have to wrote the instruction? How can I reconize the entity I want to texture in the code?


mehdimahdloo.altervista.org mehdimahdloo.spaces.msn.com
Re: How to apply a material to a entity [Re: Mehdi_Mahdloo] #91443
09/25/06 16:29
09/25/06 16:29
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Create an action and assign that action in WED to the entities you want to be affected by the shader.

Code:

action toonShader
{
my.material = mtl_toon;
}



Re: How to apply a material to a entity [Re: demiGod] #91444
09/25/06 16:41
09/25/06 16:41
Joined: Sep 2006
Posts: 15
Rome, Italy
Mehdi_Mahdloo Offline OP
Newbie
Mehdi_Mahdloo  Offline OP
Newbie

Joined: Sep 2006
Posts: 15
Rome, Italy
Thanks again demiGOD but I'm a newbie and i don't know how to create an action. Can you write me a little turorial that explain me how to use shaders? Please is very important for me.
Thanks.


mehdimahdloo.altervista.org mehdimahdloo.spaces.msn.com
Re: How to apply a material to a entity [Re: Mehdi_Mahdloo] #91445
09/25/06 17:41
09/25/06 17:41
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Hey Mehdi,
I already told you how to use shaders, its applying the material thing in the created action. I think the best advice i can give to you its to start reading the manual of 3DGS, download and practice the tutorials and workshops listed in the Links and Downloads pages, and the AUM magazine and AU resources.
You must learn basic things first before using more advanced topics like shaders. For example, you need to know how to create a level in the Wed Editor, create a hollow block for the sky, place entities and assign actions to them.
Without this knowledge you cant do anything in 3DGS.

Re: How to apply a material to a entity [Re: demiGod] #91446
09/25/06 19:25
09/25/06 19:25
Joined: Sep 2006
Posts: 15
Rome, Italy
Mehdi_Mahdloo Offline OP
Newbie
Mehdi_Mahdloo  Offline OP
Newbie

Joined: Sep 2006
Posts: 15
Rome, Italy
Hi. I know how to create Hollow block, lights, give action at entity, and texture block by using the WADS. I know how to include WDL in my project...i simply don't know how to apply a shader...I've never worked with shaders...can you still help me?


mehdimahdloo.altervista.org mehdimahdloo.spaces.msn.com
Re: How to apply a material to a entity [Re: Mehdi_Mahdloo] #91447
09/25/06 19:51
09/25/06 19:51
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Ok very well, maybe this works because i didnt test:

a) Copy the 3 files (3dgs_toon.fx, shadows.wdl and toonLookup.bmp) to your work directory;

b) In the top of main script file write "include <shaders.wdl>;"

c) Create an action for the entity you want to apply the shader like i mentioned above and dont forget to write "my.material=mtl_toon;"

d) In Wed load an entity and assign that action from the list.

e) Compile and Run.

I think will work.
Hope it helps .

Re: How to apply a material to a entity [Re: demiGod] #91448
09/25/06 20:02
09/25/06 20:02
Joined: Oct 2003
Posts: 2,628
IL,US
FeiHongJr Offline
Expert
FeiHongJr  Offline
Expert

Joined: Oct 2003
Posts: 2,628
IL,US
Quote:

For example, you need to know how to create a level in the Wed Editor, create a hollow block for the sky, place entities and assign actions to them.




You forgot one little thing here Learn basic scripting. If you know how to assign an action to an entity then demigod allready gave you the action.

Quote:


Create an action and assign that action in WED to the entities you want to be affected by the shader.

Code:

action toonShader
{
my.material = mtl_toon;
}





Just throw that into your wdl file anywhere is fine (as long as its not in another function or action) if thats all its going to do and assign it to your model.

If you want to assign this to your player model for example find the players action in your wdl script and write this at the very top(inside the action)

my.material = mtl_toon;

I suggest at least working thru the c-script workshop found on the downloads page. I think everyone using gamestudio should have at least that basic knowledge under their belt even if they plan on using templates.


http://www.freewebs.com/otama_syndicate/index.htm - Each master to his own technique.

- Not me said the bee, Nor I said the fly.
Re: How to apply a material to a entity [Re: FeiHongJr] #91449
09/25/06 22:23
09/25/06 22:23
Joined: Sep 2006
Posts: 15
Rome, Italy
Mehdi_Mahdloo Offline OP
Newbie
Mehdi_Mahdloo  Offline OP
Newbie

Joined: Sep 2006
Posts: 15
Rome, Italy
Still don't work.
Let me tell you which steps I did. I have a "Toon.wdl" that is the level code generated by WED. Then I have the "shaders.wdl" provided me by ello.

1) I have created a hollow cube textured.
2) I have insert an mdl model
3) I have saved and closed WED
4) I have opened the "Toon.wdl" and I have included in the top, the "shaders.wdl"
5) At the end of "Toon.wdl" I have insert:

action toonShader
{
my.material = mtl_toon;
}


6) Now i ave opened the WED again
7) I have loaded my level
8) I have assigned to my mdl model the "toonShader" action
9) I have saved and fully compiled
10) I run the project but I get a "systax error" and the toon shaders is not applied.

Any sugestion people? Thanks again for your help!

Mehdi

Last edited by Mehdi_Mahdloo; 09/25/06 22:24.

mehdimahdloo.altervista.org mehdimahdloo.spaces.msn.com
Page 1 of 3 1 2 3

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