Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm interested in learning about Shaders: What are they, when/for what would I use them, and how to use them. (Specifically I'm interested in Water and Bloom effects, but I know close to 0 about Shaders, so I need a general introduction).

I saw a lot of books that are a couple of years old, so I don't know if they still apply. I'm targeting XNA 4.0 at the moment (which I believe means HLSL Shaders for Shader Model 4.0), but anything that generally targets DirectX 11 and OpenGL 4 is helpful I guess.

share|improve this question

closed as too broad by Alexandre Vaillancourt, Josh Petrie Dec 21 '15 at 6:04

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 6 down vote accepted

These are all still relevant (and free online). CG tutorial (cg is virtually identical to hlsl) would probably be a good starting point.

The GPU Gems books are sorta like recipe books for random effects, they assume you know what you're doing, but they're great resources once you're more comfortable with things.

CG Tutorial

GPU Gems 1

GPU Gems 2

GPU Gems 3

EDIT: and yeah, just about any tutorials/books you can find on shaders will still be relevant, a shader written for Shader Model 1 will run with Shader Model 4, and in a lot of cases you'll want to target lower shader models, since many effects don't need the extra stuff offered by the newer models (you can make nice water and bloom effects with SM2.0, and then if dx9 is an option you can target lower end hardware).

share|improve this answer

Shader Languages doesn't differ so badly, thus it is possible to learn one language and transfer this knowledge to other languages. Personally I started with Cg. There are really good free resources by Nvidia.

Just have a look: http://developer.nvidia.com/page/cg_main.html

After you get rid of the basics you can do some research at specific shaders. It happens that there is no "bloom shader" or "water effect shader", but there are several different techniques and models you can implement with shaders.

In my opinions, you don't need a book, if you are just intrested in some cool effects, but if you want to gain some knowledge in the field of computer graphics, I recommend to you the ShaderX oder GPU Gems series.

share|improve this answer

I've been looking for the very same thing and found this: http://wiki.gamedev.net/index.php/D3DBook:Book_Cover

It's only available only, which is a shame, but as far as I have looked into it, is a good read.

share|improve this answer

Since you listed OpenGL as a tag, and nobody else has linked to it yet, the OpenGL shading language (aka. orange book) is a pretty good resource. It covers the shading language, as well as plenty of use cases.

share|improve this answer

There's also the ShaderX series of books. The first couple are free to download from the link and cover a range of topics, including water. The articles in the free books were originally targeting quite old shader versions, but the techniques should hopefully be clearly described and easily transferable.

share|improve this answer

I'm pretty new to shaders myself but I've been reading the GPU Pro books by Wolfgang Engel. They've been blowing me away with how incredibly easy and powerful the techniques are. Also the content isn't discussed like most academic text either, it focuses more on implementation details and the trade offs between different techniques.

http://www.amazon.com/GPU-Pro-Advanced-Rendering-Techniques/dp/1568814720%3FSubscriptionId%3D008XA1X9NAPEJGHQX182%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1568814720

http://www.amazon.com/GPU-Pro-2-Wolfgang-Engel/dp/1568817185%3FSubscriptionId%3D008XA1X9NAPEJGHQX182%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1568817185

share|improve this answer

I just discovered this book by Patricio Gonzalez Vivo available on line: The Book of Shaders

I'm only a couple chapters in so I am unable to provide an in-depth review, but so far I'm finding it very clear, entertaining and practical. It starts at the very beginning and appears to end up covering more or less all the topics that I can name (as a total beginner in the world of graphics). It is, however, apparently a work in progress, and the later chapters are not available - I'll be eagerly awaiting updates.

P.S: You probably already know about it, but just in case, I highly recommend shadertoy.com as your first "practice sketchbook". I was initially learning in Processing, but I find this web app even better for the purposes of learning.

share|improve this answer
    
apologies for not linking properly to shadertoy.com, as a new account I'm only able to add 2 links, if anyone is able to edit my post and add the third link properly that would be much appreciated. – Toadfish Dec 21 '15 at 2:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.