-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add threaded chunk loaders and renderers #116
Conversation
Note: chunk_updated, chunk_erased, and chunk_generation_finished signal emissions are now deferred for "threadability".
Note: chunk_updated, chunk_erased, and chunk_generation_finished signal emissions are now deferred for "threadability".
There's still some stuttering that happens, but I haven't quite narrowed down the cause. Pretty sure lag spikes are much shorter in length than when I started, though. |
Introduced Error: "_octant_update: Condition "!cell_map.has(E) is true. Continuing." Happens only when "Threaded" is turned on for the Threaded Gridmap Gaea Renderer.
I figured out that the stuttering came from the Tilemap and Gridmap GaeaRenderers. I threaded them too and there is hardly any lag now. You do technically run a greater risk of falling into pits and the like, though there are ways around that I'm pretty sure. The rate at which it renders can be improved by running each render task in parallel (currently it waits for one to complete, then moves on to the next in a queue). |
…rt a capped running task count.
…e heightmap_3d_demo for sanity's sake.
Made is so that the Threaded Gridmap and Tilemap renderers can render chunks in parallel. Next, I need to make them gracefully handle "misses" that I suspect are resulting from trying to un-render chunks that have already been or are being un-rendered. Note that I also made it possible to turn the Actor's gravity off. This was just because I kept falling through the world before the chunks below my feet were rendered. |
…g." error. Renderers were missing some deferred calls for thread safety.
… now removes the cap on render task count.
Fixed the errors I was encountering. It wasn't a logical error ("misses") after all, it was just that there were still a few method calls to the Tilemap and Gridmap that needed to be deferred. The error is gone now and the crashes that they were causes have stopped as well. I also made it so the job count can be uncapped again; in 2D chunks render so blazingly fast you can barely tell it's happening, and in 3D chunks are getting rendered significantly faster now. Tbh this may very well be as ready as it ever will be at this point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ngl this brings tears to my eyes, it's beautiful. 3D is so much smoother now. This could actually push us to the 1.0 release and to upload it to the Godot Asset Library.
This would probably be another PR, but we could also make it so chunk loaders prioritize chunks closer to the actor. |
…hreaded Grid/Tilemap Gaea Renderers.
Implemented some threaded chunk loaders (wrappers for the non-threaded ones). Mostly just intended to get the bulk of the loading process off of the main thread.