-
Notifications
You must be signed in to change notification settings - Fork 329
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
Performance: No rendering if invisible & lazy sync #19
Comments
Monday decission: let's go for simple ol.View detaching and Cesium rendering stop. |
The problem with this approach is, that after calling |
I think there is no need to change anything in ol3 for this. The following should work: var view = map.getView();
map.setView(); // pause synchronization
map.setView(view); // resume synchronization |
@ahocevar I tried using |
Good point @petrsloup. So we need to figure something out on the ol3 side. |
In |
Controls update their UIs at postrender time. So if the ol.Map#render function returns immediately the controls won't be updated. |
@elemoine As far as I can tell, |
OL3 side is not ready for this yet... |
@elemoine, any other ideas for fixing this? |
Lets try to make all the layers invisible on OL3 - and ignore this operation in the synchronizer temporarily on OL3Cesium side (keep list of visible layers separatelly). |
Is it possible that there is also a performance penalty of Cesium trying to render the globe while we are viewing the map? Just got this from our client:
|
The About the second note (constant rerendering): if we want to automatically "pause" the Cesium rendering, we need to know when the rendering is required (any user interaction, inertial animations, layers changed, tiles loaded, application-specific modifications to the Cesium.Scene (non-synchronized layers, objects...)), but it would be very hard (or impossible) to detect all the possible changes. |
Merged is an OL3 implementation which is using the hiding of the root LayerGroup for gaining the performance on OL3 side - this should be acceptable solution for now. For a more proper solution on OL3 side there may be a new ticket probably. A comment from @ahocevar in #66: |
Reopening based on feedback from our client:
|
This sounds like a problem related to the "Performance of feature synchronizer" - it is probably not as much related to this ticket (which has already 4 pull requests merged). Better to create a new ticket for this @ahocevar? |
In fact it seems to me directly related to already open ticket #70. |
In this moment ol.View and Cesium camera are constantly synchronized (as if both are visible) and both libraries render the map with all layers, features, etc. This happens also in the moment where one of 2D or 3D is not visible on screen or when in a "stacked mode" (3D overlaying 2D in the same DOM container element).
Performance may be improved if we disable rendering or stop synchronization of the carmera/view between the two projects whenever possible. But this may bring some implications on how the wrapper may or may not be used by programmers.
A simple solution not breaking anything may be just stop unwanted rendering, but keep view+camera constantly synchronized.
It means:
this.scene_.render();
if Cesium is not enabledAn advanced implementation could be even more clever. We could detect stacked mode and delay or completly stop synchronization on view, and enforce it only if required from the wrapper code via a helper function
updateView()
: definitelly when switching back to 2D, but possibly also before feature picking or elsewhere in the wrapper code, if required.This may bring possible issues for implementation of interaction with ol3 sources, layers, feature picking, etc.
To be discussed here in comments - and on the Monday meeting.
The text was updated successfully, but these errors were encountered: