Book: Open Shading Language for Blender, a practical primer

I am pleased to announce the release of my new book
Open Shading Language for Blender, a practical primer.

it is a hands-on introduction that starts with simple example shaders that implement all sorts of patterns, continues with shaders for things like leopard spots and citrus fruit skin and ends with quite elaborate shaders that for example use external texture files, use information stored in xml files or mimic 3D transparent objects on a 2D plane.

It is a book about programming of course but you don’t need much programming experience to follow along. Each piece of code is explained in detail and example images are provided so that you know what to expect and I show relevant node setups. Of course all shaders are available for download, including .blend files to try them.

So, if you would like to start out with OSL you might visit the book site in my signature or you might download a sample first from my sample page:

I went to that link and it says access to all formats with purchase, but PDF is not one of the formats listed, do you know if it is? I’m not an ebook reader at all…

I am afraid that ePub is currently the only format available.

I just purchased my copy, thanks for making a nice eBook. It looks like a nice and compact resource. Also thanks for the acknowledgement at the end, much appreciated! :slight_smile:

Want to buy, waiting for confirmation link for registering with Smashwords… Wish I could buy it directly from you instead, without this registering nonsense.

Further, I’m definitely in the market for custom OSL shading services, don’t want to write shaders myself. If you’re interested in starting such a business, even if as nothing more than a self-employed freelancer, please publish your terms.

Slightly off topic, but in the spirit of this thread.

FOSS Ebook management and conversion tool.
Allows to read, manage, convert and upload to a preset list of mobile devices.

Bought the book and read it in as much detail as I was going to. Excellent, highly recommend it. The author takes you progressively from the simplest to the most advanced shader, all the way to faking geometry, complete with shadows. For six dollars, this is a steal. Thanks, Michel!

Excellent, perfectly timed. Have some money which was formerly mine.

Thank you guys for your positive remarks, it is rewarding to see people appreciate ones work :slight_smile:

If anyone has specific remarks on the content of the book or wants to point out stuff that could be better, I am open to suggestions, either to incorporate them in the existing book or maybe as inspiration for a follow-up.

Just purchased the book and will keep on supporting you, kudos for the great work !

Wow, your book is really informative, a must-read for anyone interested in OSL in Blender :slight_smile:

What a great book. I’m already on my third read-through.

Only feedback at this point is that the maths is heavy-going - I got all the way through high school maths but didn’t do linear algebra, vectors and so on. Just a bit of geometry which I’ve mostly forgotten. I’ll be over at Khan Academy swotting up on what I missed though because this is cool stuff. :slight_smile:

For folks who do find this a bit over your head but are still interested in procedural texturing in Cycles, the Cycles Materials and Textures Cookbook from Packt may be more your speed.

I buy one copy too.
It is really a good book.
Thanks for your effort.

For a follow-up, cracks (and grunge perhaps) “growing” into the object, perpendicular to the edge.

Is there a way of getting OSL to paint outside the object the shader is applied to? It would be great to have procedural little hairs for objects that have a cloth texture, for instance. Or procedural bubbles on foam. But I guess this can’t be done.

What might be doable - craters on moons, holes in cheese or bread, holes in wall plaster. Larger ones would still need to be sculpted, but smaller ones could be shaded, and the result should look better than bump, but without the overhead of displacement.

Also, a generic shader node that converts grayscale values to probability values for texture placement. Better yet, converting a normal map to probability values, so that the different colours of the map can also be used to control rotation or scale of the placed texture. For this to be useful however, we really need a better way of inputting textures into OSL nodes. The file path entry method is too limiting.

Sounds interesting! any chance on publishing it on amazon/Kindle?

I strongly encourage the whole Blender community to support this effort.

Yes please, originally a bit perplexed as to why it was not on amazon

@Ray Tungsteen: good suggestions, thank you. About painting outside the object: no that is not possible but once volumetric shaders are possible it should be doable by adding a slightly bigger volumetric shell to an object and generating hair like stuff inside it. I might have a try sometime because there already is a volumetric version of blender available on graphicall.

I agree completely about the limitation of the file path entry method. I spoke to Thomas Dinges (DingTo) on bcon13 and he was interested in using the code developed for the Python nodes for the OSL nodes as well. OSL as a language already supports metadata declaration for shader parameters so for a shader writer it would be easy to specify that some string parameter is a file path for example or an integer an enumeration. So lets wait what will happen in the future.

@all: I might consider distributing it via Amazon but for now I wait until it actually shows up at Barnes & Noble, Kobo and the Apple store (which will apparently take a few weeks). The reason for that is that my distributor (Smashwords) does not automatically forward books to Amazon as it does to those other retailers (because they have to do that by hand). The second reason is that Amazon has the worst royalty margin of all. You probably guessed that at the price I ask for the book I am not in it for the money, but if the return per copy is reduced to a few cents it’s hardly worth it.

However if it is just about wanting to read it on a kindle (instead of wanting to buy it at Amazon), using Calibre e-book manager it is quite simple to convert from ePub to mobi (I tested the result on different Kindle readers and the result looks ok).

But if it is not about the format, then if I may be so blunt, may I ask why you would prefer buying it at Amazon instead of another retailer?


– Michel

I don’t know about other people, and this answer is not related to books, but people prefer retailers that they already have account with. I prefer to buy games from only two eshop: Valve’s Steam and I’m not opening EA’s Origin account or what not that is available on the internet for both studios and indies. So maybe thats the reason, most people already have Amazon account.

@@varkenvarken I would recommend you to put it on Amazon for a higher price so that you can still have some profit that’s worth the effort. Amazon has a huge user base and some users will prefer to buy it for the higher price just for the convenience of reading it on their kindle. I purchased it from Smashwords but not everyone will.