Graphical issue on first load, refreshing page it is ok.

Hello,

I had a graphical issue on my website using Cesium : on the scenery first load often (but not always!) some black holes remain in my terrain, as some tiles have not been loaded correctly.

The strange thing is also that refreshing the page (pressing F5)… the scenery is always well loaded.

From that moment every time I reaload the scenery, also closing the browser before, this will be load correctly : only on very first load the problem is present.

It’s obvious that on the first time something have to be loaded from the server and on the second time it is already on the browser cache, in fact deleting the browser cache the issue come back!

I use Chrome browser on Win 7 PC and initialize the Cesium Viewer in this way :

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

** animation : false,**

** timeline : false,**

** homeButton : false,**

** infoBox : false,**

** geocoder : false,**

** baseLayerPicker : false,**

** sceneModePicker : false,**

** selectionIndicator : false,**

** navigationHelpButton : true,**

** navigationInstructionsInitiallyVisible : false,**

** scene3DOnly : true**

** });**

What can I do to force the scenery to be loaded correctly already from the first time?

In attach some pictures as example… and this **LINK **(please say to me if also you can see this problem.)

Thank you very much.

Hi Rik,

I can indeed replicate this. This looks like it might be related to this issue on GitHub (and I bumped the issue with this report). It arises from setting the terrain provider right after creating the viewer. The recommended workaround for this would be to set the terrain provider in the options when you create the viewer.

Thanks,

Gabby

Hello Gabby, thank you for your help.

I tried to make a modification to my code creating before the Terrain Provider and then assigning it in the options of the Viewer, but I see no differences unfortunately.

Here a link to the modified page : LINK

Now I do in this way…

var myTerrainProvider = new Cesium.CesiumTerrainProvider({

** url : ‘//assets.agi.com/stk-terrain/world’,**

** requestWaterMask : false,**

** requestVertexNormals : true**

** });**

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

** terrainProvider : myTerrainProvider,**

** animation : false,**

** timeline : false,**

** homeButton : false,**

** infoBox : false,**

** geocoder : false,**

** baseLayerPicker : false,**

** sceneModePicker : false,**

** selectionIndicator : false,**

** navigationHelpButton : true,**

** navigationInstructionsInitiallyVisible : false,**

** scene3DOnly : true**

** });**

Some other advice?

P.S. never have this issue viewing the page with a mobile device! This let me think that there is no coding error!

Can you try out the branch in this pull request: https://github.com/AnalyticalGraphicsInc/cesium/pull/4969 ?

In at least one case switching to that branch fixed terrain loading issues.

It seems to work! Thank you Sean, very appreciated help!! :smiley:

But… it is unbelievable : just two lines of code to fix such a terrible bug, how is it possible they are still not integrated in Cesium official version? What can be the cons in using this code?

P.S. I tried to make the modification also in the minified Cesium version , but with no success, really I can’t understand the minified Javascript syntax. However, no problem, I can use the unminified one.

Given the size of the changes, does seem surprising that it hasn’t yet been merged in.