Home Artists Posts Import Register
Join the new SimpleX Chat Group!

Downloads

Content

Some parts of the engine are pretty dodgy and I've wanted to fix them for a while. But for that to happen I had to enter the dark side of OpenGL: multithreading.

This is a new rendering concept to me, where the game runs on two windows:

  • one that you can see
  • another invisible one that's used for sending data to the GPU

This means the game runs quicker because most data is now transferred to the GPU in the background. This video demonstrates:

  • streaming a voxel model to the GPU on the main window
  • streaming the 3440x1440px UI to the GPU on the invisible background window

Without streaming the UI every frame - which is excessive anyway - it runs at 8500 FPS! I know games don't need to run this quick, but it means you can play at 144 FPS at 10% GPU usage, instead of 50%.

I've also improved the profiler (bottom middle of the screen). Before it would flicker around and update once per second, whereas now it can update smoothly in real time.

Comments

Anonymous

How do you determine if something should be multi-threaded? How does the engine decide?

vercidium

Anything that isn't critical to render the current frame can be multithreaded. For example you'll never notice the UI is a few frames behind, so that can run on a background thread. But when you move your mouse (in an FPS game) you want your view to update instantly, so that has to happen on the main thread.