UE4 develops VR projects, frame rate optimization practice

1: Prepare the test environment;

 1: Make sure that the maximum frame rate in the engine is not limited, under Project Settings - General Settings - Frame Rate;

2: Equipped with the quality of various parameters;

3: After VR mode, press ~ in the editor to bring up the console, enter r.ScreenPercentage, this is equivalent to the screen resolution, the default is 100, you can enter a higher or lower value to determine a resolution you think A suitable value, say 120.

4: After preparing the test environment, call up the console and enter stat unit to view the time-consuming data of various operations in the current screen

Two: Find out what factors cause high GPU consumption

 Go to the field of view and press Ctral+shift+ to bring up the GPU viewer

Here you can check which blocks are taking up the rendering time (the red box is the total rendering time). The longer the bar, the longer the time. It can be seen from this picture that the most consumed are basepass, lighting and post-processing (of course, there are more than these three, each color represents one).

 1: If the basepass consumption is high, you need to know which models, textures, and materials are too expensive. If the number of faces is too high, reduce the surface; if there are too many objects used for translucency, consider whether it is necessary; the material is a major culprit of excessive GPU consumption. The complexity of the material can be viewed here. The redder it is, the more it is consumed. In principle, some effects such as point animation and surface subdivision are reduced.

In addition, if the models placed in the scene do not need to participate in the collision calculation, it is best to close the collision to reduce the calculation consumption.

The LOD method of traditional games is not necessary in VR games, because many VR games have a very limited range of activities (the design avoids dizziness and does not allow players to move in a large range), there is no need to switch the model state from far to near, and the settings are not If it is reasonable, it is very obvious to see a model switching state back and forth in a VR game, which affects the experience. Since UE4 has a good optimization of the number of faces, it is recommended that if the active area is small, the model should be refined.

  Using the showflag (hidden) command in the console when the game is running can help us quickly locate the specific model? Special effects? illumination? And so on which consumes high consumption, optimize the high consumption, list several commonly used showflag commands:
showflag.Translucency
showflag.ambientocclusion
showflag.particles
showflag.staticmeshes
showflag.dynamicshadows
showflag.decal

2: If the light consumption is high, you need to check the number of dynamic lights (Fixed light can also cast dynamic lighting), whether there are too many overlapping illumination areas, and whether the illumination range parameter is too large. Since the lighting information has been stored in the Lightmap after the static lighting is built, it is no longer calculated in the game, so the main consumption of the lighting comes from the dynamic light source. First check all light types in the world outline, and make sure there are several dynamic lights and fixed lights. The red dots in front are dynamic, and the yellow dots are fixed.

Further check whether there are too many overlapping parts of the illumination range of the fixed light. The more overlapping, the brighter and redder the intersection will be. The principle of using lights is that they can be used without dynamic lights (the consumption mainly comes from the Mesh being projected), the lighting ranges should not overlap as much as possible, and there should be no more than 4 fixed lights in the same map.

Turning off the dynamic shadow casting of lights can also reduce some consumption, and even some lights can directly turn off the shadow casting function.

3: Post-processing is another culprit of excessive GPU consumption. It needs to be used with caution. The principle is to turn off some unnecessary parameters as much as possible, especially SSR, post-AO, Bloom, etc. Some parameters will have some values ​​by default, all unnecessary are cleared, and the anti-aliasing mode is switched to FXAA

27412581f15c4e617d.png

PS: Of course there are other factors that need to be optimized, such as fog effects, reflection balls, etc.

Original http://www.element3ds.com/thread-86863-1-1.html?_dsign=0516bca9

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326757295&siteId=291194637