Strange errors in occlusion rendering

  • kedmond

    kedmond - 2009-05-14

        I'm using Pixie 2.2.5.  I just compiled it from source in Ubuntu 9.04.  After recompiling the shaders with sdrc, things seem to work great.

        I can render most of the examples and tutorials that are available on the pixie website, but I run into a strange problem when using occlusion.

        If I render a small number of objects in a scene, everything looks acceptable.  It does not look as good as the examples on the web page.  The gradients on flat surfaces are somewhat pixelated, for example.  The real problem arises when I add many objects.  For example, if I render a few hundred beads in a single field of view using the occlusion shader "", things start to get weird.  Most of the beads will have random scratches or dents on their surfaces.  Every time I render, the dents or artifacts will have a unique appearance, but they'll always be there.

        An example of my issues can be found here:

        Here's another example:

    Both images are of the exact same scene, I just zoomed out for the 2nd one.

    I tried changing various parameters.  I increased and decreased sampling, for example.  As you can see, I'm not using that many options.  Just the "" shader.  The same issue persists with "" and any occlusion shader that I've used.  Am I doing something wrong?  Thanks!

    Below is the .RIB file that I used to create these images:

    FrameBegin 1
    Format 1000 600 1
    PixelSamples 4 4 
    ShadingInterpolation "smooth"
    Display "5 beads" "framebuffer" "rgba" # render image to buffer
    Display "+image.tif" "file" "rgba" # render image to buffer
    Projection "perspective" "fov" 30
    //Exposure 1.0 2.2
    Translate -23 5 120
    Rotate -110 1 0 0

    Attribute "visibility" "diffuse" [1] # make objects visible to eye

    Surface "occsurf3" "samples" 1024

    # white plane
    Color 1 1 1
    Polygon "P" [ -50 100 3 -200 -50 3 100 -200 3 100 100 3]

    # sphere 0
    Color 1.00000 0.937495 0.937495
    Translate 2 1 11
    Sphere 2.4 -2.4 2.4 360
    # sphere 1
    Color 1.00000 0.928233 0.928233
    Translate 5 4 8
    Sphere 2.4 -2.4 2.4 360
    # sphere 2
    Color 0.973661 0.973661 1.00000
    Translate 20 25 9
    Sphere 2.4 -2.4 2.4 360
    # sphere 3
    Color 2.489182 2.489182 1.00000
    Translate 30 1 5
    Sphere 2.4 -2.4 2.4 360
    # sphere 4
    Color 0.942573 0.942573 0.942573
    Translate 20 20 5
    Sphere 2.4 -2.4 2.4 360


    • kedmond

      kedmond - 2009-05-15

      In case anyone EVER has this problem in the future, I solved this issue.

      I added the following line:
              Attribute "trace" "bias" 1.0

      In the examples on the, the value is set to 0.005.  Setting it to 1.0 makes the images perfectly accurate.  I have NO idea what "trace" or "bias" actually do, but I'm sure I'll figure it out with some reading.

      Anyways, Pixie's great!


    • Natacha

      Natacha - 2009-05-15

      "trace" is actually the attribute group "bias" belongs to.

      "bias" a distance used to prevent self-shadowing artifacts in ray tracing.

      Basically, when throwing a ray from a point in an object, is sometimes happens due to rounding errors that the object itselfs intersects the ray. The bias prevents this kind of artifacts by considdering there is no intersection with things closer than "bias" away. These artifacts are probably what you saw in your first post.

      Having a bias too large discards reals intersections, which is another kind of artifacts. So the bias has to be fine-tuned on a per-scene, or sometimes on a per-surface (this is an attribute, so it can chagne from one surface to another), basis.

      I hope I have been understandable,
      - Natacha

      • kedmond

        kedmond - 2009-05-20

        Thanks for the help!  Great explanation.  I'm so happy that Pixie's working now.



Log in to post a comment.