julia set shader, fine in aqsis, not in pixie

Help
Christophe
2008-09-17
2013-04-25
  • Christophe
    Christophe
    2008-09-17

    hi,

    i'm  a renderman noob, so perhaps there
    is something wrong with my shader or rib, but
    aqsis doesn't seem to mind it. i'm thinking
    it could be a space issue, or maybe a
    uniform/varying issue, but i don't yet
    have enough experience to tell. here's the data:

    Projection "perspective" "fov" [80]
    Format 600 600 1
    Clipping 1 14
    PixelSamples 2 2
    ShadingRate 2
    ShadingInterpolation "constant"
    PixelFilter "sinc" 2 2
    Declare "a" "uniform float"
    Declare "b" "uniform float"
    Declare "max_iter" "uniform float"
    Translate 0 0 2

    FrameBegin 0
        Display "frames/julia_000.tiff" "tiff" "rgb"
        WorldBegin
            LightSource "ambientlight" 0 "intensity" [0.3]
            LightSource "pointlight" 1 "intensity" [20.0] "from" [0.5 4 -2]
            Surface "julia_surface"
            Sphere 1 -1 1 360
        WorldEnd
    FrameEnd

        surface julia_surface(float a = -0.766227, b = 0.096990, max_iter = 100) {

            normal Nf = faceforward (normalize(N),I);
            float x = xcomp(P), y = ycomp(P);
           
            float i, in_set = 1, tempx;
            for(i = 0; i < max_iter; i += 1) {
              tempx = x;
              x = (x * x) - (y * y) + a;
              y = (2 * tempx * y) + b;
              if(((x * x) + (y * y)) >= 4) {
                in_set = 0;
                break;
              }
            }

            Ci = (ambient() + diffuse(Nf)) * Cs;       
           
            if(in_set == 0) {
              Ci *= color(1,1,1);
            } else {
              Ci *= color(0,0,0);
            }
         
        }
       
    thanks,
    _c

     
    • Kevin Egan
      Kevin Egan
      2008-09-17

      I got this to render (sphere with fractally pattern).  Are you getting error messages?

      First I'm not sure if you did this but you have to split the shader portion into it's own file, julia_surface.sl.  Then run "sdrc julia_surface.sl" to compile the shader (giving you a julia_surface.sdr file).  Now you should be able to run "rndr myfile.rib" and it should render.

            Kevin

       
      • Christophe
        Christophe
        2008-09-17

        yep, compiled it separately, am renderman noob, but not comp-sci noob :)

        it renders for me too but looks really bad, with big blocks of color which
        look like they are aligned with the micropolygon grids. in aqsis it looks
        the way it should, clear, sharp and detailed. i get no error messages btw.

         
        • Kevin Egan
          Kevin Egan
          2008-09-17

          Hmm... don't really know.  I would try getting the latest svn version and compiling yourself, maybe running with one thread "-t:1".  Are you on windows or linux?  You could also try using valgrind to see if it pops up any errors.

          This is what i get.
          http://www1.cs.columbia.edu/~ktegan/download/julia_000.png

                 Kevin