Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1887

Bugfixes + Optimization of Gouraud Shading

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 1.8.5, 2.0.0
    • Component/s: Rendering
    • Labels:
    • Environment:
      W7

      Description

      Optimizations:

      • new float[] done only when needed, i.e. when point in a triangle
      • after a triangle is hit, other triangles aren't checked
      • keeping some constants for each triangle object

      Bugfixes:

      • the current code has a possibility that the tinttransform function is called with an array that was transformed before, because the values array is created too early. This resulted in array bounds exceptions for page 20 of ch14.pdf, which in turn resulted in white triangles.
      • polygon.contains() doesn't do the job properly, because it uses integers. The triangle corners must be kept as double to be exact. This bug resulted in black artefacts (points that were not in a triangle but were detected as such). The fix is not to use java functions anymore.
      • checking the combined area doesn't work either and resulted in white artefacts (points that were not detected as part of a triangle).

      It is still very slow. This is "by design", because in that file, the Gouraud mesh is split into so many items instead of being submitted as one.

        Attachments

        1. ch14.pdf-1-better.png
          358 kB
          Tilman Hausherr
        2. ch14.pdf-1-svn.png
          366 kB
          Tilman Hausherr
        3. GouraudShadingContext.patch
          3 kB
          Tilman Hausherr
        4. GouraudTriangle.patch
          3 kB
          Tilman Hausherr

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tilman Tilman Hausherr
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: