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

Strange errors in occlusion rendering

Help
kedmond
2009-05-14
2013-04-25
  • kedmond
    kedmond
    2009-05-14

    Hello,
        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 "occsurf2.sl", 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:  http://kedmond.googlepages.com/zoomedin.png/zoomedin-full.png

        Here's another example: http://kedmond.googlepages.com/zoomedout.png/zoomedout-full.png

    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 "occsurf3.sl" shader.  The same issue persists with "occsurf2.sl" 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

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

    Surface "occsurf3" "samples" 1024

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

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

    WorldEnd
    FrameEnd

     
    • 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 www.renderpixie.com, 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!

      -Kazem

       
    • 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.

        -Kazem