This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
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
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

从Unity迁移到UNIGINE:内容创建

Meshes网格#

As well as in Unity software, mesh is the main graphics primitive in UNIGINE.Unity软件一样,网格是UNIGINE中的主要图形基元。导入到项目中后,FBX资产将显示为存储在Asset Browser中的所有网格的容器。

In Unity Editor, you access the content of an FBX asset using the arrow button next to it:Unity Editor中,您可以使用旁边的箭头按钮访问FBX资产的内容:

Meshes within an FBX asset in Unity EditorUnity Editor中的FBX资产内划分网格

Both meshes and read-only materials appear as components of the asset.网格和只读材料均显示为资产的组件。

In UNIGINE, you can do the same by double-clicking the asset (or choose Open in the right-click menu):在UNIGINE中,您可以通过右键单击资产并选择Open来执行相同的操作:

Meshes within an FBX asset in UNIGINE在UNIGINE的FBX资产内划分网格

Every separate object in the FBX model is represented by a .mesh runtime asset. Materials (if there are any, provided the Import Materials option was enabled) are generated in the materials folder next to the asset.FBX模型中的每个单独对象都由.mesh运行时资产表示。材料(如果有的话,只要启用了Import Materials选项)就会在资产旁边的materials文件夹中生成。

To create a node that uses the mesh or FBX asset you can simply drag it to the Editor viewport the same way you would do in Unity Editor. In UNIGINE this will add a Mesh Static object to the world hierarchy.创建一个节点使用网格或FBX资产的用户,只需将其拖动到“编辑器”视口中,就像在Unity Editor中一样。在UNIGINE中,这会将Mesh Static对象添加到世界层次结构。

Object nodes play the part of the Mesh Filter and Mesh Renderer components. For example, it is best to use a Static Mesh object for objects that are not intended to change their geometry.目的节点扮演Mesh FilterMesh Renderer组件的一部分。例如,对于不打算更改其几何形状的对象,最好使用Static Mesh对象。

Here Surfaces come into play. A surface encapsulates a sub-mesh having a certain material assigned (in third-party 3D editors) and has the name according to that material. For convenience, surfaces can be rearranged in a hierarchy and toggled on and off. Optimization settings you would set for the whole mesh in Unity Editor, such as contribution to lighting and probes, are available for each surface separately.这里表面参加进来。曲面封装了具有指定材质(在第三方3D编辑器中)的子网格,并具有根据该材质指定的名称。为了方便起见,表面可以是在层次结构中重新排列并打开和关闭。您可以在Unity Editor中为整个网格设置的优化设置,例如对照明和探针的贡献对于每个表面分别地。

Levels of Detail (LOD)细节等级(LOD)#

In Unity software, you are likely to be used to using the LOD Group component enabling you to operate several detail levels, the active LOD is defined by the threshold based on the ratio of the mesh's screen-space height to the total screen height.Unity软件中,您可能习惯于使用LOD Group组件来操作多个细节级别,活动LOD由基于网格的屏幕空间高度与总屏幕高度之比的阈值定义。

LOD Group

In UNIGINE, levels of detail are configured based on distances — in a more low-level manner to make fine tuning available. Surfaces have visibility settings for this purpose. You can set the minimum and maximum visibility distances from the camera for each surface. For Cross Fading use the Minimum Fade and Maximum Fade values.在UNIGINE中,根据距离配置详细程度-以更底层的方式进行微调。表面有可见性设置以此目的。您可以为每个表面设置距相机的最小和最大可见距离。对于交叉淡入淡出,请使用Minimum FadeMaximum Fade值。

Surface LOD Settings

注意
Note the -inf value in one of the fields. You can use inf (Infinity) and -inf (-Infinity) values for parameters supporting this format to define the lowest and highest possible values respectively.注意其中一个字段中的-inf值。您可以将infInfinity)和-inf-Infinity)值用于支持此格式的参数,以分别定义最低和最高值。

Automatic creation of LODs upon importing a model is described in the FBX Import Guide. And if you need fine control over LODs, you can make use of Combine By Postfixes option and merge prepared separate objects with certain postfixes in their names representing LODs. For more details on configuring LODs refer to the dedicated article.在导入模型时描述了自动创建LOD。 FBX导入指南。有关配置LOD的更多详细信息,请参阅专用文章

Bone-Based Animation基于骨骼的动画#

FBX models containing bone-animated skinned meshes create animation clips when imported in both engines. In UNIGINE, such clips are represented by .anim assets.包含骨骼动画蒙皮网格物体的FBX模型在两个引擎中导入时都会创建动画剪辑。在UNIGINE中,此类剪辑由.anim资产表示。

注意
当前,每个网格仅支持一个动画剪辑。要对多个动画剪辑进行操作,您需要为每个动画创建一个单独的FBX

