HLSL beginning

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
omg_fail
Posts: 83
Joined: Wed Apr 20, 2011 1:14 pm
Location: Germany/Bavaria
Contact:

HLSL beginning

Post by omg_fail »

Hello guys.

I am on starting with hlsl shaders and i would be very happy if you can give me some recommend shader tutorials.
The best is if they where german , but english will work too.

Also I have a question about the formats.
Some time ago i read that hlsl or glsl languages are like assembling , so you do not need any compiler , jus save it as .frag .vs .hlsl .......
Is this right ? I am not sure because i downloaded Nividea FX Composer and the screenshots really lokks like a compilder , or even more like a whole ide.

Hope you can help me a bit

- 7xCore
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: HLSL beginning

Post by Radikalizm »

Google should provide you with a lot of decent tutorials

And shaders do need to be compiled, but this can be done at runtime if preferred
Shaders can also be compiled during a pre-processing stage as to get faster loading times, a lot of larger studios use an uber-shader approach where multiple permutations are stored within a single shader file which can then all be individually compiled during pre-processing or at runtime using compile flags based on the requested permutation
omg_fail
Posts: 83
Joined: Wed Apr 20, 2011 1:14 pm
Location: Germany/Bavaria
Contact:

Re: HLSL beginning

Post by omg_fail »

Ok thanks for now.
I just started Fx Composer and it contains a compiler.

*Shaders can also be compiled during a pre-processing stage as to get faster loading times
So on the startup of the game the shaders compile itself ??

*runtime using compile flags based on the requested permutation
What does this mean ?
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: HLSL beginning

Post by Radikalizm »

omg_fail wrote:Ok thanks for now.
I just started Fx Composer and it contains a compiler.

*Shaders can also be compiled during a pre-processing stage as to get faster loading times
So on the startup of the game the shaders compile itself ??

*runtime using compile flags based on the requested permutation
What does this mean ?
A pre-processing stage happens during the creation of maps or assets, it means the shaders required to run a map will already be compiled so the game itself doesn't have to worry about compiling them at runtime

Just like in C and C++ you can use the #define, #ifdef, etc. preprocessor directives in shaders to enable/disable functionality at compile-time
This way you can create different permutations from a single piece of code based on the parameters you pass to your shader compiler (which can come in handy for large projects which needs a lot of similar shaders)
omg_fail
Posts: 83
Joined: Wed Apr 20, 2011 1:14 pm
Location: Germany/Bavaria
Contact:

Re: HLSL beginning

Post by omg_fail »

Ah so its kind of seperating , isn't it ?
Post Reply