Skip to content
  • Cory Quammen's avatar
    Change clamping range for texture coordinates · b807a6d6
    Cory Quammen authored
    When InterpolateScalarsBeforeMapping is on, vtkMapper and
    vtkScalarsToColorsPainter would clamp texture coordinates to the range
    [0, 1]. This lead to incorrect results if the range of the scalar
    values associated with points that define a primitive were not
    completely contained within the range of the color lookup table used
    to color that primitive, e.g., a quad with scalar range [0,3] colored
    by a color map with range [1,2], and the option
    InterpolateScalarsBeforeMapping is on. In this case, the texture
    coordinates should be in the range [-1, 2], not clamped to [0, 1].
    
    Unfortunately, removing the clamping completely leads to another
    problem. It turns out that some implementations of OpenGL do not
    handle arbitrary texture coordinates of about 1000 or higher
    correctly. To handle this, clamping has been retained, but to the
    range [-1000, 1000]. Hopefully this covers most use cases.
    
    Change-Id: I597c4c1b5f18af645fd6f54e90103321b20b8fb9
    b807a6d6