Introducing Renoir Graphics Library

by Alexandra September. 12, 15 2 Comments

Hi,

my name is Stoyan and I’m one of the co-founders of Coherent Labs and I’m responsible for the software architecture of our products.

I constantly try to push the boundaries of the technology and the products we have in order to empower developers to create richer and better UI in a faster way. The new trends in graphics APIs (Metal, DirectX 12, Vulkan) will undoubtedly be the cornerstone of modern graphics applications. Coherent GT will be part of the graphics software revolution.

Just porting a rendering infrastructure from the “old” API design (DirectX 9-11, OpenGL) is not enough. To get the maximum from the new APIs, a whole new architecture is required in the rendering system. We took this realization to heart and started months ago an important development effort. We are creating a new graphics library that will power the future versions of Coherent GT and other Coherent Labs products. We named it Renoir, after the famous impressionist painter who was renown for his mastery and love for beauty.

 

Renoir Graphics Library

We have set a list of major goals we want to achieve with the new library:

Achieve unrivaled performance

Recently we added a unique feature to Coherent GT – you can move all the main logic (JavaScript & layout) in a worker thread. This makes Coherent GT much more scalable and frees the game’s main thread from any UI workload. After careful analysis we saw that we can further improve performance in two additional graphics-related areas.

Currently the Core library generates high-level commands like “drawImage”, “drawRectangle” etc. to visualize the UI. These commands are recorded and played-back in the render thread, where they are translated to low-level graphics API commands. This is the first area we saw possibilities for improvement – our recording is taking longer than needed. Renoir introduces a new recording model that is much faster than the old one by simplifying the API and using data-oriented design.

The second area is the rendering itself. We have identified common rendering scenarios repeated in the workloads of our users and are optimizing for that. A cornerstone of the new design is to rely more on procedural rendering techniques, better geometry caching and data-oriented approach to the design of the library internals. The new approach allows us to improve the batching and state caching system.

 

Improve scalability

Renoir Graphics Library can offload many computations to worker threads. Image decoding and compression are completely offloaded. The real novelty is the multi-threaded rendering commands generation and data-oriented design. Through them we achieve better CPU data cache coherency, less overall memory usage and the code is simpler and easier to maintain.

 

Natively support the new graphics APIs

The library has been designed to use the features of new console-style graphics libraries – DirectX 12, Metal and Vulkan. This will allow developers to have much more complex UI elements at a fraction of the computational cost. Good support for these APIs is also one of the main reasons we decided to create a new library instead of just porting our old one. The library will still support all other popular APIs (DirectX 9, DirectX 11, OpenGL 3+, OpenGL ES 2+, libGNM).

 

Easier porting

We want to be able to write support for a new API in less than 3 days. Renoir has a thin backend and all shaders have been reworked to be easy for porting. This will help us bring new platforms faster, add new features to Renoir more easily and most importantly: developers using our products will be able to adapt or even create from scratch a backend tailored for their own game engine.

 

Great, but when?

Renoir Graphics Library is currently in heavy development and it’ll debut in Coherent GT later this year. The current performance tests are extremely promising and show substantial improvements in all areas we target. Comparisons with open 2D libraries available (skia, nanovg) show that renoir is substantially faster in our internal stress tests.

 

We will share insights on the work we do, as well as regular updates on our progress, so stay tuned. If you are interested in specific feature or have any question about Renoir, please don’t hesitate to contact us!

Social Shares

Related Articles

2 Comments

Leave Reply

Leave a Comment