Skip to main content
GameDev.net gamedev.net
🔒 Locked

Learning shaders

Started by d000hg Dec 16, 2005 at 7:26 AM 5 replies 1.3k views
Original Post
d000hg
d000hg
I looked at a few articles and tutorials for SM1.0/1.1 but never actually got around to using it. I must learn eventually so I wondered if you guys had recommendations for books? My general coding and graphics algorithm knowledge is good and I have lots of experience with fixed-function D3D soI don't want a book covering that stuff. I know the idea of what a programmable pipeline does so I'm not sure if the first ShaderX2 is suitable or maybe the 2nd volume (or X3) would suit me better? But while the ShaderX books get good reviews they're not GREAT reviews. I should say that I've never been into making cutting-edge graphics - I'm sure shaders 2.0 or even 1.x would give me all the poweer I need and people with SM3.0 cards are still quite rare. Thanks for your advice.
Guoshima
Guoshima
hmm for learning shaders, I would simply download FXComposer or something and start playing around a bit. It's rather easy. Something like C/C++ if you're using HLSL/CG (which I would suggest), but easier.

Great books for more advanced techniques (ones you know how to use shaders), are the GPU Gems and ShaderX series.

Btw, does anyone already have ShaderX4. Mine is preordered but amazon doesn't want to ship it .. ???

Regards,
Kenzo
d000hg
d000hg
I guess once you get D3D set up to load your shaders you can just play with them and see how it affects the rendering.

I'm still on D3D8.1 btw - I sort of plan to port my code to DX9, do I have to do this to avoid doing my shaders in asm? Not that I mind using asm, but apparently this is pretty pointless?
Basiror
Basiror
i have used cg once in the past and i would use it again
its easy to use, straight forward and cross api no restriction on d3d

i think yann l once said they use cg in their engine as well
http://www.8ung.at/basiror/theironcross.html
centipede
centipede
Quote:
Original post by d000hg
I'm still on D3D8.1 btw - I sort of plan to port my code to DX9, do I have to do this to avoid doing my shaders in asm?

DX8 doesn't have HLSL compiler, so your only choice is to use assembly shaders. I recommend moving to DX9, HLSL is just so much nicer.
Jason Z
Jason Z
A really great way to learn about the programmable pipeline and getting beginning shaders running is The Cg Tutorial. It explains everything in Cg, but the syntax for Cg and HLSL is very nearly identical (if not identical!).

There are sufficient examples and the majority of them will run on ps_1_1 hardware. It's the one that got me started... [grin]

After looking to my bookshelf, the GPU Gems series was good, and the ShaderX series is also good. However, if you are planning on doing high level language programming instead of assembly shaders then you will want to go for ShaderX2. ShaderX3 is certainly a more advanced subject matter.

But again, I would highly recommend the Cg Tutorial to get started (check it out in a bookstore first). The other books that I mentioned are helpful once you have the basics down. Once the basics are hammered out, don't overlook the .fx format. It allows you to use programmable pipeline along with fixed function fallbacks and makes setting parameters a piece of cake. They are the basis for the graphics subsystem in my engine. Hope this helps!
Jason Zink :: DirectX MVP   Direct3D 11 engine on CodePlex: Hieroglyph 3 Direct3D Books: 
d000hg
d000hg
Thanks for all your advice.

The general theme seems to be that shader programming is adequately covered by online resources - or would you always use online resources for any field?

If I were to get a shader book, then as a new shader programmer ShaderX2 Vol I seems to be about the best there is?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.