laitimes

Using a car as a toy? Unreal Engine: Not impossible

Unreal Engine has announced three production cars with OEMs around the world, namely GMC's Hummer EV, Cadillac Lyric, and Amazon-invested Rivian, which just went public in North America in October. The three cars are equipped with different qualcomm chips. At the same time, there are also major breakthroughs in the domestic Unreal Engine, and in early November, Huaren Express also announced a strategic cooperation with Epic Games, including HMI, visualization, simulation, and online and offline configurators and virtual exhibition halls.

In the future, more OEMs and companies in the industry will choose Unreal Engine to develop vehicles, and there is a more important factor in the analysis from the technical point of view. Unreal Engine is a fully real-time content creation platform, the digital assets generated on the platform are highly reproducible, and it has strong data compatibility for almost all application scenarios in the automotive industry.

Using a car as a toy? Unreal Engine: Not impossible

Epic Games China Technical Account Manager Ji Dawei

Unreal Engine is unique in developing HMIs

At present, compared with high-performance PCs and hosts, the computing power of the chip is a bottleneck for the intelligent cockpit/HMI, and before the project is made, it is necessary to do a performance analysis of the hardware chip of the selected chip. According to the target platform, the system of the car machine to do a reasonable analysis, customizing a reasonable target is a very important first step.

Combine each of the different HMI projects in Unreal Engine and the project requirements to make the relevant functional settings in the Engine Editor. Unreal Engine engine provides a very powerful set of performance analysis tools, when making digital assets, you can analyze and optimize the performance of existing digital assets at an early stage, to ensure that they can be successfully deployed on the target platform.

Unreal Engine has accumulated many years of experience in digital asset production in the field of gaming, as well as Unreal Engine. The target platform for the official HMI demo is Qualcomm's 8155, 2.5K display screen, using the new clear coat and translucent glass effects written by Unreal Engine version 4.25, and finally running on the car in order to stabilize the operation. In terms of performance, the goal is relatively high, and on the basis of maintaining the overall effect, it can run in real time at more than 60 frames.

Using a car as a toy? Unreal Engine: Not impossible

Unreal Engine HMI car model; Image source: Unreal Engine

In the HMI 3D car main page, there is no optimization of the basic model of the exterior decoration, maintaining the original CAD geometry, the approximate number of faces of the external model is about 270,000, which can present better lighting and texture in the dynamic interaction process, ensure the high-profile nature of the product, and in this part of the exterior decoration, because there is no cropping, the reflection effect of the body and glass is very clear and smooth.

Unreal Engine itself also provides performance analysis tools, mainly in two sets. The first set is commonly called The Console Command, which has the advantage of being convenient for designers or artists to use, can be run in the editor, and the most valuable thing is that when the project has been packaged into an Android APK and deployed to the car terminal hardware, it can continue to use this set of commands to do performance analysis. The second set of tools, Real-time rendering of Unreal Engine 3D, relies heavily on GPUs, so the engine itself provides a tool dedicated to doing very detailed GPU performance analysis.

Optimization tools

Gazelle-based projects are divided into four areas:

1. Convert the original CAD model into a polygon car model that can really be used in HMI

In addition to the main car on the welcome page, a car is also equipped with a car in ADAS, and HDR is also used, which can see the complete effect on ADAS. Another is in the battery page, and the optimization of this car is mainly focused on the material.

3D vehicle is actually only a total of half a million faces, if you only consider polygon, do not look at the effect, in fact, the 8155 chip can run to four hundred or even five million polygon, but because of the superposition of some advanced effects can not only look at the number of polygon, in the preservation of the original details of the exterior on the basis of unchanged, only some cuts have been made to the interior.

2. Simplify the material

When the screen is moving, the dynamic effect of the material in the battery page is cool, but if the material is not optimized by default in the editor, the impact on performance is still relatively large. There are two main ways to optimize a project's materials.

One is outside the engine, you can use some professional real-time 3D mapping tools, make a full set of model materials, export them into textures, and then import them into Unreal Engine.