UNIGINE imports only skeletal animation. Skinned Mesh object is an analog for the Unity Skinned Mesh Renderer component for handling bone animations.Skinned Mesh对象是Unity Skinned Mesh Renderer组件的类似物,用于处理骨骼动画。

Unity software provides a sophisticated animation system (sometimes referred to as 'Mecanim'). It implies using Animator Controller — a state machine that manages animation states and transitions between them.Unity软件提供了复杂的动画系统(有时称为'Mecanim')。它意味着使用Animator Controller —一种状态机,用于管理动画状态和它们之间的过渡。

UNIGINE skinned animation system is focused on operating animation layers: you can configure multiple layers with various animation clips and perform blending between them by using API methods.UNIGINE蒙皮动画系统专注于操作动画层:您可以使用各种动画剪辑配置多层,并使用API方法在它们之间执行混合。

An example of animation using two layers使用两层动画的示例

For more details refer to the following articles:有关更多详细信息,请参阅以下文章:

Blend Shapes混合形状#

The same way the Mesh Skinned object supports morphing. If a mesh has blend shapes (sometimes referred to as morph targets for some 3D editors) assigned in a third-party 3D modelling software, they will be available internally as surface morph targets (provided the Import Morph Targets was enabled for the imported asset).Mesh Skinned对象支持变形的方式相同。如果网格在第三方3D建模软件中分配了blend shapes(对于某些3D编辑器有时称为morph targets),则它们将在内部以表面变形目标(前提是已为导入的资产启用了Import Morph Targets)。

Unity Skinned Mesh Renderer component lists the imported Blendshapes in the parameters:Unity Skinned Mesh Renderer组件在参数中列出了导入的Blendshapes:

In UNIGINE, multiple animation morph targets (i.e. morph layers) are created based on the available surface targets and blended manually using weights via API methods.在UNIGINE中,根据可用的表面目标创建多个动画morph targets(即变形层),并使用权重通过API方法

Follow the related tutorial for more details:请遵循相关教程以获取更多详细信息:

Materials and Shaders材质和明暗器#

Similar to Unity software, UNIGINE primarily works with PBR materials. Additionally, UNIGINE supports legacy Specular workflow, which is available via Standard (Specular setup) in Unity software.Unity软件类似,UNIGINE主要与PBR材料。此外,UNIGINE支持旧版镜面反射工作流程,可通过Unity软件中的Standard (Specular setup)获得。

In Unity software, you are accustomed to create user materials that implement a certain shader, depending on the applicability of this shader to a Renderer component type. As an example, you use materials implementing physically based Standard surface shader (or Lit in URP/HDRP) to be used with Mesh Renderer.Unity软件中,您习惯于创建实现特定着色器的用户资料,具体取决于此着色器对Renderer组件类型的适用性。例如,您使用实现基于物理的Standard表面着色器(或URP / HDRP中的Lit)的材料与Mesh Renderer一起使用。

In UNIGINE, material system is formed by base materials and user materials inherited from them.在UNIGINE中,物料系统由基础材料以及从中继承的用户资料。

Materials in the UNIGINE rendering pipelineUNIGINE渲染管道中的材质

A base material is a set of read-only material properties (basically flags, parameters and textures) referring to fragment, vertex and geometry shaders. Base material can be assigned to nodes (or surfaces) of the type it is bound to. UNIGINE provides a rich out-of-the-box library of base materials and standard shaders that can be used to create almost any appearance for all the types of nodes available in the engine.基础材料是一组只读的材料属性(基本上是标志,参数和纹理),它们涉及片段,顶点和几何着色器。可以将基础材料分配给其绑定类型的节点(或表面)。 UNIGINE提供了丰富的开箱即用的基础材料库以及可用于为引擎中所有可用节点类型创建几乎任何外观的标准着色器。

注意
All materials are listed in the Materials window (menu: Windows -> Materials Hierarchy).所有材料都列在Materials窗口中(菜单:Windows -> Materials Hierarchy)。

The mesh_base is the base PBR material in UNIGINE used for meshes. Right here you can inherit a new material from it and start setting it up.mesh_base是UNIGINE中用于网格物体的基础PBR材料。在这里,您可以从中继承新材料并开始设置它

We create user materials by inheriting them from base materials to override some properties passed to shaders on rendering. When creating a material in the Asset Browser, we choose the base material to inherit from, thus defining the type of objects the new material will support.我们创造用户资料通过从基础材料继承它们,以覆盖渲染时传递给着色器的某些属性。在Asset Browser中创建材质时,我们选择要继承的基础材质,从而定义了新材质将支持的对象类型。

Furthermore, user materials can form a hierarchy for convenience. So, when parameters of the parent material are changed, overridden parameters of its children remain the same.此外,用户资料可以形成等级制度为了方便。因此,更改父材质的参数时,其子材质的覆盖参数保持不变。

See also:也可以看看:

Lighting and Environment照明与环境#

The same way as in Unity software, lighting in UNIGINE can be considered as either realtime or precomputed. A set of objects and tools enables you to get benefit from the both approaches.Unity软件相同,UNIGINE中的照明可以视为实时照明或预先计算的照明。一组对象和工具使您可以从两种方法中受益。

Light Sources光源#

In Unity software, light sources are represented by the Light component. UNIGINE provides several types of light sources similar to the ones of Unity software.Unity软件中,光源由Light组件表示。 UNIGINE提供了几种类型的光源类似于Unity软件。

Light Source Unity software UNIGINE

A light source located at a point and sending light out in all directions equally位于一个点上的光源,可以均匀地向所有方向发射光

Point Light

Light Omni

A light source type providing a cone-shaped region of illumination提供锥形照明区域的光源类型

Spot Light

Light Projected

A type simulating an infinitely distant light source and casting parallel beams onto the scene 一种模拟无限远的光源并将平行光束投射到场景上的类型

Directional Light

Light World

An area light that illuminates objects in different directions at once 区域照明一次照亮不同方向上的物体

Area Light: Rectangle and Disc shapeArea Light:矩形和圆盘形状

You can create a custom base material with complex effects for meshes and decals via the visual Material Editor. Unlike in Unity Shader Graph, it outputs a material; there is no master stack with Vertex and Fragment contexts here, the main node is Material that takes parameters for all shaders.Shape Type: Sphere, Capsule and Rectangle形状类型:球体,胶囊和矩形

Emissive objects emitting light across their surface area 发光物体在其表面积上发光

Emissive materials发光材料

Emission排放

Global flat filling lighting 全球平面照明

Ambient light环境光

Environment Ambient Lighting, Environment Probe环境环境照明Environment Probe

Shadows暗影#

In Unity software, light sources can be in Realtime, Mixed, and Baked modes and cast realtime shadows by default. When it comes to light baking (including shadows), Unity workflow implies using Lightmaps. The way of considering GameObject contribution to light baking is defined by its Static flag and a bunch of other parameters.Unity软件中,光源可以处于Realtime, MixedBaked模式,并且默认情况下会投射实时阴影。对于轻度烘焙(包括阴影),Unity工作流程意味着使用光照贴图。考虑GameObject对光烘烤的贡献的方式由其Static标志和其他一些参数定义。

Considering the concept of realtime and precomputed shadows, UNIGINE provides both types of shadows from light sources.考虑到实时阴影和预先计算的阴影的概念,UNIGINE提供了两种类型的光源阴影。

Shadows are cast using a commonly used technique called Shadow Mapping. All light sources can be either in Dynamic or Static mode according to which it is decided if shadow maps are computed in real time or saved in an asset, thus significantly reducing the number of polygons rendered each frame. Apparently, moving lights should be Dynamic, we can't precompute shadows cast from a moving light source.使用称为Shadow Mapping的常用技术投射阴影。所有光源都可以位于动态或静态确定阴影图是实时计算还是保存在资产中的模式,从而显着减少了每帧渲染的多边形数量。显然,移动光源应该是Dynamic ,我们无法预先计算从移动光源投射的阴影。

The Mixed or Static Shadow Casting Mode of a light source filters the surfaces that cast shadows from it. By using the Mixed mode you can combine baked shadows from static geometry and realtime shadows cast by certain dynamic meshes. Use the Shadow Mode to decide whether the surface is static or dynamic.混合或静态阴影投射模式光源过滤器过滤从其投射阴影的表面。通过使用“混合”模式,您可以将静态几何图形中的烘焙阴影与某些动态网格物体所投射的实时阴影进行组合。使用Shadow Mode来确定曲面是静态的还是动态的。

The Shadow Mode parameter is set per surface

To learn more about configuring different types of shadows, watch the dedicated video tutorial:要了解有关配置不同类型阴影的更多信息,请观看专用视频教程:

World light source, as well as Unity Directional light source, uses an advanced shadow mapping technique called Parallel-Split Shadow Mapping to handle shadows at large distances. The shadow settings are available per each light source.世界光源以及Unity定向光源都使用一种称为Parallel-Split Shadow Mapping的高级阴影映射技术来处理远距离的阴影。这阴影设置每个光源可用。

Lights Cookies灯饼干#

For texture modulated lights, Unity software has a special type of textures: Cookie. High Definition RP also provides support for IES Light Profiles for more realistic light sources.对于纹理调制的灯光,Unity软件具有特殊的纹理类型:Cookie

In UNIGINE, you can use an arbitrary flat diffuse or albedo texture, as well as an IES-profile, in the Texture parameter of Light Projected. The same way you can apply texture modulation to Light Omni by using a cubemap texture.在UNIGINE中,可以在Light ProjectedTexture参数中使用任意的平面漫反射或反照率纹理。通过使用立方体贴图纹理,可以将纹理调制应用于Light Omni的方法相同。

