You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aquaria is inherently a single-threaded game but there are some areas that can be MT'd.
I'd like to use tws instead of fumbling with threads directly. One IO thread, #cores worker threads.
List of ideas, to-be-extended:
Do NOT want to MT OpenGL. No GL function call on any other thread than main!
Texture batch loading. Loading PNGs takes forever. On game start and when a map is loaded, the game loads in a ton of textures. The IO should be done by an IO thread and then PNG decoding passed off to a worker. Requires glpng rework, see Replace 3rd party libs #74.
Optimization, if glMapBuffer() is available: Map a GPU buffer, kick off decoding PNG data into the buffer in a separate thread, when done do glTexImage2D() using that buffer as GL_PIXEL_UNPACK_BUFFER in the main thread. So the GPU can still do the texture prep in the background.
Rendering:
Layer traversal can be MT'd: One job per RenderLayer that accumulates objects to render in a list. One list per layer. Kick off lists in order once all are done. Not sure how much this is worth. Would greatly simplify future OpenGL decoupling if the renderer doesn't need to know about layers and object hierarchies and whatnot.
Minimap? Rendering the minimap seems to be quite expensive. Could prepare a vertex buffer in background.
GridRender? Could also recalc a vertex buffer whenever the map changes or the camera has moved far enough.
Pathfinding:
Simple pathfinding: Make Entity::moveToPos() kick off a background job and start to move a few frames later once the path has been calculated. Avoids lag spikes. Need to handle entity or map deletion while a job is active.
Advanced (not used by vanilla): See PathFinding::beginFindPath(). Can calculate the entire path in background instead of incremental updates per frame.
Schoolfish update: FlockEntity::updateFlockData()
The text was updated successfully, but these errors were encountered:
Aquaria is inherently a single-threaded game but there are some areas that can be MT'd.
I'd like to use tws instead of fumbling with threads directly. One IO thread, #cores worker threads.
List of ideas, to-be-extended:
Do NOT want to MT OpenGL. No GL function call on any other thread than main!
Texture batch loading. Loading PNGs takes forever. On game start and when a map is loaded, the game loads in a ton of textures. The IO should be done by an IO thread and then PNG decoding passed off to a worker. Requires glpng rework, see Replace 3rd party libs #74.
Rendering:
Pathfinding:
Schoolfish update: FlockEntity::updateFlockData()
The text was updated successfully, but these errors were encountered: