An OSL Wood Shader for Blender Cycles

I tried my hand at Larry Gritz’ advanced renderman oak shader and adapted it for OSL:

you can find the shader code and example node setup here:


Great job

On your blog you mentioned the derivatives did not work for you, but I have been able to get them to work. There is a filterwidth.h header that I began to port to OSL, it’s not hard, and will allow you to do all of those antialiasing functions. There is also a noises header.

good to know those derivatives are working, it just means I have to study it some more:D

i also noticed that in order to make bump mapping work, a texturecoordinate inputnode must be present. What is your experience on this point?

Looks pretty good, especially the planks! I was thinking of trying to port my procedural wood to OSL one of these days.

please do, it is always nice to be able to compare different approaches. at the moment i am thinking how i could incorporate knots inthe tdxture so that maybe i czn texture some lower quality wood like pine (the oak shader is basically a warped cylinder of rings so just a trunk realy without any trace of side branches} maybe you or other members have already made some progress?

My approach was basically the same as yours: warped cylindrical rings with a color map. I was wondering about knots, too, but I haven’t had time to attack it. It seems like OSL has much more flexibility than nodes so it SHOULD be possible I would think.