Skip to content
  • Jaswant Panchumarti (Kitware)'s avatar
    Fix point picking for vtkOpenGLGlyph3DMapper · 81bf4ad5
    Jaswant Panchumarti (Kitware) authored
    - For point picking, the glyph mapper sets the point size using
    fixed function method. In order to reliably select points with
    reasonable tolerances, VTK always sets a point size of greater than 1 during
    the point selection pass. This is how point picking has
    worked in all the VTK mappers.
    
    - The problem was that the `glPointSize(pointSize)` function is unreliable
    in few OpenGL implementations, particularly Angle's implementation of OpenGL over
    D3D11. This implementation is used in Chrome/Edge on windows. As a
    result, on windows, the function `glPointSize` never did anything and
    pointSize was always 1.0 which lead the point picker to consistently
    fail.
    
    - The solution in this commit sets a variable `gl_PointSize` from the vertex
    shader which is supported by webgl2 and desktop implementations as well.
    
    - For now, the mapper still uses the fixed function `glPointSize` on desktop and only
    sets `gl_PointSize` from the vertex shader when GLES 3.0 is being
    used.
    81bf4ad5