The second method is not to use any imported textures, just save a colorful vertex color as a map in the engine, extract different Masks through different channels of RGB, give the material of the car in the battery page, and select different colors as Mask to key the corresponding parts, and give the corresponding parts different material effects. When the GPU does the operation, the material is still regarded as a whole, which greatly reduces the number of rawcalls.

With regard to overall effectiveness, this project follows such a principle. If there is a lot of local detail in a certain area of the car body, in the case of a large screen ratio, a low-precision model + Normal map will be selected. If some places account for a larger proportion of the screen, and the surface is relatively smooth, the original high-precision model is retained when there is not a lot of detail.

When it comes to materials, use as few stickers as possible, and Unreal Engine can display intruction in the Material Editor to minimize the number of material intructions. Because real-time rendering when doing material compilation, the complexity of the material will seriously affect the efficiency and performance of real-time operation in the future.

Using a car as a toy? Unreal Engine: Not impossible

Unreal Engine HMI development interface; Image source: Unreal Engine

3. Optimize the texture

The impact of textures on memory is very large, and there is a set of scientific algorithms in the engine, and there are several simple rules to follow. Any texture imported into Unreal Engine should have a resolution of 2 multipliers, not odd numbers, and its aspect ratio, if there is no conditional restriction, is preferably square, because the square map maximizes memory usage. Unreal Engine has texture-related compression options when the map is imported, and the Unreal Engine will set some normal maps to DX1 as much as possible.

The engine also provides a set of more scientific calculation methods, in the end how much size map should be used under a specific or fixed lens, the maximum 2K to the minimum 32×32 such as six sets of resolution maps of different sizes packaged into a text pack, in a dynamic material effect to preview, when the camera or distance changes when the engine will automatically match, to select the appropriate resolution of the map to adapt to the current scene, The map is then pasted onto a material as a self-illuminating map, and the current color and corresponding numbers are automatically displayed during the dynamic process. You can also reset the resolution within the properties panel of the map to optimize for specific maps.

For the overall asset, including all polygons except for the texture, Unreal Engine has a tool to directly display all the assets in the scene in a graphical way, the larger the composite means the greater the capacity, it is an interactive program. Generally speaking, a large composite, if double-clicked, will enter the interior of the complex, which will display some other models or maps under the main asset.

4, the solution of the overall lighting

Unreal Engine is a tool for generating renderings or generating lighting dynamically in real time, and can create lighting in a more flexible way, first generating a Capture Cube in the scene, similar to such an object as a camera. In the editor, Capture Cube captures a complete set of lighting in real time and saves it to the render target.

With Capture Cube, you can also save all the lighting of the entire scene, including HDR, in real time. If you are not satisfied with the current lighting effect, you can also make dynamic modifications, and then use the same way to capture the entire scene lighting after modification, and finally the lighting of the entire scene will be saved as a whole custom HDR and stored on the hard disk.

Finally, the HDR is attached to the skylight and the reflective ball to complete the lighting effect of the entire scene.

Using a car as a toy? Unreal Engine: Not impossible

Unreal Engine HMI interface; Image source: Unreal Engine

Unreal Engine project packaging

Packaging will affect two parts, one is the startup time of the entire HMI, the other is the memory footprint, Unreal Engine provides a tool called Size MAP, in the editor to be able to detect which assets are too large and cause hMI resource waste, when Unreal Engine is deployed to Android on the mobile side of the device, Unreal Engine also provides a tool It is a command tool - UnrealPAK .EXE, directly on the windows operating system with the command line to start, it has several functions :

First, use the index command to extract the PAK package, after the extraction will be a lot of files that are not related to the project, manually delete to reduce the size of the package.

Second, the streamlined project files can be repackaged by the "create" command, and the overall PAK capacity will be greatly reduced.

Third, UnrealPAK can also do the compression of the entire package, but the compression has the nature of a double-edged sword, if excessive compression will affect the startup time, it depends on whether the specific project size is compressed.

Fourth, if you have packaged to the mobile terminal, you can view the packaged files and memory occupation information through the command line, by entering memreport-full, you will save a log under the packaging path, which contains maps or models and other information related to memory occupation.

Read on