Permalink
Commits on Dec 8, 2016
  1. Fix normal calculation in Triangle::Sample().

    We used to interpolate a shading normal and return that, which doesn't seem
    like the right thing to do. As in intersect, we do use the shading normal
    to orient the geometric normal, if shading normals are present.
    
    Also made the handling of 'reverse orientation' and 'transform swaps
    handedness' consistent with elsewhere: only flip the normal for these if
    there is no shading normal (and check the transform handedness stuff, which
    wasn't being done before.)
    
    Checked a number of pbrt-v3-scenes: no meaningful difference in san miguel,
    measure one, contemporary bathroom, barcelona pavillion (night), or crown,
    all of which have triangle area lights with per-vertex surface normals.
    bathroom does change, due to the expectation that 'reverse orientation'
    applied even if there were per-vertex normals (now no longer the case). A
    fix for this will be pushed to the scenes distribution.
    committed Dec 8, 2016
  2. Improve consistency of parameter names.

    numlevels -> levels
    nsamples -> samples
    Which better matches parameter naming elsewhere.
    
    Old names are still supported for backwards compatibility.
    committed Dec 7, 2016
Commits on Dec 7, 2016
  1. Fix bug in Sphere::Sample().

    Because the sampling coordinate system is in world space, the surface
    normal computed by SphericalDirection() is itself already in world
    space. However, we were treating it as being in object space, which in turn
    led to errors if the sphere's object-to-world transformation involved
    anything more than translations.
    
    The following scene illustrates the bug: the rotation applied to the sphere
    should have no effect on the final image, since the sphere starts out at
    the origin, but without this bug fix, the image changes substantially if
    it's there.
    
    WorldBegin
    
    AttributeBegin
      Translate 0 2 0
      Rotate 180 1 0 0
      AreaLightSource "diffuse" "color L" [40 40 40]
      Shape "sphere" "float radius" .5
    AttributeEnd
    
    Material "matte"
    Shape "trianglemesh" "point P" [-5 -1 0  5 -1 0   0 -1 5]
      "integer indices" [0 1 2]
    
    WorldEnd
    committed Dec 7, 2016
  2. Standardize on "eta" for specifying IOR in materials.

    Some have been using "index" and others "eta". Now all support "eta", which
    is also consistent with the pbrt-v3 file format documentation. "index" is
    still supported for backwards compatibility.
    committed Dec 5, 2016
Commits on Dec 4, 2016
  1. Fix default for KdSubsurfaceMaterial "mfp" parameter.

    committed Dec 4, 2016
Commits on Nov 25, 2016
  1. Improvements to Windows build.

    Add the missing zlibstatic dependency.
    Remove hack from appveyor.yml that explicitly built zlib first.
    May fix issue #89?
    committed Nov 22, 2016
Commits on Nov 17, 2016
  1. account for adjoint BSDF when evaluating Vertex::f()

    wjakob committed with Nov 16, 2016
Commits on Nov 10, 2016
  1. Fix inadvertent race condition in ProgressReporter.

    It’s important to make a copy of the shared_ptr for the Barrier rather
    than pass it by reference to the lambda that launches the thread.
    Otherwise, it was possible that the worker thread could access the
    Barrier while it was in the process of being destroyed.
    committed Nov 9, 2016
  2. Fix bug in SeparableBSSRDF::Sample_Sp().

    In rare cases, it would compute a zero value for the |l| variable,
    which in turn led to pTarget being equal to the intersection point,
    which in turn led to a ray with a (0,0,0) direction vector, which
    in turn led to NaN values being computed in Triangle::Intersect().
    (It’s surprising that it got to Triangle::Intersect() in the first
    place with such a ray.)
    
    Fixes issue #93.
    committed Nov 10, 2016
  3. Use PBRT_L1_CACHE_LINE_SIZE for alignment of MemoryArena

    Also, move PBRT_L1_CACHE_LINE_SIZE #define from pbrt.h to port.h
    Should finish up issue #86.
    committed Nov 6, 2016
  4. Fix crash due to normalize of (0,0,0) vector.

    In Sphere::Sample(), don’t normalize the vector from the reference point
    to the sphere center until after checking for whether the point is
    inside the sphere.
    
    The SpatialLightDistribution was creating Interactions at the origin
    (under a certain set of circumstances) in a scene with a sphere
    centered at the origin, which led to an assertion failure.
    committed Oct 29, 2016
Commits on Oct 26, 2016
  1. Add missing #include

    committed Oct 26, 2016
  2. Fix rare infinite loop bug in SampleFourier().

    In very rare circumstances, the while(true) loop in that function would
    continue forever. What was happening was that we'd get stuck on a
    particular bracketing interval [a,b], wherein loop iterations would
    alternately just so happen to compute phi=a and then phi=b.  In turn, no
    progress would be made and the loop would continue forever.
    
    This is easily fixed by choosing the bisection step when phi exactly equals
    one of the endpoints.
    
    (Though this bug hasn't yet been seen in SampleCatmullRom() or
    InvertCatmullRom(), there is similar logic in those functions, so also
    updated the logic there similarly.)
    committed Oct 26, 2016
  3. Fix rare deadlock in profiling system.

    In rare circumstances, where one thread was in the middle of allocating
    memory when it received the timer signal for the profiling system, and if
    the thread accessed a thread-local variable for the first time in the
    signal handler, it also would try to dynamically allocate memory, which
    could lead to a deadlock in malloc().
    
    Now, things are organized so that the thread-local variable, ProfilerState,
    that is needed in the signal handler, is initialized in all threads before
    the profiling system starts up.
    
    Also cleaned up a bit how worker threads are launched and how they merge
    their per-thread stats to the stats system.
    
    Issue #85.
    committed Oct 26, 2016
Commits on Oct 25, 2016
Commits on Oct 16, 2016
  1. Fix bug in Bounds2i iterators.

    For degenerate bounds, they would end up going on forever (or at least a
    very long time, visiting all sorts of points that weren't inside the
    bounds).
    
    Added unit tests to test both their regular operation as well as degenerate
    cases.
    committed Oct 14, 2016
  2. Improve FourierBSDFTable initialization.

    By setting nChannels to zero at the start and in failure cases, we avoid an
    uninitialized memory read (and potentially, a crash), when the BSDF file
    can't be read.
    committed Oct 6, 2016
  3. Reduce ProgressReporter update frequency after 15m.

    This reduces the size of log files that include progress output for long
    renders.
    committed Oct 6, 2016
  4. Add check before Normalize() call in DiffuseAreaLight.

    We would end up trying to normalize a degenerate vector in rare cases.
    committed Sep 13, 2016
Commits on Sep 9, 2016
  1. Fix bug in Curve::Intersect().

    We actually want to recursively process both sub-curves, even if we find an
    intersection with the first one, since there may be a closer second hit.
    committed Sep 9, 2016
Commits on Sep 7, 2016
  1. Improve compile-time detection of host endianness.

    Should fix issue #86.
    committed Sep 7, 2016
Commits on Aug 21, 2016
  1. Revert "Add "pixelbounds" parameter to integrators (all but MLT)."

    This reverts commit 0ccff50.
    committed Aug 21, 2016
  2. Revert "Fix default "pixelbounds"."

    This reverts commit 316528f.
    committed Aug 21, 2016
  3. Revert "Add "maxsampleluminance" option to Film."

    This reverts commit 52d7d1c.
    committed Aug 21, 2016
  4. Revert "Add rrThreshold parameter to Path and VolPath integrators."

    This reverts commit a636c94.
    committed Aug 21, 2016
  5. Revert "Added twosided option to DiffuseAreaLight"

    This reverts commit 7db588c.
    committed Aug 21, 2016
  6. Revert "BDPT: cache mapping from Light * to index in Scene::lights"

    This reverts commit f5eaf7a.
    committed Aug 21, 2016
  7. Update README.md for multiple branches

    committed Aug 21, 2016
Commits on Aug 17, 2016
  1. Fix profiler segfault fix.

    Actually, using a unique_ptr at all is a bad idea (with multiple
    threads). The issue is that even if we reset the pointer at shutdown time,
    there may be a race where another thread has read its value and is
    modifying its memory while the main thread is freeing it.
    
    Therefore, allocate profileSamples at startup time, but don't worry about
    freeing it. This is just a one-time memory leak (and not growing), so isn't
    really a problem.
    
    Issue #83.
    committed Aug 17, 2016