I have roughly seen 2 different ways rendering engines are commonly handled (there could be more). And was wondering which general design is better for a general purpose engine.

Central Handler Engine

In this kind of engine, a global structure (commonly called engine or renderer) manages the synchronization with the rendering thread. It is responsible to initialize contexts, orchestrate draw queues, manage resources and so on.

A typical draw call would be:

  • Object A calls a function in the handler.
  • Handler adds object A to a queue
  • Once object A reaches the front of the Queue, any buffers that may be needed are loaded and its information is rendered

Distributed Rendering Engine

In this design, rather than having a single handler, each object is responsible for ensuring that its values are loaded into the correct buffers and that all bindings are executed correctly prior to a render call.

A typical render call would be:

  • The render thread calls a function in object A that thread safely loads all of its information into the context.
  • The render thread calls a draw function in object A that handles the rendering

The second is used far less often than the first, however the first tends to have less delegated methods which reduces call overhead.

Which is better?

  • 3
    Nobody can answer the question "which is better" for you. You need to supply the meaning of "better". Even then, this question seems like to attract primarily opinion-based answers. – user1118321 Sep 13 at 0:36

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.