Does anyone have experience using a Python script to compute volumetric density for an arbitrary mathematical function?
I’ve build a Node Tree to create a Gaussian density distribution (density = constant * exp(-r^2)) for a cube filled with volumetric emission material in Cycles. It works just fine, but it’s a rather indirect way to do something in a few lines of code. I’ve attached the .blend if you care to look. I haven’t gone to the trouble of making a custom node group, but that would be my next step if I continued with the Node route.
You’ve just opened up a whole new world for me! I had seen some discussion of OSL, but those articles were at a very high level. I got the impression that OSL was beyond me. I did a little looking around and found www.openshading.com and Gottfried Hofmann’s articles on Blender Cookie.
Do you have any favorite resources or documentation on OSL? I’d love to hear about them.