Gamestudio Links
Zorro Links
Newest Posts
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
2 registered members (AndrewAMD, dr_panther), 1,282 guests, and 4 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
How to use tha shader library (mtlFX) #336642
08/05/10 15:11
08/05/10 15:11
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
I have to use the mtlFX shader library (because i need to create water), but how to use all this shaders? Maybe I have to #include <mtlFX.c> into my project, but then how I will assign mtlFX shader actions to the entities in my level? And the engine always can't find the mtlFX.c which is in the folder. It is a little confusing so can you tell me how to use it or give me a sample plz

Re: How to use tha shader library (mtlFX) [Re: mEnTaL] #336669
08/05/10 17:18
08/05/10 17:18
Joined: Oct 2007
Posts: 306
Austria
A
Alan Offline
Senior Member
Alan  Offline
Senior Member
A

Joined: Oct 2007
Posts: 306
Austria
Hi,

yes, it is true that you need to have

#include <mtlFX.c>

in your code, preferrably somewhere in your main file at the very beginning. Every shader which comes with 3DGS has a material which CONTAINS the shader information. So if you want to add a certain shader to a model, you just have to assign the shader to it. Example:

Code:
action myEntityAction(){
  my.material = mtl_toon;
}



This would cause the entity which uses the action "myEntityAction" to be toon-shaded. Basically it is that simple, but certain Shaders (phong shading, water shading etc.) have special requirements. To inform yourself about these and to get a full list of all shaders, visit:

http://manual.3dgamestudio.net/acknex.htm


Oh, one more thing: these shaders work only with 3DGS 7 Commercial or above. There are some fixed-pipeline-shaders which will work with ALL versions of 3DGS (including the free version), they can be found in the GameStudio Wiki.


Hope this helps.



Alan

Re: How to use tha shader library (mtlFX) [Re: Alan] #336690
08/05/10 18:37
08/05/10 18:37
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
I did as you said: I included the mtlFX at the beginning of my game script

Code:
#include <mtlFX.c>;



and then I made an action for my entity:

Code:
action test()
{
my.material = mtl_toon;
}



and also the mtlFX.c and the rest of the shaders are in the game folder. But when I try to compile I always get this error


Help plz

Re: How to use tha shader library (mtlFX) [Re: mEnTaL] #336692
08/05/10 19:12
08/05/10 19:12
Joined: May 2008
Posts: 257
D
djfeeler Offline
Member
djfeeler  Offline
Member
D

Joined: May 2008
Posts: 257
To include a file it is necessary to make #include "mtlFX.c"; not #include <mtlFX.c>;


Last edited by djfeeler; 08/05/10 19:12.
Re: How to use tha shader library (mtlFX) [Re: djfeeler] #336693
08/05/10 19:14
08/05/10 19:14
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Originally Posted By: djfeeler
To include a file it is necessary to make #include "mtlFX.c"; not #include <mtlFX.c>;


That would be new to me, as <> means: include from "include"-folder in the gs path, and "" means include from the actual work_folder (plus given path,if)

Re: How to use tha shader library (mtlFX) [Re: Rei_Ayanami] #336704
08/05/10 19:35
08/05/10 19:35
Joined: Nov 2009
Posts: 89
Germany, NRW
T
TrackingKeks Offline
Junior Member
TrackingKeks  Offline
Junior Member
T

Joined: Nov 2009
Posts: 89
Germany, NRW
I think you have forgotten this part:

Code:
MATERIAL* mtl_toon =
{
	effect= "toon.fx";
	flags= AUTORELOAD;
}




Gamestudio: A7.82 Commercial/A8 Commercial
System specs (Laptop):
Windows 7 64bit
DirectX v10.1
Intel Core i7-720QM CPU @ 1,60 GHz
4GB DDR2 Ram
NVIDIA GeForce GT 230M (1024MB)
Re: How to use tha shader library (mtlFX) [Re: TrackingKeks] #336715
08/05/10 20:04
08/05/10 20:04
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
Actually the problem has been that I have to include it this way:
#include "mtlFX.c";
because it is in the project folder. Otherwise the engine doesn't find it.
Problem fixed! Thx to all for answers.


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