Archived

This topic is now archived and is closed to further replies.

Whats the difference between a "shader" and a .fx file?

This topic is 5148 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know what pixel and vertex shaders are. But since the new direct X there have been these .fx files around. What is the difference between ordinary (Vertex and Pixel) shaders and fx files? thx

Share this post


Link to post
Share on other sites
FX files are wrappers which can contain combinations of asm vertex shaders, asm pixel shaders, HLSL and even fixed function states.

You can see more info in the SDK docs at:

DirectX Graphics ->
Programming Guide ->
The Progtammable Pipeline ->
Effects

DirectX Graphics ->
Reference ->
Effects

--
Simon O''Connor
3D Game Programmer &
Microsoft DirectX MVP

Share this post


Link to post
Share on other sites
S1CA, I recently read about effects files in Greg Snooks "Real-Time 3D Terrain Engines" and they seemed really useful. Have you any idea how much they have been taken up by developers?


pan narrans | My Website | Study + Hard Work + Loud Profanity = Good Code

Share this post


Link to post
Share on other sites

another difference is that an effect file can contain many different versions of the v/p shaders for different hardware; and it's very easy to change between them (change "technique").
i think that is what microsoft states are the main benefit...

[edited by - apanjocko on November 9, 2003 3:49:08 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by pan narrans
S1CA, I recently read about effects files in Greg Snooks "Real-Time 3D Terrain Engines" and they seemed really useful. Have you any idea how much they have been taken up by developers?


Quite a number of PC/Win32 only developers have started using them AFAIK, particularly with the useful things in the newer effects and techniques stuff such as being able to have a binary/precompiled version of the .fx file, annotations etc

In my home (PC only) engine I use them for everything - there''s already tools for them (fxc, EffectEdit etc), they''re known and well documented, they''re ideal for data driven design etc.


Most cross platform developers have their own very similar systems though the need to re-write the engine side code for each alternative platform, add alternative platforms to the tools etc as well as some additional requirements for extra features (PS2 VU microcode for example is more complex than a vertex shader, and on the flipside, there isn''t a HLSL equivilent for PS2).

--
Simon O''Connor
3D Game Programmer &
Microsoft DirectX MVP

Share this post


Link to post
Share on other sites