Modulation by texture通过纹理调制
Modulation by cubemapIES Profile通过立方体贴图进行调制

Environment环境#

In Unity Editor, scene environment settings are placed in the Lighting window (menu: Window > Rendering > Lighting Settings). The Environment section contains settings for the skybox, diffuse lighting and environment reflections.Unity Editor中,场景环境设置位于Lighting窗口中(菜单:Window > Rendering > Lighting Settings)。 Environment部分包含天空盒,漫射照明和环境反射的设置。

Unity Environment Settings

In UNIGINE, similar Environment Settings are available in >Render Settings (choose Window -> Settings in the main menu, then in the Settings window go to Runtime -> World -> Render -> Environment).在UNIGINE中,类似的Environment Settings>Render Settings中可用(在主菜单中选择Window -> Settings,然后在“设置”窗口中转到Runtime -> World -> Render -> Environment)。

UNIGINE Environment Settings

UNIGINE provides three environment presets, by configuring which you can create a smooth transition between different weather conditions.通过配置,UNIGINE提供了三个环境预设,您可以在不同的天气条件之间创建平稳的过渡。

UNIGINE Environment Settings

In order to achieve physically correct atmosphere rendering, UNIGINE's environment system simulates Scattering by interpolating certain LUTs (Look-UP Textures). When configuring environment lighting you should consider all the settings combined. For more details visit the dedicated article.为了实现物理上正确的大气渲染,UNIGINE的环境系统进行了模拟散射通过内插某些LUT(查找纹理)。配置环境照明时,应考虑所有设置的组合。有关更多详细信息,请访问专用文章

You can set a cubemap texture as the Environment Texture (a Unity Skybox counterpart) for both sky color and reflections.您可以为天空颜色和反射设置立方体贴图纹理作为环境纹理(对应的Unity Skybox)。

注意
If you need to change reflections locally, for example indoors, use Environment Probe with a unique cubemap.如果需要在本地(例如在室内)更改反射,则将Environment Probe与唯一的立方体贴图一起使用。

Additionally, Unity Editor allows specifying a different environment skybox for the camera by using the Skybox script.此外,Unity Editor允许通过使用Skybox脚本为摄像机指定其他环境天空盒。

In UNIGINE, you can use the Sky object recreating the atmosphere in the scene. It can represent a hemisphere or a full sphere with a cubemap assigned, tiled with clouds texture to produce plausible and inexpensive dynamic clouds.在UNIGINE中,可以使用Sky对象在场景中重新创建气氛。它可以代表已分配了立方体贴图的半球或整个球体,并用云纹理平铺以生成合理且廉价的动态云。

注意
If your project requires simulating lifelike clouds, take a look at the Volumetric Clouds.如果您的项目需要模拟逼真的云,请看一下体积云

Fog多雾路段#

To simulate fog in Unity software, you are accustomed to use the Other Settings section of the Lighting window when using Forward Rendering Path, and the Deferred Fog feature from the Post Processing package when using Deferred Rendering.要在Unity软件中模拟雾,习惯于使用“正向渲染路径”时使用“照明”窗口的Other Settings部分,以及使用“延迟渲染”时使用Post Processing包中的Deferred Fog功能。

For the same purpose in UNIGINE you can use Environment Haze in the Solid mode or, if the difference between haze and fog is crucial for your project, use Volumetric Objects — they are great for simulating light beams and shafts, fog and shaped clouds.为了在UNIGINE中实现相同的目的,可以在Solid模式下使用Environment Haze,或者如果雾度和雾度之间的差异对于您的项目至关重要,则可以使用体积物体-它们非常适合模拟光束和轴,雾和异形云。

Global Illumination全球照明#

Unity software provides a set of advanced systems that model indirect lighting significantly improving the realistic look of the scene. So does UNIGINE. This section lists Unity GI techniques and ways to get the same or similar results in UNIGINE.Unity软件提供了一套高级系统,可对间接照明进行建模,从而显着改善场景的逼真的外观。 UNIGINE也是如此。本节列出了Unity GI技术以及在UNIGINE中获得相同或相似结果的方法。

Lightmaps光照贴图#

Unity software provides path-tracing-based lightmappers enabling to pre-calculate (bake) the brightness of surfaces in a scene and store the result in a light map for later use at run time. It requires non-overlapping UVs with small area and angle errors, and sufficient padding between the charts.Unity软件提供了基于路径跟踪的光照贴图程序,可以预先计算(烘焙)场景中表面的亮度并将结果存储在光照图中,以供以后在运行时使用。它要求非重叠的UV具有较小的面积和角度误差,并且图表之间必须有足够的填充。

