Jump to content

  • Log In with Google      Sign In   
  • Create Account


Best place to start shader programming


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Gorbstein   Members   -  Reputation: 120

Like
0Likes
Like

Posted 25 April 2011 - 11:24 AM

I've only ever programmed the fixed function pipeline and want to start playing with shaders. Where, in terms of sites, books, tools and language, is a good place to start?

Assume I have good knowledge of 3d programming but no knowledge of shader technology at all, how it works, etc. What are the things I should know? What are the main shader languages and what are the differences? Do I have to write different shaders for OpenGL and DirectX?

I'd also be interested to know what level of shader programming is currently 'compatible' with most of the PC hardware base just now.

Thanks,

D

Sponsor:

#2 AverageJoeSSU   Members   -  Reputation: 516

Like
1Likes
Like

Posted 25 April 2011 - 11:33 AM

You can start in any or all of the following,
The Cg Tutorial by nvidia,
The Orange Book (GLSL), (get the latest addition)
The DirectX SDK (HLSL)

Shader model 3 (dx9) is the most common shader model you will find in hardware today.
If i recall the orange book is great for those leaving the fixed function world and entering the programmable pipeline world

------------------------------

redwoodpixel.com


#3 Gorbstein   Members   -  Reputation: 120

Like
0Likes
Like

Posted 25 April 2011 - 01:00 PM

Thanks!

Taking a trip to amazon. The cg tutorial also looks very good.

D

#4 lotusf1   Members   -  Reputation: 137

Like
1Likes
Like

Posted 25 April 2011 - 08:10 PM

ShaderX2 books are freely available and cover SM 3.0, as averagejoe said, SM 3.0 is kind of the standard, yes there is shader model 5.0 these days but a ton is still done in 3.0.

http://tog.acm.org/resources/shaderx/

You can skip ShaderX first book as it is about programming shaders in assembly.

#5 EricRRichards   Members   -  Reputation: 105

Like
1Likes
Like

Posted 25 April 2011 - 08:27 PM

One of the easier to follow OpenGL tutorials (which uses shaders heavily, only 2.0, I believe, though) is here: http://duriansoftware.com/joe/index.html

#6 allingm   Members   -  Reputation: 420

Like
1Likes
Like

Posted 25 April 2011 - 09:30 PM

I've only ever programmed the fixed function pipeline and want to start playing with shaders. Where, in terms of sites, books, tools and language, is a good place to start?


I started my learning with DirectX. You can find the best tutorial for shaders in the following books:
http://www.amazon.co...03786385&sr=8-2 (DirectX 9)
http://www.amazon.co...03786385&sr=8-1 (DirectX 10)

You can also find a tutorial on the game dev book:
http://wiki.gamedev....Book:Book_Cover

Assume I have good knowledge of 3d programming but no knowledge of shader technology at all, how it works, etc. What are the things I should know?


If you want a run down of the pipeline you can probably find it in the books above, but you can also find it in this awesome book:
http://www.amazon.co...03786596&sr=1-1

What are the main shader languages and what are the differences?


There are mainly 2 "shader languages", HLSL and GLSL. HLSL works with DirectX and GLSL with OpenGL. The differences between these are actually quite minimal. The place where they really differ is the different versions within those. I'm most familiar with HLSL, so I'll break it down for you. You can find the different version numbers (for some reason 5.0 isn't included) here: http://en.wikipedia....Shader_Language While the page lists the hardware differences the main things you need to know are:

v 3.0 - DirectX 9
Pixel and vertex shaders
v 4.0 - DirectX 10
Adds the geometry shader
v 5.0 - DirectX 11
Adds the compute shader and hull shaders for tessellation

Do I have to write different shaders for OpenGL and DirectX?

Yes, but the code is very similar.

I'd also be interested to know what level of shader programming is currently 'compatible' with most of the PC hardware base just now.


I would say if you're shooting for the greatest level of compatibility I would shoot for DirectX 9. If you want the most shaders you can learn I would go with DirectX 11 (requires Windows Vista or 7). I would say use DirectX 11 for making graphics demos and learning, and DirectX 9 for making a game other people can play.

#7 Gorbstein   Members   -  Reputation: 120

Like
0Likes
Like

Posted 26 April 2011 - 01:54 AM

Brilliant responses so far, thanks. Already having fun getting my teeth into this.

D

#8 allingm   Members   -  Reputation: 420

Like
0Likes
Like

Posted 27 April 2011 - 01:53 AM

One more of a similar post:

http://www.confettispecialfx.com/you-want-to-become-a-graphics-programmer




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS