How can I use .fx shader files ?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
porcus
Posts: 149
Joined: Sun May 27, 2007 6:24 pm
Location: Germany

How can I use .fx shader files ?

Post by porcus »

If you want to use a shader, you have always to give a pixel and a vertexshaderfile to the engine. My question is:
Is it possible to use .fx files, although there is only one file than two?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I think you've got to use either hlsl or glsl shaders, depending one whether you're running with DX or OGL. So if you wanted to use fx you'd have to convert it.
Image Image Image
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yes, CG is a pretty good shading language (nvidia) and is very similar to hlsl.
Image Image Image
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Last edited by Spintz on Mon Dec 10, 2007 1:55 pm, edited 1 time in total.
porcus
Posts: 149
Joined: Sun May 27, 2007 6:24 pm
Location: Germany

Post by porcus »

JP wrote:I think you've got to use either hlsl or glsl shaders, depending one whether you're running with DX or OGL. So if you wanted to use fx you'd have to convert it.
How can I convert .fx files to vertex and pixelshaderfiles ?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I'm not sure how .fx files work but aren't they just one file with both the shaders inside?
Image Image Image
Falcon
Posts: 36
Joined: Sun Jan 13, 2008 9:24 pm
Location: Z_California

Post by Falcon »

I'm pretty new to shaders, but aren't .fx files written in HLSL? Every hlsl demo I've found gives me a .fx file. This is the equivalent of .hlsl?
-< Dante >
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

Nope, fx files (can) contain more than just shader code, for example defining what texture to use, or that the texture used should be clamped. Its like hlsl + nifty shortcuts. sortof.
If you don't have anything nice to say, don't say anything at all.
Post Reply