In UNIGINE, lightmaps are also supported and baked using the integrated GPU Lightmapper tool. When importing an FBX-vodel, you'll be offered to automatically unwrap either of two UV-channels, one of which will be used for lightmaps.在UNIGINE中,还使用集成的GPU Lightmapper工具支持并烘焙光照贴图。

UNIGINE provides another advanced solution for static GI — Voxel-Based Global Illumination provided by Voxel Probes.UNIGINE为静态GI提供了另一种高级解决方案-由Voxel Probe提供的Voxel全局照明。

Voxel Probe is a box-shaped volume composed of voxels of fixed size, providing both pre-calculated indirect lighting and diffuse (blurred) reflections. One of advantages of this approach — there is no need in UV coordinates, any geometry will contribute to GI with no issues. Also, this technique illuminates dynamic objects as well and greatly fits with static lightmaps.Voxel Probe是由固定大小的体素组成的盒形体积,既提供了预先计算的间接照明,又提供了漫反射(模糊) 。这种方法的优点之一-不需要UV坐标,任何几何形状都不会对GI产生影响。

Light baking is performed using Bake Lighting tool.使用Bake Lighting工具执行轻度烘烤。

As concerns realtime, Unity real-time lightmaps are mainly useful for lights that are animated at run time. For such cases UNIGINE features the SSRTGI (Screen-Space Ray-Traced Global Illumination) technology enhancing overall connectedness of the scene a lot.关于实时,Unity实时光照贴图主要用于在运行时设置动画的光照。在这种情况下,UNIGINE具有SSRTGI (屏幕空间光线跟踪的全局照明)技术,可以大大增强场景的整体连接性。

Light ProbeLight Probe#

In Unity software, information about light passing through the empty space in the scene is handled by Light Probe. The primary use of Light Probe is to provide high quality lighting (including indirect bounced light) on moving objects in the scene.Unity软件中,有关通过场景中空白空间的光线的信息由Light Probe处理。 Light Probe的主要用途是为场景中的移动对象提供高质量的照明(包括间接反射光)。

In UNIGINE, as told earlier, you can achieve the same result by using Voxel Probe. The Bake Internal Volume parameter enables to choose the quality and time required to bake GI for empty voxels (i.e. the voxels that do not cover any geometry).在UNIGINE中,您可以通过使用Voxel Probe获得相同的结果。使用Bake Internal Volume参数可以为空的体素(即不覆盖任何几何体的体素)选择烘焙GI所需的质量和时间。

Reflection ProbeReflection Probe#

An almost complete counterpart for Unity Reflection Probe is Environment Probe. These reflection providers store a cubemap texture to be rendered on reflective surfaces.Unity Reflection Probe的一个几乎完整的副本是Environment Probe。这些反射提供程序存储要在反射表面上渲染的立方体贴图纹理。

Reflective sphere placed inside Environment Probe放置在Environment Probe内的反射球

The Static, Realtime and Custom modes are also available for Environment Probe:静态,实时自定义模式也可用于Environment Probe

Realtime Mode. The cubemap is grabbed each frame providing real time reflections and a massive load on the CPU.实时模式。每帧都将抓取立方体贴图,以提供实时反射并给CPU带来沉重的负担。

Static Mode. Environment Probe uses a pre-baked cubemap obtained using the Bake Lighting tool. This mode suits mostly static environments.静态模式Environment Probe使用通过Bake Lighting工具获得的预烘焙立方体贴图。此模式主要适合静态环境。

Custom Mode. The static mode with a custom cubemap texture assigned.自定义模式。分配了自定义立方体贴图纹理的静态模式。

Box projection is supported as well:箱体投影也受支持:

Projection types shown on a box-shaped room箱形房间中显示的投影类型

Furthermore, spherical Environment Probe can be subject to the Parallax effect controlled by the corresponding parameter. While the 0 value implies projecting the reflection on an infinitesimally far sphere, the value of 1 corresponds to the actual Probe's bounding sphere taking into account the viewer's perspective.此外,球面Environment Probe可能会受到由对应参数。虽然0值意味着将反射投影在一个无限远的球体上,但考虑到观察者的视角,1的值对应于实际Probe的边界球。

Planar ReflectionPlanar Reflection#

Lately Planar Reflection Probes were added as a part of Unity High Definition Render Pipeline (HDRP). This component is responsible for providing dynamic planar reflections and shares many properties with the conventional Reflection Probe.最近添加了Planar Reflection Probes作为Unity高清晰度渲染管线(HDRP)的一部分。该组件负责提供动态平面反射,并与常规Reflection Probe具有许多属性。

In UNIGINE, planar reflections are implemented as Planar Reflection Probe too.在UNIGINE中,平面反射也实现为Planar Reflection Probe

Baked Ambient Occlusion烘烤环境阻塞#

