-
Notifications
You must be signed in to change notification settings - Fork 213
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
Map Factory Framework refactor #74
Conversation
… interface. This can be slippy, range, path, line, etc.
Sample “slippy” implementation of tile provider. No destroy, yet.
Tiles are now destroyed as needed. Cleaned up factories and removed code duplication. Changed properties in UnityTile to fields.
…des-mapcontroller-refactor # Conflicts: # sdkproject/Assets/Mapbox/Core/Unity/Map/RangeTileProvider.cs.meta # sdkproject/Assets/Mapbox/Core/Unity/MeshGeneration/MapVisualization.cs.meta # sdkproject/Assets/Mapbox/Examples/SlippyVectorTerrain/Factories/TerrainDemoTerrainFactory.asset # sdkproject/Assets/Mapbox/Unity/MeshGeneration/Factories/DirectionsFactory.cs # sdkproject/Assets/Mapbox/Unity/MeshGeneration/Factories/TerrainFactory.cs # sdkproject/Assets/Mapbox/Unity/MeshGeneration/MapController.cs # sdkproject/Assets/Mapbox/Unity/MeshGeneration/MapVisualization.cs # sdkproject/Assets/Mapbox/Unity/MeshGeneration/MapVisualization.cs.meta
… and different implementations of maps or tile providers
… are immediate. Cancelled state sticks, even after a response is retrieved.
…. Sometimes abort is called right after the progress is 100% complete. This causes no error to propagate.
… NRE when getting responses.
…ssfully completing its generation for that tile. MapVisualization now pools game objects and reuses UnityTile. General memory and performance improvements.
Optimizations and notes.
Fixed event unregistration in map. Fixed missing terrain tiles. Optimized elevation data and no longer holding onto redundant texture.
Fixed bug where mesh factories would not properly render their data. Simplified setting height and raster data. UnityTile state resets properly. Renamed MapVisualization
…iding parenting tiles.
Removed automatic creation of renderer and filter of unity tile fixed bug where material was not actually assisgned to unity tile renderer
Fixed location provider map initialization.
some notes after a brief look at this, would be great if we can talk before/after scrum @david-rhodes.
loving it so far, looks quite good! |
@david-rhodes
posting here for future reference, let's talk about it today |
…des-mapcontroller-refactor # Conflicts: # sdkproject/Assets/Mapbox/Examples/SlippyVectorTerrain/Factories/MeshFactory/TerrainDemoPoiVisualizer.asset # sdkproject/Assets/Mapbox/Unity/MeshGeneration/LayerVisualizers/PoiVisualizer.cs
YES! Let's do it.
This is a good catch. Let's figure out a better way to communicate what happens here.
Horrible, temporary hack. I think each factory should be responsible for its own cleanup? Mesh modifiers and such are the most difficult, though.
What do we need a reference to tile for? The factory pattern typically does not keep reference to objects it creates, right? In special cases, like terrain stiching for
Yeah, this is more of a |
First, some graphs!
Pre optimization (develop)
Post optimization
You will notice that memory no longer grows forever, and is allocated less frequently. Framerates rarely drop below 30fps, where it would often fall below 15fps (on macbook pro) previously. Mobile performance gains are even higher.
This is a major refactor, but I tried to clean up the code as I went. Hopefully the entire system is more readable and modular, now.
Notes:
Guides, tutorials, and documentation all need to be updated accordingly!