glob3mobile / g3m

The multiplatform advanced visualization framework
http://www.glob3mobile.com/
Other
117 stars 56 forks source link

How to manage permanently changed sublayer correctly (iOS) #133

Open waphumanoid opened 9 years ago

waphumanoid commented 9 years ago

Good day. I use two layers - OSM and a custom procedural layer with transparent background. The procedural layer is changing every 30 sec (I draw and update lots (~200K points) of user location tracks). So is there a way to update second layer without redrawing all layers? Maybe you give me a point where I can dig in? As far as I understand the engine combines layers into one texture, and my guess is that I can somehow force to redraw only currently visible tiles, not all parent tiles. Thank you.

mdelacalle commented 9 years ago

Currently when you have changes in a rasterized layer, all the dataset is redrawed but there is a way to show points avoiding this behaviour. You can use Markers using a Marker Renderer, you can draw, add and delete markers when you want. An example of using this feature is on the demo project.

https://github.com/glob3mobile/g3m/tree/purgatory/iOS/G3MiOSDemo

waphumanoid commented 9 years ago

mmm, I mean drawing tracks as lines not points. Well... ok. I guess I have some options to manage the problem: 3d mesh optimization and/or second 3d mesh planet surface with its own raster layer above the main one (which is pretty hackish).

DiegoGomezDeck commented 9 years ago

Hi @waphumanoid

Unfortunately we don't have just now a good solution to replace raster (or rasterized) layer in a "fast" way.

Background: in the begging of this project, specially on android, we had several issues related to limited GPU memory and we decided to mix the textures on the CPU side and upload a composed one to the GPU.... it works fine for devices with limited GPUs, but at the expense of this "slow" replacement of changing textures.

The solution is to create another the TileTexturizer that use 2 textures, in one of them we can still mix all the non-changing textures on CPU side, on the second one we can make the changes and let a (new) pair of shaders to mix those 2 textures on GPU.

It's not a trivial task, but it can be done.