Tom Miller's Blog

The Ramblings of Miller. These postings are provided "AS IS" with no warranties, and confer no rights.

To shader or not to shader, that is the question...

To shader or not to shader, that is the question...

  • Comments 7

So i'm finishing up my second book (an introduction to 3d game development), which is intended to be a 'beginners' book, and i find myself continually arguing amongst myself about whether or not i should use shaders in the last 'sample game'.  Couple this with the fact that my 'advanced' book which will be out a few short months after this beginner book is virtually entirely shader driven, with next to nothing using the fixed function pipeline.

The argument i'm having with myself is the potential that the shader code in the beginners book would be too difficult to be classified as 'beginner', while at the same time i don't want to simply 'ignore' the shaders because they can be quite powerful.  Right now i'm leaning towards some basic shaders for the last game, just as a small 'introduction' that hopefully won't catch anyone off guard. 

I'd rather have someone complain about too much (or too difficult) information than not enough.

  • Definitely include the discussion of shaders. Even tho the book is for beginners I think that it is important for anyone using the DirectX stack to understand the basics of the technology as it is becoming increasingly important for the production of highly polished games. Also anyone reading a book on game programming has probably already made the commitment to learn as much as poissible since there is so much to learn and why short change them? Can't wait for the book (make sure to announce :-) )
  • Agreed. I would like to ask if it would be possible to give a example in the book where you have a resizeable form running direct3d and having the direct3d rendered part of the form keep rendering while moving (or perhaps while even resizing) the window. I tried to do this as my first MDX thing, but to no surprise, changing size of the form while rendering in another thread will give exceptions. Also i noticed a high cpu usage when the form is moved so that the d3d view is covered by the taskbar or minimized. I tried to remove this by adding a thread.sleep but then i noticed that while it fixed the high cpu usage when the d3d is hidden, it also caused 2-3 percent higher cpu usage compared to when i didn't use thread.sleep!
  • One way to look at it is from a cost standpoint: presumably anyone that's going to read your third book will have read the second book. However, someone that's a beginner and wants to know a little about shaders doesn't want to have to shell out $50 (or whatever) to buy a whole other book. But if they don't care about shaders, they simply skip that chapter.

    So, from a pure customer satisfaction standpoint, shaders in the first book seems to make sense.
  • totally agree! Shaders are 'the future' of 3d, and any beginner books should include a bit about it. And the nyou can take that to 'the next level' in your advanced book... :)
  • Well, I'm a beginner and i got your existing MDX book - i've decided to wait with the chapters on shaders, but I'm glad they are there, and will be looking more at them when i feel more confident in the basic stuff.

    My opinion: Leave them in, and let the readers filter them out if they feel like it.
  • So there will be a third, more advanced book after your second? Cool, i really like your first book, and can't wait for the next one. What will the third, advanced one cover?

    concerning the topic, i'd say since kick start already covers a bit about shaders, why not this one? Go ahead with it, unless you can use the space for more appropriate things.

    please don't only focus on the graphical aspects in the upcoming books.
  • Yep, shaders are definitely the future. If you readers have worked through the book, they also will understand the basics of shaders. Moreover that may help some of the beginners to decide if they want to buy some more advanced book that discusses shaders in more detail.
Page 1 of 1 (7 items)