[ANSWERED] Shader Tutorial Question
[ANSWERED] Shader Tutorial Question
What is .hlsl?
I've searched for it on google, but everyone refers to a directx hlsl file as a .fx file.
So I thought, maybe it's just an .fx file renamed with the extension .hlsl.
Alas, no.
NVidia FX composer doesn't recognise it as a hlsl fx file even with a .fx extension.
Maybe the .hlsl extension was used for older dx shader files?
P.S. Irrlicht does support .fx files right?
I've searched for it on google, but everyone refers to a directx hlsl file as a .fx file.
So I thought, maybe it's just an .fx file renamed with the extension .hlsl.
Alas, no.
NVidia FX composer doesn't recognise it as a hlsl fx file even with a .fx extension.
Maybe the .hlsl extension was used for older dx shader files?
P.S. Irrlicht does support .fx files right?
Last edited by EvilDavo on Wed Jun 16, 2010 10:27 am, edited 1 time in total.
False. Both .hlsl and .fx are just file extensions. The important part is what's inside the file (the shader program you wrote). Irrlicht examples put HLSL shaders in .hlsl files while lots of other things put them in .fx files, but they will get read into Irrlicht the same way. Pick whatever extension you want.
Referring to passes and such, other game engines and FX Composer requires you to add additional things to the file along with the shader program itself, such as "techniques," "passes," and which Shader Model to compile the shaders with. Irrlicht does this for you - you specify the SM to compile with in the code and it takes care of it for you (just look at the shader example). FX Composer also requires you to add some additional descriptive data to your shaders so it knows how to interpret them and what variables to automatically set.
So to answer your question, Irrlicht supports shaders contained in .hlsl, .fx, .wtf, .ftw, .anything, or any other file extension you want to come up with. It only cares about what is in the file, not its name or extension.
Referring to passes and such, other game engines and FX Composer requires you to add additional things to the file along with the shader program itself, such as "techniques," "passes," and which Shader Model to compile the shaders with. Irrlicht does this for you - you specify the SM to compile with in the code and it takes care of it for you (just look at the shader example). FX Composer also requires you to add some additional descriptive data to your shaders so it knows how to interpret them and what variables to automatically set.
So to answer your question, Irrlicht supports shaders contained in .hlsl, .fx, .wtf, .ftw, .anything, or any other file extension you want to come up with. It only cares about what is in the file, not its name or extension.
eh? If we use the definition of ".fx" at the bottom of this doc:
http://msdn.microsoft.com/en-us/library/ms810449
...but maybe I'm getting this wrong, I've only ever used GLSL myself
http://msdn.microsoft.com/en-us/library/ms810449
Then it does contain techniques etc much like Ogre's material files. Of course we may rename the extension whatever we like, but it seems to me the common interpretation is that fx file contains more than just the HLSL.Effects can encapsulate rendering state as well as shaders written in asm or HLSL, including fall-back versions targeted at legacy hardware. A given Effect is generally stored in a single .fx or .fxl file and the file itself can contain multiple versions of the Effect called Techniques
...but maybe I'm getting this wrong, I've only ever used GLSL myself