Unity GI system is also equipped with Baked Ambient Occlusion, a part of pre-computed illumination which darkens creases, holes and surfaces that are close to each other. Unity Editor supports baking AO out of the box.Unity GI系统还配备了Baked Ambient Occlusion,这是预先计算的照明的一部分,可使彼此靠近的折痕,孔和表面变暗。 Unity Editor支持开箱即用烘烤AO

UNIGINE has no built-in baking tool for AO, nonetheless, it is possible to apply an additional ambient occlusion texture generated using third-party software in the mesh_base material settings.UNIGINE没有用于AO的内置烘焙工具,但是,可以应用额外的环境光遮挡纹理使用第三方软件在mesh_base材质设置中生成。

Audio and Video音视频#

Audio Sources音源#

In Unity software, Audio Source components play back Audio Clip assets. There must be an Audio Listener component, usually attached to the main camera by default, to make the sounds audible. The Spatial Blend parameter of the Audio Source component allows controlling the blending between 2D and 3D spatial sound.Unity软件中,Audio Source组件将播放Audio Clip资产。必须有一个Audio Listener组件,通常默认情况下将其附加到主摄像头,以使声音可听。 Audio Source组件的Spatial Blend参数允许控制2D和3D空间声音之间的混合。

In UNIGINE, Sound Source node type is responsible for playing back an audio asset. It provides a surround effect the same way as it does Unity software. There is no such entity as the Unity Audio Listener — all sound sources that appear in the world are audible. While many parameters seem rather familiar to you, such settings as Doppler level, Attenuation (Rolloff) function and other, including Audio Mixer channels, are available only globally in the Sound section of the Settings window.在UNIGINE中,Sound Source节点类型负责播放音频资产。它提供与Unity软件相同的环绕效果。没有Unity Audio Listener这样的实体-世界上出现的所有声源都是可听见的。尽管您似乎很熟悉许多参数,但Doppler levelAttenuation(滚动)功能等设置以及包括Audio Mixer通道在内的其他设置仅在Settings窗口的Sound部分中全局可用。

注意
Note that a sound source must use a mono audio file to be spatialized at run time. Stereo audio files are played according to the stereo channels stored.请注意,声源必须使用单声道音频文件在运行时进行空间化。立体声音频文件根据存储的立体声通道播放。

UNIGINE supports HRTF (Head Related Transfer Function) out of the box, so imitation of surround sound for stereo headsets is close to real life.UNIGINE开箱即用地支持HRTF (Head Related Transfer Function),因此,模拟立体声耳机的环绕声接近现实生活。

Another sound source entity in UNIGINE is Ambient Source used to create a non-directional ambient background sound (e.g. background music). It has no position in the world and, therefore, can't be represented as a node. So it is available only via API.UNIGINE中的另一个声源实体是Ambient Source,用于创建非定向的环境背景声音(例如背景音乐)。它在世界上没有位置,因此不能表示为节点。因此,仅可通过API使用。

Reverberation Zones混响区#

Just like Reverb Zone in Unity software, UNIGINE's Sound Reverb nodes represent reverberation zones where ambient sound effect appears provided the player is within the zone. With fine-tuned parameters a reverberation zone correctly reproduces the way the sound is reflected from surfaces, forming three main components:就像Unity软件中的Reverb Zone一样,UNIGINE的Sound Reverb节点表示混响区域,只要播放器在该区域内,环境声音效果就会出现在该区域。通过微调的参数,混响区可以正确再现声音从表面反射的方式,从而形成三个主要成分:

  • Early reflections早期反思
  • Late reverberation后期混响
  • Echo回声

Besides that, a number of parameters can be changed to alter the type of environment being simulated. A number of presets may help you to quickly choose the most suitable type of environment to simulate:除此之外,可以更改许多参数以更改要模拟的环境的类型。许多预设可以帮助您快速选择最合适的环境类型来模拟:

By adjusting the Threshold parameter you can enable smooth sound transition when the listener moves from the outside area into the reverberation zone.通过调整Threshold参数,可以在聆听者从外部区域移至混响区域时实现平稳的声音过渡。

视频播放器

Unity software provides an advanced Video Player component capable of rendering videoclips of various formats to textures and other targets.Unity软件提供了高级的Video Player组件,该组件能够将各种格式的视频剪辑渲染到纹理和其他目标。

In UNIGINE, video playback is supported only in a virtual monitor as a part of GUI system. Currently only *.OGV files are supported.在UNIGINE中,仅在虚拟监视器作为GUI系统的一部分。当前仅支持*.OGV文件。

Built-in Optimization内置优化#

Texture Streaming纹理流#

Unity software provides mipmap-based Texture Streaming. This system reduces the total amount of memory Unity software needs for textures by loading only the mipmaps that are needed to render the current camera position in the scene.Unity软件提供了基于mipmap的纹理流。该系统通过仅加载渲染场景中当前相机位置所需的mipmap,减少了Unity软件对纹理的内存需求。

