HLSL Tutorials

Started by
5 comments, last by striker87 12 years, 3 months ago
Was wondering if anyone knows of any good HLSL tutorials for Directx 11. I tried googling but haven't found a good tutorial yet but will continue to search to see if I can find something. If anyone has any suggestions or links to sites with tutorials I will greatly appreciate it.
Advertisement
There isn't much tutorial to it to be honest. If you know C, C++ or C# then you know syntax. Everything else is just math.

Microsoft has HLSL Reference, where you can find syntax and intrinsic functions: http://msdn.microsoft.com/en-us/library/windows/desktop/bb509638(v=vs.85).aspx
nVidia SDK 11 has few techniques (together with shaders), maybe you'll find something there: http://developer.nvidia.com/nvidia-graphics-sdk-11-direct3d
nVidia also has shader library: http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html

Hopefully this helps.
Although you want to target D3D11, there's a wealth of HLSL tutorials for XNA on the official AppHub site, as well as the internet. As with the Nvidia samples/shader library (there are also D3D SDK samples you can look at, plus all the GPU Gems books - I believe some are free that you can download off of the Nvidia site). Most of the concepts are transferable, but when it comes to syntax and language functionality, the MSDN resources are really your best bet of actually learning HLSL or as a reference while developing HLSL shaders. Plus if you're familiar with C syntax, it's basically that - just without pointers.
I'd recommend a good book on vector and matrix math - I have "3D Math Primer for Graphics and Game Development" - Version 1; version 2 apparently went a bit silly. Once you understand what the tutorials and samples are doing, it's a lot easier to write your own.

Also, for anyone trying to (re)-learn high school or college/university math or science, I'd highly recommend Khan Academy's 2,600 video tutorials. All free, all excellent.
Thanks for all the suggestions! This is very helpful and I greatly appreciate it. I also have another question as to what tools should I be using as a graphics programmer. I know Intel has some and nVidia as well but not sure which tool set I should use or if there are other tools I should consider to try. Again thanks for all the help.
Of course your primary tool would be your IDE - e.g. Visual Studio. To write shader code, I generally use VS + NShader (syntax highlighting), although sometimes I just use notepad++ (there was another thread on the DirectX/XNA forum about this, as there are a few other alternatives, but not much).

Perhaps the single most important tool that -anyone- involved in working with Direct3D should have, would be PIX. It's a tool that comes with the DirectX SDK that allows you to view the D3D calls your program makes. You're also able to view resources (e.g. texture and its mimaps, vertexbuffer contents), compiled shader code, debugging pixels, and most importantly - the various stages your geometry goes through when getting drawn (e.g. pre/post transforms). When something goes wrong or completely black, PIX will be your best friend in trying to track down what the problem is.

I don't have much experience with the tools like PerfHud, but I'm sure someone else can fill in that gap.
Thanks Starnik! Downloading NShader right now. biggrin.png I will also take a look at PIX so I can learn to use that. If anyone else has any more advice suggestions I'd love to hear them.

This topic is closed to new replies.

Advertisement