2018.4.3地形_2018.3地形更新:入门

2018.4.3地形

We now have a team dedicated to terrain, and our initial efforts will soon be publicly available! Unity 2018.3 will ship with an update to the terrain system. This update features improved tools and performance by taking better advantage of the GPU. It also adds support for the HD and LW render pipelines, while being backward compatible with the built-in render pipeline and the existing Unity Terrain system.

现在,我们拥有一支致力于地形的团队,我们的初步努力将很快公开发布! Unity 2018.3将随附地形系统的更新。 此更新通过更好地利用GPU来改善工具和性能。 它还增加了对HDLW 渲染管道的支持 ,同时与内置渲染管道和现有的Unity Terrain系统向后兼容。

Get the Unity 2018.3 beta now to get early access to the updates! Please be aware that the user interface and the API are both still subject to change as the beta is still under active development.

立即获取Unity 2018.3 Beta,以尽早获得更新! 请注意,由于Beta仍在积极开发中,因此用户界面和API仍会发生变化。

性能 (Performance)

When enabled, Unity transforms all of the heavy terrain data, like height maps and splat maps, into textures on the GPU. Instead of constructing a custom mesh for each terrain patch on the CPU, we can use GPU instancing to replicate a single mesh and sample the height map texture to produce the correct geometry. This reduces the terrain CPU workload by orders of magnitude, as a few instanced draw calls replace potentially thousands of custom mesh draws.

启用后,Unity会将所有重地形数据(例如高度图和splat图)转换为GPU上的纹理。 我们可以使用GPU实例化来复制单个网格并采样高度图纹理以生成正确的几何图形,而不是为CPU上的每个地形补丁构建自定义网格。 这将地形CPU的工作量减少了几个数量级,因为一些实例化的绘制调用可能会替换成千上万个自定义网格绘制。

As a nice side effect, it also improves our load times! Not only can we skip building all of those custom meshes, but we can also use the GPU to build the basemap (pre-blended LOD texture); the GPU is much faster at that kind of thing.  This also means that if you have your own custom terrain shader, you can now override the ‘build basemap’ shader and generate matching basemap LOD textures.

作为一个很好的副作用,它也缩短了我们的加载时间! 我们不仅可以跳过构建所有这些自定义网格的过程,还可以使用GPU来构建底图(预混合的LOD纹理)。 GPU在这种情况下要快得多。 这也意味着,如果您有自己的自定义地形着色器,则现在可以覆盖“构建底图”着色器并生成匹配的底图LOD纹理。

地形视觉 (Terrain Visuals)

Instancing also improves the appearance of terrain normals; we decouple the terrain mesh normals from the geometry by storing them in a normal map texture that is generated from the heightmap and sampled in the pixel shader. This means the normals are independent of the mesh LOD level. Consequently, you can increase the ‘pixel error rate’ to decrease vertex cost, with fewer artifacts.

实例化还可以改善地形法线的外观; 通过将地形网格法线存储在从高度图生成并在像素着色器中采样的法线贴图纹理中,我们将地形网格法线与几何图形分离。 这意味着法线与网格LOD级别无关。 因此,您可以增加“像素错误率”以减少顶点成本,同时减少伪像。

Old per-vertex normals (left) and new per-pixel normals (right) – with identical triangle counts.

旧的每个顶点法线(左)和新的每个像素法线(右)–具有相同的三角形计数。

We also developed terrain shaders for both the HD and LW render pipelines, available in package versions 4.0.0 or later, with support for instanced rendering and per-pixel normals.  The HD shader was further enhanced to support new features such as height and density blend modes, normal scaling, texture controlled surface metalness and smoothness. The HD terrain shader is limited to a single pass, but it does support blending up to 8 terrain layers in one pass.

我们还为HD和LW渲染管线开发了地形着色器,可在4.0.0或更高版本的程序包中使用,并支持实例渲染和按像素法线。 HD着色器得到了进一步增强,以支持新功能,例如高度和密度混合模式,正常缩放,纹理控制的表面金属度和平滑度。 HD地形着色器仅限于一次通过,但确实支持一次通过最多混合8个地形图层。

可编写脚本的GPU工具 (Scriptable GPU Tools)

On the editor side, we have exposed a script API for building your own custom terrain tools, along with a suite of utility functions you can use to easily implement seamless cross-tile sculpting and painting operations on the GPU.  The new TerrainAPI includes TerrainPaintTool<T0>, a base class for terrain tools, and TerrainPaintUtility, containing utility functions for modifying terrain data.

