水优化
A Global Water is another object that significantly affects the performance. Despite it is optimized so that the GPU is not overloaded, it still may require some additional optimizations. Global Water是另一个会严重影响性能的对象。尽管已对其进行了优化,以确保GPU不会过载,但仍可能需要进行一些其他优化。
Setting Up Water Tessellation设置水镶嵌#
引擎对水表面进行四边形细分。但是,并不是整个水面都是棋盘格化的:只有始终位于相机下方的水的内部才是棋盘格。适当设置的镶嵌可以提高性能。
water_global_base材质提供了允许设置水镶嵌的参数。
要指定应该细分的摄像机下方水网格的大小,请使用Tessellation Distance参数。可以在“材质编辑器”的Parameters选项卡中找到。 增加细分距离会导致降低性能,因此请尝试找到合适的值。
还有Max Tessellation Factor参数,该参数允许指定每个镶嵌细分的最大细分。 的值越高,渲染的多边形的数量越多,因此,更低的的性能也就更高。
Max Tessellation Factor与Tessellation Exponent参数一起使用,该参数指定降低镶嵌因子的速率:即镶嵌从内部水的中心点到外部的衰减速度。 增加此值还可以提高性能。
Optimizing Planar Reflections优化平面反射#
The Global Water object allows you to use planar reflections on the water surface. water_global_base允许您在水表面上使用平面反射。
However, planar reflections of a high resolution may significantly reduce the performance. So, you can try to lower the size of the planar reflection map: in the Planar Reflection section of the Parameters, specify the appropriate value for the Map Size.但是,高分辨率的平面反射可能会大大降低性能。因此,您可以尝试减小平面反射贴图的大小:在“材质编辑器”的States选项卡中,为Map Size参数指定适当的值。
However, remember that reflections of a low resolution rarely provide the expected visual result.但是,请记住,低分辨率的反射很少会提供预期的视觉效果。
You can also use reflection mask to control rendering of the planar reflections into the camera viewport. For example, you can render only certain planar reflections, and the other ones replace with screen space reflections.您还可以使用反射蒙版来控制将平面反射渲染到摄影机视口中。例如,您可以仅渲染某些平面反射,而其他区域则替换为屏幕空间反射。
Screen Space Reflections优化屏幕空间反射#
For the water object, the screen space reflections can be rendered instead of the planar reflections at large distances. It improves the performance, as such reflections don't depend on complexity of the reflected geometry. 对于水对象,可以渲染屏幕空间反射而不是平面反射。它提高了性能,因为这样的反射不依赖于反射几何体的复杂性。
You can enable the SSR effect for the water object in one of the following ways:您可以通过以下方式之一为水对象启用SSR效果:
- In the Menu Bar, choose Rendering -> Water -> SSR.在菜单栏中,选择Rendering -> Water -> SSR。
- In the Menu Bar, choose Windows -> Settings and then go to the Water section. Here you can toggle the SSR Enabled parameter on.在菜单栏中,选择Windows -> Settings,然后转到Water部分。在这里,您可以启用 SSR Enabled 参数。
In the Settings window, you can also specify the additional settings for SSR: set the quality of reflections and enable/disable increased accuracy.在“设置” 窗口中,您还可以指定SSR的其他设置:设置反射的质量并启用/禁用提高的准确性
However, remember that these settings affect the performance as follows:但是,请记住,这些设置会影响性能,如下所示:
- The higher the quality of the reflections, the lower the performance is.反射质量更高,性能更低
- Enabling the increased accuracy reduces the performance. However, some visual artifacts are reduced as well. 启用提高准确性降低性能。但是,也会减少一些视觉伪像。
Rendering Lights on Water在水上渲染灯#
You can disable rendering of all the light sources of the certain type on the water surface to increase the performance.您可以禁用在水面上渲染某种类型的所有光源以提高性能。
- Render Environment Probes toggles on/off rendering of all environment probes on the water surface. Render Environment Probes 打开/关闭水面上所有环境探针的渲染。
- Render Voxel Probes toggles on/off rendering of all voxel probes on the water surface. Render Voxel Probes 打开/关闭水面上所有体素探针的渲染。
- Render Lights toggles on/off rendering of all omni and projected light sources on the water surface. Render Lights 打开/关闭水面上所有全向和投影光源的渲染。
Field Objects优化现场对象#
If interaction of water with FieldHeight and/or FieldShoreline objects is enabled in the Global Water parameters, you can affect the performance by setting up the resolution of the Field Height and Field Shoreline textures in the Settings window: the higher the resolution, the lower the performance is.如果在 全局水材料 中启用了水与FieldHeight和/或FieldShoreline对象的交互,则可以通过设置 resolution Field Height and Field Height和Settings window: the 较高分辨率,较低性能。
Another fields-related setting is Field Precision 32 bits. It allows reducing the precision of textures used for field objects, therefore, increasing the performance.另一个与字段相关的设置是Field Precision 32 bits。它会降低用于野外对象的纹理的精度,从而提高性能。
Setting Up Shoreline Rendering设置海岸线渲染#
The shoreline areas created with the Field Shoreline object may reduce the water performance if set up improperly. The Global Water provides several shoreline-related parameters that can help to gain the performance.如果设置不正确,用FieldShoreline对象创建的海岸线区域可能会降低水的性能。 water_global_base材料提供了几个与海岸线相关的状态,可以帮助获得性能。
The Normal and Geometry options affect rendering of wave geometry of shoreline waves. Disable them, when the waves are hardly noticeable (e.g., if the shoreline is observed from above only). In some cases, using only the Geometry option is enough to simulate distortion of the water surface. Normal和Geometry状态会影响海岸线波浪的几何形状渲染。当海浪几乎不可见时(例如,仅从上方观察海岸线时),请禁用它们。在某些情况下,仅使用Geometry状态足以模拟水面的变形。
If both options are disabled, disable also the High Precision option that allows improving interpolation between the adjacent pixels of the shoreline texture. This option reduces stepping artifacts that are noticeable at the waterline separating overwater and underwater. However, if rendering of the wave geometry is disabled for the shoreline waves, there is no need in such additional calculations.如果两个状态都被禁用,则也禁用High Precision状态,该状态可以改善海岸线纹理的相邻像素之间的插值。这种状态减少了在分离水上和水下的水线处明显的踩踏伪影。但是,如果对海岸线波浪禁用了波浪几何图形渲染,则无需进行此类额外计算。
As it was noticed above, rendering of the waves geometry is usually disabled when the water surface is observed from above. Therefore, you can disable the Caustics Distortion option that smooths caustics. It will gain the performance without visual losses.如上所述,当从上方观察水面时,通常无法渲染波浪的几何形状。因此,您可以禁用平滑焦散的Caustic Distortion状态。它将获得无视觉损失的性能。
Another option that also affects the performance is Foam. It enables foam rendering for shoreline zones. If the foam simulation isn't necessary, disable the option to increase the performance.另一个也会影响性能的状态是Foam。它可以为海岸线区域提供泡沫。如果不需要泡沫模拟,请禁用该状态以提高性能。
Thus, you can simulate shoreline areas, viewed from a plane, by just enabling the foam effect while disabling geometry, caustics and improved interpolation as they are hardly noticeable with a significant increase of performance.因此,您可以通过启用泡沫效果同时禁用几何,焦散和改进的插值功能来模拟从平面观察的海岸线区域,因为它们几乎不会引起明显的性能提升。
As you can see, there is almost no visual difference between shorelines on the pictures above.如您所见,上图的海岸线之间几乎没有视觉差异。
其他水优化#
设置水材料状态#
The Global Water provides several parameters that can also affect the water performance: water_global_base材料提供了几种也会影响水性能的状态:
- Steepness Scale affects the sharpness of the wave crests. The waves look more realistic, however, you can disable this effect if the water is observed from the large distance. Choppy Waves产生具有尖峰的波浪。波浪看起来更逼真,但是,如果从远处观察到水,则可以禁用此状态。
- Underwater DOF provides the DOF effect for underwater and overwater splice. It can also be disabled, if the camera never gets under the water. Underwater DOF为水下和水下拼接提供自由度效果。如果相机永远不会掉入水下,也可以将其禁用。
- Caustics enables rendering of light rays refracted by the water surface. It can be disabled, if the effect isn't required. Caustics可以渲染水面折射的光线。如果不需要效果,可以将其禁用。
- Caustics Distortion smooths caustics. It is available only when the Caustics is enabled for the water. If smoothing isn't required, the option can be disabled to gain the performance. Caustics Distortion消除焦散。仅在为水启用Caustics时可用。如果不需要平滑,则可以禁用该状态以获得性能。
状态在“材质编辑器”的States选项卡中可用。
调整水渲染设置#
There is also a set of water rendering settings that may also reduce the performance. They can be found in the Water section of the Settings window.还有一组水渲染设置,这些设置也可能会降低性能。可以在Settings窗口的Water部分中找到它们。
Anisotropy Quality各向异性质量#
The Anisotropy Quality parameter specifies the anisotropy level (degree of anisotropic filtering) of the water textures. Increasing the quality provides better texture detail over a distance, however, it has a great impact on the performance. So, find the most appropriate value to keep the balance of the visual quality and the performance. Anisotropy Quality参数指定水纹理的各向异性级别(各向异性过滤的程度)。提高质量可以在一定距离上提供更好的纹理细节,但是,这对性能有很大的影响。因此,找到最合适的值以保持视觉质量和性能之间的平衡。
Refraction QualityRefraction Quality#
The Refraction Quality parameter specifies the quality of water refraction: the higher the quality, the lower the performance is. Refraction Quality参数指定水的折射质量:较高质量,较低性能。
Shoreline WetnessShoreline Wetness#
The wetness effect enabled for objects near the shoreline may also affect the performance. Try to disable it, if possible, to improve the performance of water rendering.为海岸线附近的对象启用的潮湿效果也可能会影响性能。如果可能的话,请尝试禁用它以提高水渲染的性能。
Underwater ShaftsUnderwater Shafts#
Rendering of the underwater shafts can be disabled if the camera never gets under the water.如果照相机永远不会在水下,则可以禁用水下竖井的渲染。