Page 1 of 1

HLSL beginning

Posted: Fri Aug 19, 2011 12:57 pm
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

Re: HLSL beginning

Posted: Fri Aug 19, 2011 1:01 pm
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

Re: HLSL beginning

Posted: Fri Aug 19, 2011 1:22 pm
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 ?

Re: HLSL beginning

Posted: Fri Aug 19, 2011 1:39 pm
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)

Re: HLSL beginning

Posted: Fri Aug 19, 2011 5:19 pm
by omg_fail
Ah so its kind of seperating , isn't it ?