iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.09k stars 293 forks source link

Weird black artifacts around the atmosphere with realistic lighting on mobile (Android) from certain angles. #1653

Open Sam-Scolari opened 3 years ago

Sam-Scolari commented 3 years ago

Your Environment

Context

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Simple globe with iTowns</title>
        <style>
            html { height: 100%; }
            body { margin: 0; overflow: hidden; height: 100%; }
            #viewerDiv { margin: auto; height: 100%; width: 100%; padding: 0; }
            canvas { display: block }
        </style>
     </head>
     <body>
        <div id="viewerDiv"></div>
        <script src="./itowns.js"></script>
        <script type="text/javascript">
            var viewerDiv = document.getElementById('viewerDiv');
            var placement = {
                coord: new itowns.Coordinates('EPSG:4326', 2.351323, 48.856712),
                range: 25000000
            };
            var view = new itowns.GlobeView(viewerDiv, placement);

            // var orthoSource = new itowns.WMTSSource({
            //     url: 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/wmts.cgi',
            //     crs: "EPSG:4326",
            //     name: 'MODIS_Terra_CorrectedReflectance_TrueColor',
            //     tileMatrixSet: '250m',
            //     format: 'image%2Fjpeg',
            //     style: '',
            // })

              var orthoSource = new itowns.WMTSSource({
                url: 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/wmts.cgi',
                crs: "EPSG:4326",
                name: 'VIIRS_SNPP_CorrectedReflectance_TrueColor',
                tileMatrixSet: '250m',
                format: 'image%2Fjpeg',
                style: '',
            })

            var orthoLayer = new itowns.ColorLayer('Ortho', {
                source: orthoSource,
            });

            view.addLayer(orthoLayer);

            const atmosphere = view.getLayerById('atmosphere');
            atmosphere.setRealisticOn(true);
        </script>
     </body>
</html>

When viewing the 3d map on android (not sure about iOS) the realistic lighting atmosphere has these weird black artifacts when viewed at certain angles. When I zoom in a bit the black artifacts go away. The artifacting still occurs with or without loaded WMTS tiles. I don't really know how to describe it effectively so use the examples below.

Live example (error only occurs on mobile device) https://astragram.com/

Youtube video example https://www.youtube.com/watch?v=mgq8NSXdVnU&ab_channel=SamScolari

gchoqueux commented 3 years ago

It may have some issues on mobile as we are not yet working on its support. But the support has improved since the mobile browsers support webgl 2.0.

For information, I don't have this artifact on my android mobile with Firefox 88 and chrome 90