This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
Materials
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

水优化

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不会过载,但仍可能需要进行一些其他优化。

注意
It is recommended to use only 1 global water object (ObjectWaterGlobal) in the scene, as it uses the screen space projected grid for the water surface.建议在场景中仅使用 1 个全局水对象 (ObjectWaterGlobal),因为它在水表面使用了屏幕空间投影网格

Setting Up Water Tessellation设置水镶嵌#

The Engine performs quad tessellation of the water surface. However, not the whole water surface is tessellated: only the inner part of the water that is always under the camera is. Tessellation that is set up properly allows you to increase the performance.引擎对水表面进行四边形细分。但是,并不是整个水面都是棋盘格化的:只有始终位于相机下方的水的内部才是棋盘格。适当设置的镶嵌可以提高性能。

The water_global_base material provides the parameters that allow setting up water tessellation. water_global_base材质提供了允许设置水镶嵌的参数。

To specify the size of the water grid under the camera that should be tessellated, use the Tessellation Distance parameter. It can be found in the Parameters tab of the Materials Editor. Increasing the tessellation distance leads to decreasing the performance, so try to find the proper value.要指定应该细分的摄像机下方水网格的大小,请使用Tessellation Distance参数。可以在“材质编辑器”的Parameters选项卡中找到。 增加细分距离会导致降低性能,因此请尝试找到合适的值。

There is also the Max Tessellation Factor parameter that allows specifying maximum subdivision of each tessellation patch. The higher the value, the more the number of rendered polygons, and, therefore, the lower the performance is.还有Max Tessellation Factor参数,该参数允许指定每个镶嵌细分的最大细分。 的值越高,渲染的多边形的数量越多,因此,更低的的性能也就更高。

The Max Tessellation Factor is used together with the Tessellation Exponent parameter that specifies the rate of decrementing the tessellation factor: i.e. how fast the tessellation will fades from the center point of inner water to outer. Increasing this value allows you to improve the performance as well. Max Tessellation FactorTessellation Exponent参数一起使用,该参数指定降低镶嵌因子的速率:即镶嵌从内部水的中心点到外部的衰减速度。 增加此值还可以提高性能。

Optimizing Planar Reflections优化平面反射#

The water_global_base allows you to use planar reflections on the water surface. water_global_base允许您在水表面上使用平面反射

注意
It is recommended to use planar reflections on undisturbed water (0-2 Beaufort).建议在不受干扰的水(0-2 Beaufort)上使用平面反射。

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 States tab of the Materials Editor, specify the appropriate value for the Map Size parameter.但是,高分辨率的平面反射可能会大大降低性能。因此,您可以尝试减小平面反射贴图的大小:在“材质编辑器”的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.您还可以使用反射蒙版来控制将平面反射渲染到摄影机视口中。例如,您可以仅渲染某些平面反射,而其他区域则替换为屏幕空间反射

Optimizing 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的其他设置:设置反射的质量并启用/禁用提高的准确性

Water SSR Settings水的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 the all light sources of the certain type on the water surface to increase the performance.您可以禁用在水面上渲染某种类型的所有光源以提高性能。

注意
To enable/disable rendering of a particular light source on the water, select it in the World Hierarchy, go to the type-specific tab of the Parameters window and check/uncheck the Render Water parameter.要启用/禁用特定光源在水上的渲染,请在“世界层次结构”中选择它,转到Parameters窗口的 type-specific 标签,然后选中/取消选中Render Water参数。
  • 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 打开/关闭水面上所有全向和投影光源的渲染。

Optimizing Field Objects优化现场对象#

If interaction of water with FieldHeight and/or FieldShoreline objects is enabled in the global water material, 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 HeightSettings 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 FieldShoreline object may reduce the water performance if set up improperly. The water_global_base material provides several shoreline-related states that can help to gain the performance.如果设置不正确,用FieldShoreline对象创建的海岸线区域可能会降低水的性能。 water_global_base材料提供了几个与海岸线相关的状态,可以帮助获得性能。

The Normal and Geometry states 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 state is enough to simulate distortion of the water surface. NormalGeometry状态会影响海岸线波浪的几何形状渲染。当海浪几乎不可见时(例如,仅从上方观察海岸线时),请禁用它们。在某些情况下,仅使用Geometry状态足以模拟水面的变形。

If both states are disabled, disable also the High Precision state that allows improving interpolation between the adjacent pixels of the shoreline texture. This state 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 Caustic Distortion state that smooths caustics. It will gain the performance without visual losses.如上所述,当从上方观察水面时,通常无法渲染波浪的几何形状。因此,您可以禁用平滑焦散的Caustic Distortion状态。它将获得无视觉损失的性能。

注意
You can disable the caustic distortion in any other case, if necessary.如有必要,可以在任何其他情况下禁用苛刻的失真。

Another state that also affects the performance is Foam. It enables foam rendering for shoreline zones. If the foam simulation isn't necessary, disable the state 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.如您所见,上图的海岸线之间几乎没有视觉差异。

Other Water Optimizations其他水优化#

Setting Up Water Material States设置水材料状态#

The water_global_base material provides several states that can also affect the water performance: water_global_base材料提供了几种也会影响水性能的状态:

  • Choppy Waves creates waves with sharp crests. The waves look more realistic, however, you can disable this state 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 state can be disabled to gain the performance. Caustics Distortion消除焦散。仅在为水启用Caustics时可用。如果不需要平滑,则可以禁用该状态以获得性能。

The states are available in the States tab of the Materials Editor.状态在“材质编辑器”的States选项卡中可用。

Adjusting Water Rendering Settings调整水渲染设置#

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.如果照相机永远不会在水下,则可以禁用水下竖井的渲染。

最新更新: 2021-04-29
Build: ()