photo: Romanesco broccoli I started playing with fractal shaders and in particularity I wanted to reproduce romanesco broccoli in SL. At first it was just a simple experiment but after each obstacle I got more persistent so eventually I discovered the world of calculus. I'm going to skip the theory part about phyllotaxis, Fibonacci etc and get straight to the shader math. Good site that explains it all is: http://www.math.smith.edu/phyllo/ Most of the math was found on Wolfram and WikiPedia pages First off we need to convert our UVs from cartesian to polar coordinate system Code: r = sqrt( pow( x, 2 ) + pow( y, 2 )); Code: theta = atan( x, y) + PI; // Note that PI offset has been added for polar translation // equation to work (for secondary florets) Next, Golden Angle for distribution pattern. Code: golden = PI*(3-sqrt(5)); To draw a secondary florets or a circle on polar coordinates we can use polar translation equations Code: r2 = sqrt(r*r-2*r*r0*cos( theta-th0 )+r0*r0); ...
r = sqrt( pow( x, 2 ) + pow( y, 2 ));
theta = atan( x, y) + PI; // Note that PI offset has been added for polar translation // equation to work (for secondary florets)
golden = PI*(3-sqrt(5));
r2 = sqrt(r*r-2*r*r0*cos( theta-th0 )+r0*r0);
Updated 08-26-2013 at 06:13 AM by Artur
I've translated Malcolm Kesson's Cellular Automata SL into a Houdini VOP RSL Network (no reason). You can find the original SL on his website: http://www.fundza.com/rman_shaders/cellular/index.html Main difference is that Houdini VOPs don't support Arrays so I used multiple connections and 8 texture calls instead of a for loop. Let me know if there is some better way of querying neigbours. Original shader cell size and count is dependant on micropolgyons and controlled by shading rate. I've set the shading rate to a very high value and the cell count is controlled by geometric subdivision instead. That meant I couldn't use random function for initialization so I replaced it with cellnoise shadeop. OTL library contains digital assets: cellular - Object type digital assetbake3d - shadeop for pointcloud bakingtexture3D - shadeop for pointcloud readingcellnoise - rendermans cellnoise functioncellular_automata - cellular.sl VOP node version. Just a direct implementation of the code. Not used for anything. Cellular is Object Type Digital Asset that contains shaders, geometry and ROPs for 'out of the box' test. Download OTL cellular.otlDownload ZIP cellularotl.zip Have fun.
Updated 03-02-2012 at 12:59 AM by Artur