Comparison of several multi-threaded 3D engine Architectures

Source: Internet
Author: User

First, we need to clarify the purpose of multithreading In the 3D engine:
1. Logical computing on the CPU (such as bone animation particle emission) does not affect rendering speed
2. Poor GPU rendering speed does not affect the logic speed

The first goal is very clear. I will explain the reason for achieving the second goal: many action games use frame-based logic judgment, so when rendering is slow, the Logic cannot jump frames, but it still needs to be strictly executed to ensure the correctness of the game logic. This causes the game to slow down, in fact, I personally think that the game can be played normally if the rendering remains at more than 15 frames.
Running ghost 4 on a poor GPU, Assassin's Creed, and Persian prince 4 is just like a slow camera, and it's totally impossible to play. In fact, there is no problem when the CPU runs full frames. If the logic frame and the rendering frame can be completely separated, the CPU can still correctly execute the game logic even if the rendering frame fails to meet the requirements, this can solve the problem that action games have high GPU requirements.

Let's take a look at the two multi‑thread ogre architectures. The first is middle-level multithread.


As shown in, each entity to be rendered is copied into two copies. The main thread and the rendering thread alternately update and render two copies of the same entity, and synchronize at the end of one frame, this solution has reached the first goal but has not yet reached the second goal. At the same time, the maintenance of the two entities is relatively complex and cannot be optimized for CPU expansion with more cores.
The second method of ogre multithreading is low-level multithread.

, Copy the d3d object in two copies. It is also synchronized and exchanged at the end of the frame, similar to the advantages and disadvantages above. The two multi-threaded ogre solutions are implemented at the engine layer, which is transparent to upper-layer applications. For users, multithreading details are not required. This is very good.

Next, let's look at the multi-threaded 3D engine solution proposed by ID soft on siggraph2008.

The engine structure of the PS3 is used as an example, which is quite different from that of the PC. Among them, SPU is the 8 coprocessor of the cell chip and has powerful parallel capabilities, the ID solution carries out many contents on the SPU, such as bone animation, deformation animation, vertex and index cache compression, and progressive mesh computing, at the same time, the rendering work on the physical computing rsx on PPU is staggered, maximizing the use of the PS3 hardware structure, and the final game product "Rage" will soon be available!

Finally, my solution

The feature is that the logic is completely separated without synchronization. Although we have successfully achieved the two goals proposed at the beginning of the article, the engine users must consider multiple threads and the threads in which various computations should be placed, there is a long way to go before we can interact with each other in two threads.
In combination with the current architecture and several multi-threaded architectures shown above, and to welcome the arrival of dx11, I am going to further improve my solution into the following:

Scene cropping and submission rendering alternate, and synchronization is performed at the end of the rendering frame. Scene cropping of multiple rendering surfaces can be executed in parallel.
There are many images and few texts. For more details, please google. This article is over!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.