Skip to content
  • Allison Vacanti's avatar
    Fix volume clip bug and add regression test. · 5c6bde06
    Allison Vacanti authored
    When clipping a volume using in-shader clipping planes, it was possible
    for the starting point of the ray cast to lie beyond the data volume.
    The raycast code is written such that the first sample is always taken
    before testing termination criteria, and in these cases we would always
    take a single sample outside of the volume, leading to artifacts.
    
    Fixed this behavior by checking that the starting position calculated
    by AdjustSampleRangeForClipping is indeed inside of the volume bounds and
    aborting the raycast if it is not.
    
    The existing TestGPURayCastClipping test would have caught this, except
    that the vase.vti volume used for testing has all 0's at the boundaries,
    so the rendering was correct even with the edge-clamp repetition outside
    of the volume (the faulty samples always computed RGBA=vec4(0)). I
    replaced the vase.vti of this test with a wavelet with finite boundary
    values that will catch this problem if there's a regression.
    5c6bde06