在编辑器方面,我们公开了用于构建自己的自定义地形工具的脚本API,以及一整套实用程序功能,您可以使用它们轻松地在GPU上实现无缝的交叉拼贴雕刻和绘画操作。 新的TerrainAPI包括TerrainPaintTool <T0> (地形工具的基类)和TerrainPaintUtility (包含用于修改地形数据的实用程序功能)。

Applying these changes, we converted all of the existing terrain tools to GPU operations. Aside from making these tools much faster, this also gave us larger brush sizes, improved brush previews, and the ability to paint across terrain tile borders with automatic seam-stitching.

应用这些更改,我们将所有现有的地形工具转换为GPU操作。 除了使这些工具更快之外,这还为我们提供了更大的笔刷大小,更佳的笔刷预览以及能够通过自动缝线缝合在地形图块边界上绘制的功能。

New stamp terrain tool, with live preview, coming to 2018.3b 6.

带有实时预览的新邮票地形工具将于2018.3b 6。

We’ve also begun experimenting with brush features such as brush rotation and randomization and more advanced painting tools, like heightmap and mesh stamping, clone brushes, and more. These painting tools features are currently not in 2018.3, but we are making them available via our GitHub Terrain Tools project.

我们还开始尝试使用画笔功能(例如画笔旋转和随机化)以及更高级的绘画工具(例如高度图和网格冲压,克隆画笔等)。 这些绘画工具功能当前不在2018.3中,但是我们通过GitHub Terrain Tools项目使它们可用。

多地形支持 (Multiple Terrain Support)

Enable ‘Auto connect’ in the Terrain Settings, and the Terrain will automatically connect to its neighbors with the same grouping ID.

在地形设置中启用“自动连接”,地形将自动连接到具有相同分组ID的邻居。

When expanding your existing terrain, you can use our new ‘Create Neighbor Terrain’ tool to quickly add matching terrain tiles along empty borders.

扩展现有地形时,您可以使用我们新的“创建邻居地形”工具沿空边界快速添加匹配的地形图块。

新资产类型 (New Asset Types)

In order to simplify workflows, we also created two new terrain-related asset types: the TerrainLayer asset and the Brush asset.

为了简化工作流程,我们还创建了两种新的与地形相关的资产类型:TerrainLayer资产和Brush资产。

TerrainLayer lets us define terrain materials independent of the terrain object so that we can easily track the same material across multiple terrains. This helps with seamless painting and material modification. We also extend the TerrainLayer asset to support “mask map” textures, which can be used for arbitrary shading purposes, and a script interface to provide shader-dependent custom GUI for the TerrainLayer asset.
The Brush represents the GPU brush shapes used by painting and sculpting tools. They are now defined by a texture and a radial falloff curve. This makes it much easier to create and tweak brush shapes (which previously required dropping arcanely crafted image files into a specially named folder).
TerrainLayer使我们可以定义与地形对象无关的地形材质,以便我们可以轻松地在多个地形上跟踪相同的材质。 这有助于进行无缝绘画和材料修改。 我们还扩展了TerrainLayer资产以支持可用于任意着色目的的“蒙版贴图”纹理,以及一个脚本界面,可为TerrainLayer资产提供依赖于着色器的自定义GUI。
画笔代表绘画和雕刻工具使用的GPU画笔形状。 现在,它们由纹理和径向衰减曲线定义。 这样可以更轻松地创建和调整画笔形状(以前需要将神秘制作的图像文件拖放到一个特别命名的文件夹中)。

We also added support for the R16 texture format (a single channel 16-bit format) to Unity. This allows us to avoid 8-bit quantization on our brush shapes, which can cause undesirable ‘terracing’ effects if used as a heightmap stamp.

我们还向Unity添加了对R16纹理格式(单通道16位格式)的支持。 这样可以避免对笔刷形状进行8位量化,如果将其用作高度图标记,可能会导致不良的“梯形”效果。

8-bit brush stamp showing ‘terracing’ artifacts (top) and 16-bit brush stamp (bottom).

显示“梯形”伪像的8位笔刷图章(顶部)和16位笔刷图章(底部)。

Our terrain team is just getting started and development continues. Please send us feedback in the World Building forum!

我们的地形团队才刚刚起步,并且发展仍在继续。 请在世界建筑论坛上向我们发送反馈!

翻译自: https://blogs.unity3d.com/2018/10/10/2018-3-terrain-update-getting-started/

2018.4.3地形

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值