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, alibaba), 1,184 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
Starting with shaders #66905
03/17/06 17:47
03/17/06 17:47
Joined: Jul 2005
Posts: 409
T
Trev101524 Offline OP
Senior Member
Trev101524  Offline OP
Senior Member
T

Joined: Jul 2005
Posts: 409
Hi, I have decided to take my first steps into shaders, and have a question or two. From what I have read from other posts, you must use an .fx file for shaders. Is this a plain .txt file saved as .fx??? Also, I know that shaders are written in HLSL, but how do you include the .fx file, written in HLSL, in your main c-script code??? Do you just use the include command??? Thank you for your time.

Re: Starting with shaders [Re: Trev101524] #66906
03/17/06 19:06
03/17/06 19:06
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
In short, materials use shader codes with the effect command. FX files are apparently plain text format (unformatted text). I don't know how shaders work or how they are written (they're not in the manual).

Code:

material quicktest
{
ambient_red = 255; // full brightness
ambient_green = 255;
ambient_blue = 255;
effect = "
technique technique_name
{
pass p0
{
// insert shader code here
}

// pass p1 // for additional passes
}

// technique simpler // additional techniques for lower end cards
" // end effect string
}

action my_action
{
my.material = quicktest; // assigns the material for the shader
}



This is as far as I can go. The manual only gives the information I've given. It doesn't explain how to do any calculations, or what the other options are available. I wished it did though.

This thread, however, should be moved to the shaders forum....


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Starting with shaders [Re: ulillillia] #66907
03/17/06 19:15
03/17/06 19:15
Joined: Jul 2005
Posts: 409
T
Trev101524 Offline OP
Senior Member
Trev101524  Offline OP
Senior Member
T

Joined: Jul 2005
Posts: 409
I agree ulillillia, my first thought was... read the manuel. However, I was very disapointed by the description of shaders... practically nonexhistant, as you said. So, I found some intro to HLSL documents and am trudging through those now. Thanks for the speedy response, I will just "trial and error" my way through shaders I guess... (most like more error than trial). Thanks again.

Re: Starting with shaders [Re: Trev101524] #66908
03/18/06 13:29
03/18/06 13:29
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
Quote:

Is this a plain .txt file saved as .fx???



jepp.
Quote:

Also, I know that shaders are written in HLSL, but how do you include the .fx file, written in HLSL, in your main c-script code???



The WIKI is your best friend with this! username/password: acknex


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