Open Shading Language for Blender. A practical primer

Open Shading Language for Blender. A practical primer

Michel Anders released a self-published book on creating custom shaders for Blender in Open Shading Language. We reviewed it and found it well worth its price. Here is why.

First and foremost, you need at least some programming experience to get anywhere with this book. Michel suggests that being able to write short snippets of code in a procedural language like C, C++, Java, Python, or even Visual Basic would help a lot. Open Shading Language itself has a syntax quite similar to that of C, as well as other shading languages.

Open Shading Language for Blender primer, as seen through Okular

Michel's expertise in writing shaders with OSL shines through the whole primer. What's even better is that he managed to share his knowledge in a non-condescending way, going from easy topics to more complex ones which makes the text easy to follow.

The book starts with some basic principles like data types, vectors, normals and so on. Most of the book, however, is about solving particular tasks, i.e. creating various shaders. And every time Michel patiently explains how he does it, what solutions (and why) are best etc.

Open Shading Language for Blender primer, as seen through Okular

The book ends with quite useful information on improving and debugging the OSL code. E.g. Michel suggests that should you feel like there's something wrong in the code, it's a good idea to create another external socket, map it to an intermediate value and connect it to e.g. diffuse shader to check what you actually get in the middle.

The book has 3 minor (and debatable at that) issues:

  1. Delivery file format. The book is only available in EPUB which works best on mobile devices and less so — on desktops. Okular handles the book well enough though (while dropping all custom fonts and suchlike).
  2. Shaders complexity. Most shaders in the book are somewhat simplistic. More complex shaders would give more impressive results, but that would probably affect both the learning curve and the length of explanations.
  3. Grammar Nazis disappointed. Missing commas across all of the book are somewhat frustrating. But that's just another reminder that self-publishing still has to catch up with the traditional editing process where you have copy-editors and proofreaders. On the other hand, if you are not that picky, you're going to be just fine.

Since we are talking about EPUB, the measured length of the book will depend on the reader app. Nook Simple Touch says there are 98 pages, while Okular counted ca. 160 pages. No matter how many pages you see, the primer is well worth its $5,99 price tag.

A sample chapter is available free of charge, and shaders code along with .blend files is up on GitHub.

Conclusion: we heartily recommend the book to every Blender user who wants to create custom shaders in Blender and doesn't mind getting his hands dirty with a bit of programming.

Buy the "Open Shading Language for Blender" primer at SmashWords

Was it useful? There's more:

1 Responses. Comments closed for this entry.

  1. Thanks for the informative review.  And with respect to self-editing, it is a nearly impossible task.  I have a children’s book that I’ve published (created entirely with open source programs) and every time I read through it, it seems I find another previously missed mistake or typo.  I really need to find a better solution before putting out the next book, but professional editing services are a bit outside my budget.