The Texture Streaming settings are provided in Unity Quality Settings.Unity质量设置中提供了纹理流设置。

In UNIGINE, textures streaming is a part of the advanced Asynchronous Data Streaming system. This system is intended to reduce spikes caused by loading of graphic resources, such as meshes and textures. Only the resources that are required to render the current camera view are loaded; and unloaded as soon as other resources require to be loaded to video memory in order not to exceed the specified memory limits. Uploading is time-sliced so as to avoid spikes when the world is just loaded.在UNIGINE中,纹理流是高级功能的一部分异步数据流系统。该系统旨在减少由于加载诸如网格和纹理之类的图形资源而导致的尖峰。仅加载呈现当前摄影机视图所需的资源;并在需要将其他资源加载到视频内存时立即卸载,以免超出指定的内存限制。上传是按时间分割的,以避免在加载世界时出现峰值。

Settings for fine adjustment are available in the Streaming section of the Settings window:Settings窗口的Streaming部分中提供了用于微调的设置:

Asynchronous Texture Upload异步纹理上传#

Unity Asynchronous Texture Upload technique enables time-sliced upload of texture data to GPU.Unity异步纹理上传技术可将时间分段的纹理数据上传到GPU。

UNIGINE's Asynchronous Data Streaming system uses pre-cached minimized copies of textures — Texture Cache. On world loading the texture cache is loaded first, giving a preliminary content for the scene, whilst full-size textures are being asynchronously loaded.UNIGINE的异步数据流系统使用预先缓存的最小化纹理副本-纹理缓存。在世界上加载时,首先加载纹理缓存,为场景提供初步内容,而异步加载全尺寸纹理。

Occlusion Culling咬合剔除#

In Unity Editor you can bake static GameObject with the Static Occluder flag enabled into View Volumes for Occlusion Culling to define the geometry that will block the GameObjects with the Static Occludee enabled from rendering. This technique extremely reduces the number of polygons rendered.Unity Editor中,可以将启用了Static Occluder标志的静态GameObject烘焙到“遮挡剔除的视图体积”中,以定义将阻止启用了Static Occludee的游戏对象渲染的几何图形。该技术极大地减少了渲染多边形的数量。

Also, it is normal for you, as a Unity user, to define View Volumes using Occlusion Areas and use Occlusion Portals to represent GameObjects that can be both open and closed in terms of blocking the sight, such as doors.另外,作为Unity用户,使用Occlusion Areas定义视图体积并使用Occlusion Portals表示可以阻挡视线的打开和关闭的游戏对象(例如门),对于您来说是正常的。

In UNIGINE, Occlusion Culling technique is represented by two methods:在UNIGINE中,咬合剔除技术由两种方法表示:

  • Occluder. Use box-shaped and mesh-based objects culling geometry occluded by them.Occluder。使用箱形和基于网格的对象剔除它们所遮挡的几何形状。

  • Hardware Occlusion Queries technique allows skipping rendering of objects, the bounding boxes of which are covered by another opaque geometry.硬件遮挡查询这项技术可以跳过对象的渲染,而对象的边界框被另一种不透明的几何形状覆盖。

Draw Call Batching抽奖电话批处理#

Draw call batching in Unity software is a way to reduce the number of draw calls by combining static GameObjects sharing the same material into big meshes. In order to take advantage of static batching, one needs to enable the Batching Static flag of GameObject:Unity软件中的绘制调用批处理是一种通过将共享相同材质的静态GameObjects组合到大网格中来减少绘制调用次数的方法。为了利用静态批处理,需要启用GameObjectBatching Static标志:

As well as Unity software, UNIGINE performs Draw call batching: all opaque surfaces are automatically grouped and rendered in batches according to materials assigned, thus decreasing the number of DIP calls and, therefore, increasing the performance. This is why sometimes it is reasonable to create Texture Atlases, so even objects using different textures could share the same material in order to be subject to batching.Unity软件外,UNIGINE还执行Draw调用批处理:所有不透明的曲面都根据分配的材料自动分组并成批渲染,从而减少了DIP调用的次数,因此提高了性能。这就是为什么有时创建“纹理地图集”是合理的,因此,即使使用不同纹理的对象也可以共享相同的材质,以便进行批处理。

