Recent Blogs Posts

  1. So you like fractals?


    Or maybe Broccoli fractal in Renderman?

    Ok, let's not get ahead of ourselves. Simple 2D Mandelbrot shader is a good start for mortals like me

    Code:
    /*
     * MRmand.sl -- Mandelbrot texture
     *
     * DESCRIPTION:
     * Creates a Mandelbrot set as a texture
     *
     * PARAMETERS:
     * Ka, Kd, Ks, roughness - the usual
     *
     * HINTS:
     *
     * AUTHOR: Michael Rivero
     * rivero AT squareusa DOT com 
     *
     * History:
     * Created: 12/18/98
     */
    
    
    surface MRmand (
     float Kd = .5,
           Ka = .1;
     float maxiteration = 500;
     float useUV = 0.0;
    )
    {
     float lt;
     float ls;
    
    /* Map the U and V values to the bounds of the Mandelbrot set. */
    
     if(useUV != 0.0)
     {
      lt = v;
      ls = u;
    /* printf("lt = %f  ls = %f\n",lt,ls); */
     }
     else
     {
      lt = t;
      ls = s;
    /* printf("lt = %f  ls = %f  pre correction   ",lt,ls); */
      ls = mod(ls, 1.0);
      lt = mod(lt, 1.0);
    /* printf("lt = %f  ls = %f post correction \n",lt,ls);  */
     }
    ...

    Updated 12-10-2010 at 12:20 AM by Artur

    Categories
    Technical