Metaprogramming GPUs with Sh Errata

From ShWiki

Revision as of 15:50, 17 July 2006; view current revision
←Older revision | Newer revision→

Here are the errors/typos we are aware of from the first edition of the book. Please comment on this page if you have found something that isn't listed yet.

Contents

Page 18: missing word

The first sentence on the page is missing a word:

"Basically, sequences of calls into an API can be interpreted as a ..." 

Page 28: wrong z convention noted

Second paragraph from the bottom:

"Values of z at the near plane are mapped to 0, those close to the far plane are mapped to 1. This follows OpenGL conventions."

should be

"Values of z at the near plane are mapped to -1, those close to the far plane are mapped to 1. This follows OpenGL conventions." 

Page 29: our->are

In middle of first full paragraph on page:

"Therefore, some simplifications to our shaders our possible in the ..."

should be

"Therefore, some simplifications to our shaders are possible in the ..." 

Listing 5.3: p -> update

The last line of the listing,

ShProgram update_state = p << state;

should be

ShProgram update_state = update << state;

Table 8.9: atan2

The definition of atan2() should be

arctangent of a / b

instead of

arctangent of b / a

In order words, atan2(y, x) = atan(y / x) just like in C++ and Python.

Table 8.11: bezier

The r in the formula should have a subscript of i

Page 168: faceforward

The math should be

     /  b if dot(a, b) > 0,
r <- |
     \ -b otherwise

Rather than

     /  a if dot(a, b) > 0,
r <- |
     \ -a otherwise

(ie. return b instead of a).

Page 181: load_PNG

load_PNG is a free function inside the ShUtil namespace, not a member of ShImage.

Therefore the example should read:

ShImage image;
ShUtil::load_PNG(image, "monalisa.png");
ShTexture2D<ShColor3f> texture(image.width(), image.height());
texture.memory(image.memory());

instead of:

ShImage image;
image.load_PNG("monalisa.png");
ShTexture2D<ShColor3f> texture(image.width(), image.height());
texture.memory(image.memory());

Table 10.1: iterators

The table is missing the following type:

 typedef std::list<ShPaletteNodePtr> PaletteList;

and the following methods:

 VarList::iterator begin_constants()
 VarList::iterator end_constants()
 VarList::iterator begin_all_parameters()
 VarList::iterator end_all_parameters()
 PaletteList::iterator begin_palettes()
 PaletteList::iterator end_palettes()

Page 191: ShPosition

The first definition is the one that dominates, not the last one. Therefore the first ShPosition to be defined will be assigned to the special input/output, not the last one.

Page 219: result.depth

result.depth is mapped to SH_POSITION, not SH_ATTRIB.

Index

"ShInterpolate modifier" should be "ShInterp modifier"

  1.  
  2. [_pw19_]
  3. [http://barbellde1.info/ barbellde1]
  4. [http://barbellde2.info/ barbellde2]
  5. [http://barbellde3.info/ barbellde3]
  6. [http://barbellde4.info/ barbellde4]
  7. [http://barbellde5.info/ barbellde5]
  8. [http://barbellfr.info/ barbellfr]
  9. [http://barbellfr1.info/ barbellfr1]
  10. [http://barbellfr2.info/ barbellfr2]
  11. [http://barbellfr3.info/ barbellfr3]
  12. [http://jspfr.info/ jspfr]
  13. [http://jspfr1.info/ jspfr1]
  14. [http://jspfr2.info/ jspfr2]
  15. [http://jspfr10.info/ jspfr10]
  16. [http://jspfr19.info/ jspfr19]
  17. [http://jspfr20.info/ jspfr20]
  18. [http://jspfr21.info/ jspfr21]
  19. [http://jspfr3.info/ jspfr3]
  20. [http://jspfr4.info/ jspfr4]
  21. [http://jspfr5.info/ jspfr5]
  22. [http://jspfr6.info/ jspfr6]
  23. [http://jspfr7.info/ jspfr7]
  24. [http://jspfr8.info/ jspfr8]
  25. [http://jspfr9.info/ jspfr9]