Unity3D LOD Group

23 篇文章 1 订阅

今天下了一个4.0破解版,然后看到一个Demo Level of Detail    就研究了一下  以前用的是Unity3.5 free版本,没有这个功能,真实泪奔。。。。。。。

 

As your scenes get larger, performance becomes a bigger consideration. One of the ways to manage this is to have meshes with different levels of detail depending on how far the camera is from the object. This is called Level of Detail (abbreviated asLOD)

由于场景变大,就要更加考虑性能的问题。有一种管理方法,取决于摄像机离对象的远近,网格有不同的细节级别,这就是所谓的细节级别( Level of Detail)(LOD的缩写)

Here's one of the ways to set up an object with different LODs.

下面是建立具有不同LODs对象的方法。

  1. Create an empty Game Object in the scene 
    在场景创建一个空的游戏物体。
  2. Create 2 versions of the mesh, a high-res mesh (for LOD:0, when camera is the closest), and a low-res mesh (forLOD:1, when camera is further away) 
    创建2个版本的网格,高清晰度网格(L0D:0,当摄像机最接近时),和一个低分辨率网格(L0D:1,当摄像机较远)
  3. Add a LODGroup component to this object (Component->Rendering->LOD Group)
    给这个对象添加LODGroup 组件(Component->Rendering->LOD Group
  4. Drag in the object with the high-res mesh onto the first Renderers box forLOD:0. Say yes to the "Reparent game objects?" dialog 
    把高分辨率网格的对象拖到的第一个渲染器框 L0D:0。对话框"Reparent game objects?" 按下yes按钮
  5. Drag in the object with the low-res mesh onto the first Renderers box forLOD:1. Say yes to the "Reparent game objects?" dialog 
    把低分辨率网格的对象拖到的第二个渲染器框 L0D:1。对话框"Reparent game objects?" 按下yes按钮
  6. Right Click on LOD:2 and remove it. 
    在LOD:2上右键单击并删除它。

At this point the empty object should contain both versions of the mesh, and "know" which mesh to show depending on how far away the camera is.

此时,空对象应包含两个版本的网格,"知道"网格取决于相机远离程度显示不同的版本。

You can preview the effect of this, by dragging the camera icon left and right in the window for theLODGroup component.

您可以预览这个效果,通过拖拽摄像机图标到LODGroup组件窗口(的LOD:0,LOD:1的矩形框)。

LOD 0

camera at LOD 0(在LOD 0时的摄像机)

LOD 1

camera at LOD 1(在LOD 1时的摄像机)

In the Scene View, you should be able to see

在场景视图,你应该能够看到:

  • Percentage of the view this object occupies 
    这个对象占用视图的百分比
  • What LOD is currently being displayed 
    当前显示的是哪个LOD
  • The number of triangles 
    三角形的数量

LOD-based naming conventions in the asset import pipeline
在资产的导入管线基于LOD的命名约定

In order to simplify setup of LODs, Unity has a naming convention for models that are being imported.

为了简化LOD设置,Unity在模型导入时有一个命名约定。

Simply create your meshes in your modelling tool with names ending with _LOD0, _LOD1, _LOD2, etc., and the LOD group with appropriate settings will be created for you.

简单地创建你网格,名称后缀为_LOD0,_LOD1,_LOD2等,会为你创建LOD组,并作出相应的设置。

Note that the convention assumes that the LOD 0 is the highest resolution model.

请注意,该约定假定最高分辨率的网格的LOD后面的数字是最小的。

Setting up LODs for different platforms
对于不同的平台设置LOD

You can tweak your LOD settings for each platform in Quality Settings, in particular the properties of LOD bias and Maximum LOD Level.

质量设置你可以为每个平台条件LOD设置,特别是LOD偏移和最大LOD层次。

Utilities 实用工具

Here are some options that help you work with LODs

下面是一些选项,可有助于你更好的使用LOD工作。

 


Recalculate Bounds
重新计算边界
If there is new geometry added to the LODGroup, that is not reflected in the bounding volume, press this to update the bounds. One example where this is needed is when one of the geometries is part of aprefab, and new geometry is added to that prefab. Geometry added directly to the LODGroup will automatically updates the bounds
如果有新的几何体添加到LODGroup,未被映射到边界体内,按这个按钮来更新边界。一个例子,当几何体之一是prefab的一部分,以及新的几何体被添加到这个prefab。几何体直接添加到LODGroup将自动更新边界。

Update Lightmaps
更新光照贴图
Updates the Scale in Lightmap property in the lightmaps based on the LOD level boundaries.
更新光照贴图基于LOD层次边界光照贴图属性比例。
Upload to Importer
上传给导入器
Uploads the LOD level boundaries to the importer
上传LOD层次边界给导入器
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
提供的源码资源涵盖了Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 适合毕业设计、课程设计作业。这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。 所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值