UNIGINE provides additional objects to take full advantage of mesh batching:UNIGINE提供了其他对象以充分利用网格划分的优势:

  • Mesh Clutter is an object used to scatter a large number of identical meshes across the world. It is suitable for simulating vegetation a lot while keeping performance high.Mesh Clutter is an object used to scatter a large number of identical meshes across the world. It is suitable for simulating vegetation a lot while keeping performance high.

    Mesh Clutter is an object used to scatter a large number of identical meshes across the world. It is suitable for simulating vegetation a lot while keeping performance high.

    Mesh Clutter is an object used to scatter a large number of identical meshes across the world. It is suitable for simulating vegetation a lot while keeping performance high.Mesh Clutter是一个对象,用于在世界范围内散布大量相同的网格。它适用于大量模拟植被,同时又保持较高的性能。

  • Mesh Cluster is an object that can contain a great number of identical meshes with the same material, which are managed as one object. Cluster meshes can be scattered either automatically, or each mesh can be positioned, rotated, and scaled manually.Mesh Cluster是一个对象,可以包含大量具有相同材质的相同网格,将它们作为一个对象进行管理。群集网格可以自动分散,也可以手动定位,旋转和缩放每个网格。

Follow the Working with Large Number of Objects article for more details on using these objects.跟着处理大量对象文章以获取有关使用这些对象的更多详细信息。

BillboardsBillboards#

In Unity software, you use Billboard Asset — a collection of pre-rendered images of a more complicated Mesh intended for use with the Billboard Renderer component — to replace the complex 3D mesh with a 2D billboard representation at some distance from the camera, thus reducing the load on GPU.Unity软件中,您使用Billboard Asset(旨在与Billboard Renderer组件一起使用的更复杂的Mesh的预渲染图像的集合)将复杂的3D网格替换为距相机一定距离的2D广告牌表示,从而减轻了负担在GPU上。

The most common way to generate Billboard Asset is to use a third-party software or create Billboard Asset from script.生成Billboard Asset的最常见方法是使用第三方软件或从脚本创建Billboard Asset

UNIGINE provides support for Billboards as well. In UNIGINE, a Billboard is a rectangular flat object that always faces the camera so it is capable of representing some flat effects and objects that are barely seen from far off.UNIGINE也提供对Billboards的支持。在UNIGINE中,Billboard是始终面向相机的矩形平面对象,因此它能够表示一些平面效果和从远处几乎看不到的对象。

You can generate a billboard-based Impostor using the Impostors Creator. This out-of-the-box tool creates a series of snapshots of the object while saving shading fidelity and combines them in a single Billboard object. Now you can use the impostor object as the lowest LOD for the mesh at a distance.你可以生成基于广告牌的Impostor使用Impostors Creator。这个开箱即用的工具创建了对象的一系列快照,同时保存了阴影保真度,并将它们组合在单个Billboard对象中。现在,您可以将冒名顶替对象用作远距离网格的最低LOD。

Impostor albedo texture冒名顶替者反照率纹理
Object and Impostor wireframes对象和Impostor线框

Tags and Layers标签和图层#

In Unity Editor you are accustomed to assign Tags to GameObjects for user-defined classification of them. You also use Layers to define groups of GameObjects to be unapproachable by light sources and cameras, as well as for selective raycasting and collisions.Unity Editor中,您习惯于将标记分配给GameObjects以进行用户定义的分类。您还可以使用“图层”来定义光源和照相机无法接近的GameObject组,以及选择性的光线投射和碰撞。

In UNIGINE, a high level of abstraction is omitted, both these systems are represented by the Bit Masking mechanism. Objects, cameras, materials and other entities have bit masks used by various effects and features to define their scope. Each bit in a bit mask can be named for convenience.在UNIGINE中,省略了高层抽象,这两个系统都由位屏蔽机制。对象,照相机,材料和其他实体具有位掩码,各种效果和功能都使用位掩码来定义其范围。为了方便起见,可以命名位掩码中的每个位。

The masks are compared bitwise using logical conjunction, so if two masks have at least one matching bit enabled, they match and, therefore, the entity is subject to the effect.使用逻辑结合对掩码进行按位比较,因此,如果两个掩码至少启用了一个匹配位,则它们将匹配,因此实体受此影响。

For instance, you can filter out certain objects (e.g. tooltips) for reflections by adjusting the Reflection Viewport Masks:例如,您可以通过调整Reflection Viewport Masks来过滤掉某些对象(例如工具提示)以进行反射:

For more details and usage examples:有关更多详细信息和用法示例:

Optimization Tools优化工具#

All runtime spikes, bottlenecks and performance issues can be tracked using the built-in optimization tools:可以使用内置的优化工具来跟踪所有运行时高峰,瓶颈和性能问题:

  • Performance Profiler, an analog for Unity Profiler tool, displays performance data in a timeline in several modes.

    性能分析器,是Unity Profiler工具,以几种模式在时间轴上显示效果数据。

  • Microprofile, an advanced CPU/GPU profiler with support for per-frame inspection.

    Microprofile,一个高级的CPU / GPU分析器,支持每帧检查。

  • Texture Profiler, a tool helping to check the memory consumption by textures.

    纹理轮廓仪这是一个帮助检查纹理占用内存的工具。

See Also也可以看看#

最新更新: 2022-10-10
Build: ()