Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Which one is right or wrong: Pixie or Aqsis ?

Help
Hibou57
2011-10-31
2013-04-25
  • Hibou57
    Hibou57
    2011-10-31

    Hi all,

    Here is an example where Pixie and Aqsis render far different pictures. I wish I could test with 3Dlight to see what picture it would render, except it cannot run for me (another topic for 3Dlight forum).

    This is a sample sphere with a displacement shader.

    The Shader:

    // File <test_displacement.sl>
    // Simple displacement
    displacement test_displacement() {
       point Ptex = P + noise(P*2);
       P = P + N * 0.05 * float noise(20*Ptex);
       N = calculatenormal(P);  
    }
    

    The RIB Model:

    # File <test.rib>
    ##RenderMan RIB-Structure 1.0
    version 3.03
    Option "searchpath" "shader" [".:&"]
    PixelSamples 3 2
    Format 800 600 -1
    FrameAspectRatio 1.33
    Projection "perspective" "fov" [30]
    Identity
    ShadingRate 1
    FrameBegin 1
       Display "test.tiff" "framebuffer" "rgba"
       LightSource "distantlight" 1
       Translate 0 0 5
       WorldBegin
          AttributeBegin
             Color [1.0 0.6 0.0]
             Surface "plastic" "Ka" [1] "Kd" [0.5] "Ks" 1 "roughness" 0.1
             Displacement "test_displacement"
             Attribute "displacementbound" "float sphere" [0.1] "coordinatesystem" ["shader"]
             Sphere 1 -1 1 360
          AttributeEnd
       WorldEnd
    FrameEnd
    

    The rendered picture from Aqsis, which look OK to me:

    The rendered picture from Pixie, which surprised me:

    OK, the render from Pixie looks strange to me, however, as a beginner with RenderMan, I have no way to assert Pixie is wrong and Aqsis is right.

    In your opinion ? Which one is right and which one is wrong ?

     
  • Natacha
    Natacha
    2011-10-31

    Hello,

    I'm not really a "lawyer" in shading language, but my take on it is that both Aqsis and Pixie are right, in their own different way. As far as I know, the length of N vector is not specified, so the implementation can choose whatever length is most convenient, as long as the direction of the vector is normal to the surface.

    At least, in all displacement shaders I have encountered so far, N is never used directly, but "normalized (N)" is used. Can you check with normalized (N) whether Aqsis and Pixie still differ?

    Hoping this helps,
    Natacha

     
  • Hibou57
    Hibou57
    2011-10-31

    You caught it Netphis :) If I use the following, then Aqsis render the same as before, while Pixie now render the same as Aqsis. Seems Asis already normalize while Pixie don't. That's something to note down somewhere about portability issues. Thanks Netphis, you've learned me something.

    // File <test_displacement.sl>
    // Simple displacement
    displacement test_displacement () {
       point Ptex = P + noise(P*2);
       P = P + normalize (N) * 0.05 * float noise (20*Ptex);
       N = calculatenormal (P);  
    }
    
     
  • Hibou57
    Hibou57
    2011-11-01

    Just tested 3Delight on the same. Without Normalize, it behaves exactly like Pixie, and requires Normalize too. As a side note, so far it seems Pixie and 3Delight are more close to each other than Aqsis is. Aqsis is a bit apart in a number of aspects.