-
Notifications
You must be signed in to change notification settings - Fork 2
Add 3D view #6
Comments
Hi travellingkiwi, you mentioned having a working demo implementation in Metal? |
Sure… How would you like it? Fork a copy and push the commit? It’s a bit raw at the moment… But does show the stars and your path.
|
Hi. Try [email protected]:travellingkiwi/EDDiscovery-Mac.git regards
|
Hi Hamish, I had a look at it and I must say it looks very promising! I believe this is something that would make a really great addition to EDDiscovery. Are you interested in going on with its development? If so, I can give you commit rights to the base repo... These are my suggestions for improving on what you already built: BTW, it seems to crash if you switch to a different view, then back to the 3D view. I believe these changes could be enough for a first integration into EDDiscovery... About showing station locations, that is also a nice idea, but since the paths are hardcoded to your own home directory I have no way to see it in action... but I think we can discuss this farther on ;-) |
The crash has been fixed in the latest updates to the fork. Currently working on loading the data in the background. Sadly loading the galaxy list from core data seems to require the main thread. Which stops everything for several seconds. |
yes... I'm on a roll with this one. On the station code... Only the background loading is implemented... It was actually just playing with getting the URL loading in the background. The database needs doing to save the info. And the code needs to be changed to pull the station data once a day from EDDB. That needs to be generic, because I'd like to change the EDSM loading to background as well. And the 3D view needs a way to have new data added to it... And I'd prefer the display to show the jump list under the 3D view. So you can see both at once... And a one-two liner at the bottom to show what is happening (download EDSM/EDDB, uploading, idle etc) Oh... And the graphics are a bit basic... It uses points, so when you zoom in the journey stars become square blocks... That needs to have a filled (Or textured) sphere. It would be nice to be able to zoom into a system and have it show an orrery view as well... Might need to start a list of 'issues' for improvements :) The list goes on... |
Hi @travellingkiwi, sorry for having been silent so long. I had a long stream of issues in real life that needed my attention. I see that you have not been sitting idle in the mean while :-) |
Hi @travellingkiwi, I'm trying to give the latest version of your code a test run. Unfortunately, it consistently crashes on me when attempting to load systems. From what I could see, you are accessing MAIN_CONTEXT from a background thread, which is something you cannot do: all access to core data must be done via either performBlock or performBlockAndWait. This includes not only the fetching but also the handling of data (such as accessing their properties). The only exception is MAIN_CONTEXT, which can be accessed directly, but only from the main thread. After wrapping all of the logic contained within loadJumpsAndWaypoints in a performBlockAndWait on WORK_CONTEXT, it all started working. The rendering is impressive! I see that you took into account some of my remarks for navigating the view :-) Leftover issues, in order of priority: I think that fixing points 1 and 2 above would be enough to publish a first official version of EDDiscovery with your code added in! |
Attached you will find the changes I had to make to loadJumpsAndWaypoints in order to prevent it from crashing. |
Note that if you use performBlock instead of performBlockAndWait it will run asynchronously without blocking the main thread, but then apparently the 3D view won't display all systems... |
Correction: it will display them all, but they will be added in progressive batches, with each subsequent batch taking progressively longer to display. |
I also tried not displaying all the stars in the 3D view. Loading times and performance are vastly improved this way, with no noticeable CPU usage. Also, it does not crash when returning to the 3D view. I'm tempted to include this variant for a first integration... |
Yeah. There's a bunch of updates I have in mind... I should raise issues for them all to track. Does the status UITextView scroll for you? It's stopped scrolling on my current version (Not committed yet). Having trouble finding why... It SHOULD scroll to the end. But doesn't. |
From above 1 - it still crashes when changing to another view, then back to the 3D view It shouldn't I fixed that a while ago... Maybe I didn't push that change. I will check when Xcode back up (I started to update to 8 but am in a hotel in Malta so download a bit slow). 2 - it should not consume CPU when not visible (e.g. a different tab is selected) Agreed... That one needs looking at as it SHOULD pause while not visible, but I think the code that I reused from the sample is really meant for non-tabbed displays... So we miss the notification that we're going away and coming back 3 - it still misses the ability to move around the view, as it always stays centered on the same spot True 4 - it is pretty hard to see my own travel line within the mass of stars Even with default? Maybe I really didn't push... I've been trying to track down why the scrolling on the status went away for a while... Which happened around the same time that I changed a lot of the metal code to implement a bit of transparency to the points that represent the stars and amended the colours. Also implemented a fading of the intensity with distance. And split the drawing into separate metal fragment shaders. 5 - cpu usage is really high when the 3D view is visible, even if I'm not moving around Yeah... Two things here |
A 3D view would be nice...
The text was updated successfully, but these errors were encountered: