WorldWindJava icon indicating copy to clipboard operation
WorldWindJava copied to clipboard

AbstractSceneController.clearFrame() crashes with Invalid Framebuffer (glError 1286)

Open dwhipps opened this issue 7 years ago • 1 comments

Description

When opening a KML file which includes a gx:LatLonQuad (GXLatLonQuad) or a simple LatLonBox with a non-zero rotation, the call to clearFrame() in BasicSceneController fails with an OpenGL error (1286: Invalid Framebuffer).

Steps to Reproduce

  1. Get or create a KML/KMZ file with a simple surface image.
  2. Ensure the image is added as either a LatLonQuad or add any non-zero rotation.
  3. Run gov.nasa.worldwindx.examples.KMLViewer.
  4. Click File > Open..
  5. Open your KML/KMZ file.

Expected behavior: Expect it to open the file and display the Surface Image correctly.

Actual behavior: Crashes in AbstractSceneController.clearFrame() with OpenGL error 1286 (Invalid Framebuffer.)

Reproduces how often: Every. Single. Time!

Operating System and Version

Windows 10, Java 8 (64-bit.) Does NOT crash on macOS.

Additional Information

I was able to prevent the issue by adding this block of code to KMLSurfaceImageImpl.java around line 91.

Forcing the GXLatLonQuad into an un-rotated Sector and initializing the geometry with that prevents the issue. Also, forcing mustApplyRotation=false prevents the issue with a rotated LatLonBox.

String osName = System.getProperty("os.name");
boolean isWindows =  (osName != null) && osName.toLowerCase().contains("windows");
if ( isWindows ) {
    // Never allow rotation or it crashes.
    this.mustApplyRotation = false;
        		
    // If it's a quad, just add it as a sector (which is by default aligned with the grid)
    GXLatLongQuad latLonQuad = overlay.getLatLonQuad();
    if (latLonQuad != null && latLonQuad.getCoordinates() != null)
    {
         ArrayList<LatLon> tmp = new ArrayList<LatLon>(4);
         for (LatLon ll : latLonQuad.getCoordinates().list)
         {
             tmp.add(ll);
         }

        Sector tmpSector = Sector.boundingSector(tmp);
        this.initializeGeometry(tmpSector);   
    }        		
}

dwhipps avatar Jun 19 '18 15:06 dwhipps

@dwhipps, we have a community edition of WorldWind going. You can log this issue there along with a pull-request if you have one and we'll take a look at it.

wcmatthysen avatar Jul 13 '19 17:07 wcmatthysen