Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imagery flash blue block while drag globe quiclly! #9346

Open
Joyzen opened this issue Jan 27, 2021 · 10 comments
Open

Imagery flash blue block while drag globe quiclly! #9346

Joyzen opened this issue Jan 27, 2021 · 10 comments

Comments

@Joyzen
Copy link

Joyzen commented Jan 27, 2021

example:https://sandcastle.cesium.com/#c=bY09C8IwEIb/ypFJQRKcTYvQVXAQnLKk6anBa1Ly0VJ/vW1dRHvb+97z3PU6QG9xwAAFOBygwmhzy69Lt1HMLLnyLmnrMCi2PSjHdkzGNBKWysEyR9t2PiTIgTaci4RtRzphFHU2T0zcxDiLMyrFtyob24NtipVPYEjHOG1umehiX6hYKcXE/6nkdWPd/dxjID3O2GNfnj4l51yKKa6byXuqdfi5/AY

Browser: goole chrome 87.0.4280.88(64bit)

Operating System:Windows 10 19042.746

1.open sandcastle ,choose imagery as the picture show.
2.zoom camera to detailed level ,just close to the ground and drag globe quickly,in some case few blue block flashed by the side of the screen edges,the
image

this is the picture snaped from my record screen video
image

it appears very often if TileImagery level higher than ImageryLayer's max level.

@Joyzen
Copy link
Author

Joyzen commented Jan 27, 2021

I found this bug appears since the commit of fix handling computeTileVisibility return value (commit id:55b66f90f44d92729c17381ce90623dbd24bbea9).
image
I thinke Maybe it's becasue of some problem with computeTileVisibility function mistake a visible tile with invisible.

@Joyzen
Copy link
Author

Joyzen commented Jan 27, 2021

here is the record gif
Cesium影像刷新蓝屏闪烁bug

@dzungpng
Copy link
Contributor

dzungpng commented Apr 9, 2021

Confirmed that this is happening after the change discussed here: #9033. @kring Since you reviewed the original pr, do you know what is causing the issue/if it's an expected behavior?

@kring
Copy link
Member

kring commented Apr 12, 2021

CesiumJS has special handling for the "base layer". All base layer tiles are required to be loaded before a terrain tile can be displayed. But for non-base layers, this requirement doesn't exist. We'll show a terrain tile with e.g. Bing but without some data layer on top of it, and then draw the data layer later. So my guess is that the flashing blue is caused by the Natural Earth II layer not getting designated correctly as a base layer.

@Joyzen
Copy link
Author

Joyzen commented Apr 13, 2021

CesiumJS has special handling for the "base layer". All base layer tiles are required to be loaded before a terrain tile can be displayed. But for non-base layers, this requirement doesn't exist. We'll show a terrain tile with e.g. Bing but without some data layer on top of it, and then draw the data layer later. So my guess is that the flashing blue is caused by the Natural Earth II layer not getting designated correctly as a base layer.

any layer if it's maxlevel is small can caused this,not only Natural Earth II.

@kring
Copy link
Member

kring commented Apr 13, 2021

It's probably the switching using the base layer picker that is causing it. The small maxlevel probably just makes it easier to reproduce.

All these claims are just educated guesses, though.

@Joyzen
Copy link
Author

Joyzen commented Apr 13, 2021

I debug the processStateMachine function step by step,in some case the processStateMachine should be call twice in one frame,
since that bug fix pr,some situation skiped the second call.When creating tile command,the imagery texture length become zero,
so the blue block appears.If I call the processStateMachine when texture length equals zero,the flashing blue disappeared.
fixed like this
屏幕截图 2021-04-13 105045

@kring
Copy link
Member

kring commented Apr 13, 2021

in some case the processStateMachine should be call twice in one frame

In what cases? I don't think it should ever be necessary for it to be called twice in one frame.

Your fix is effectively doing extra loading when we're already trying to draw, i.e., outside the load process. I can believe it fixes the symptoms by papering over a problem elsewhere, but I don't think it's the correct solution.

@Joyzen
Copy link
Author

Joyzen commented Apr 13, 2021

微信截图_20210413135605
the flashing bule tile should be called processStateMachine twice here,because it's imagery unsample frome parent,and the parent's state is ready to render.so we should call that function once again immediately to set current tile's readyImagery as loadingImagery(parent imagery).
And there is no extra loading as the third argument set true to skip loading,it just will caculate translation and scale.
image

@kring
Copy link
Member

kring commented Apr 13, 2021

Ok, I can see why that second call is necessary in that special case. But in a previous post, you said, "some situation skiped the second call." In what situation is the second call needed, but it's skipped?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants