4 ms·
I'm having a hard time believing that re-drawing a UI 60 times per second would actually consume 100% of a CPU core. unless implemented in a way that causes spe
by nice_byte 10y ago
I'm having a hard time believing that re-drawing a UI 60 times per second would actually consume 100% of a CPU core. unless implemented in a way that causes spending too much time in the opengl driver (lots of pipeline state changes? extraneous drawcalls?) and making your program CPU bound. Seeing some code would be nice.
Also, you don't have to actually redraw the entire screen. You can use the stencil buffer to render only the parts that need to be updated (i.e. the UI pane).
Also, look into signed distance field technique for text rendering. Valve has a paper on it, look it up. My friend used it in his game, the text is scalable and looks great.
- CyberDildonics 10y agoI've used nanovg and I'm not sure what the author is talking about. The text looks great and I've never seen it use a noticeable amount of CPU. Maybe he was doing UIs that were much more complicated, but the drawing is still being done by openGL, only the vector to triangle conversion is being done on the CPU as far as I know.