The Key Technology to Improve The Efficiency and Quality of Real-Time rendering

Renderwow - 9/21/18 15:17

With the development of the 3D animation industry especially in fields of virtual reality and 3d games, it's all about real-time rendering. A single rendering system cannot calculate the huge amount of data in the rendering process. If you want to render the 3D scene in real time, it is best to use a distributed rendering system. In a typical distributed rendering system, you don't need to think about optimizing the scenario. Therefore, the same scene will render the same effect in different systems. Distributed real-time rendering systems are different. To achieve good real-time rendering, it is necessary to adopt certain techniques for scene optimization, to reduce the computation, improve rendering efficiency and quality.

1、Parallel algorithm sort-first

According to the transformation of the image, the location of the split rendering task is different, parallel rendering systems can be divided into three types: Sort-first is to reassign elements before geometric transformations; The sort-middle algorithm redistributes the geometric elements of screen space between geometric transformation and rasterization; Sort-last redistributes the pixels at the end of rasterization.

Sort-first is a common parallel algorithm, the first image it will output is divided into multiple non-overlapping areas, each region is rendered by its own rendering node, that is to pre-assign each line's rendering task. In this architecture, each render node corresponds to a complete rendering line, there is no need to transfer geometric information in the process of geometric transformation and rasterization, there is no need to merge the depth information at the end.

First of all, in the distribution of the elements, the area covered by the graph element needs to be calculated; this calculation is called "pretransform". Then the assigned graph elements are processed geometrically and rasterized and finally, the rendered sub-images are spliced into final images.

2、Scene optimization

In real-time rendering, optimize and reduce the complexity of the scene to effectively improve the rendering efficiency and the Level of Detail (LOD) Detail Level model chosen.

LOD algorithm mainly depends on the clarity of objects in 3d scenes, and to generate multiple versions with different levels of detail. Therefore, the goal of the hierarchical management of clarity is realized. During real-time rendering, depending on the pilot, select the appropriate LOD mode (you can do it without damaging the details), reduce the complexity of the scene, improve the rendering speed, and speed up the scene display rate.

To reduce the complexity of the scene, firstly, use octree algorithm to analyze and manage the 3d scene. And then for different objects and different needs, select the appropriate LOD model. For example, elimination: That is to find elements in the scene that the observer cannot see anyway and get rid of it to speed up rendering. Another method is to choose according to the distance between the observer and the object in the scene (a coarser level of detail can be used for long distances). The appropriate model can also be chosen according to the motion speed of the object. For things that move faster and for details on the screen that are fuzzy, a coarser level of detail can be used.

3、Real-time ray-tracing

In computer graphics, ray tracing is a classic algorithm. The process of ray-tracing is modeled by imaging principles in the real world, hence the process of coloring each pixel. In light tracing, mainly consider the method of light transmission, stop position, and the color value of light. When light hits the surface of an object, the reflection, refraction, absorption and transmission of light are produced. To handle everything, select the appropriate lighting model. We can use the simple lighting model, the Phong illumination model simplifies the problem. The lighting model can be based on the material of the object, the specular and diffuse reflection values are calculated at the intersection of the scene and object, to determine the shading value.

The traditional ray-tracing scheme can only solve the problems of light generation, collision detection of light, and scene in a serial way. And because of the ray tracing process, you don't have to worry about the interpixel dependency, so you can take advantage of this property. Designing a parallel ray-tracing scheme, the initial parameters include observation direction, perspective, etc, and use these parameters to generate the initial light.

The realization of parallel ray tracing is mainly composed of the following parts:

1) For the problem of light generation, generates relatively independent basic parameters for each ray.

2) For collision detection between light and scene, because in the process of coloring the light, there is no dependency between the pixels, so each ray can be colorized in parallel.

After implementing the above algorithm, details can be re-optimized for different needs, therefore, the efficiency of algorithm execution is improved. Such as: When creating KD-Tree, you can start with uniform division, until the number of triangles reaches the specified number then reuse the optimal surface segmentation method, this scheme can effectively improve the efficiency of KD-Tree creation. we can also classify some original geometric data, KD-Tree and other information in the scene, and stored in different textures. In this scheme, not only can data be packaged and stored to reduce repeated access to the same data resource, you can also leverage the virtual cache provided by the texture, this reduces the latency of data access, improved access efficiency.

Rendering the scene using this ray-tracing scheme, the rendering results are shown below.

Character model rendering results

Character model rendering results

Scene rendering results

Scene rendering results

by analyzing the rendering results, using this real-time ray-tracing algorithm can effectively improve the quality of rendering and make the scene more realistic to achieve better real-time rendering effect.

Using these techniques can effectively reduce the rendering time, speed up the image display rate,and achieve better real-time rendering effect.