Unity LOD-Level of Detail(多层次细节)用法教程

71 篇文章 3 订阅
40 篇文章 8 订阅

Unity LOD 多层次细节


本文提供全流程,中文翻译。

Chinar 坚持将简单的生活方式,带给世人!

(拥有更好的阅读体验 —— 高分辨率用户请根据需求调整网页缩放比例)



Chinar —— 心分享、心创新!

助力快速理解 Unity中多层次细节组的具体用法

为新手节省宝贵的时间,避免采坑!


Chinar 教程效果:
这里写图片描述



全文高清图片,点击即可放大观看 (很多人竟然不知道)


1

Level of detail —— 多层次细节


性能优化时,我们有时需要对物体进行处理,来让游戏跑起来更流畅

多层次细节处理,就是让一个物体,在相机距离不同的情况下,显示不同的模型,从而节省性能的开销
举个栗子黑白88
开发者做个非常精致的房子,顶点数/面数一定很多

玩家在游戏中,控制人物相机视角离一座房子近的时候,看起来非常精致好看!游戏体验很好!(假设性能开销为100)

当玩家走远的时候,这座房子还在那里,但已经走了很远了,房子看起来不是那么清晰了

但由于房子的模型精度太高无论远近,模型的顶点和面数都不变

Gpu都需要去处理,并绘制房子的图形效果。性能开销还是100

那么就有些浪费性能了,当玩家走远的时候,我们只需要让玩家看到一个房子还在那里即可,因为无论精细度多高,玩家看起来房子都很小,看不清

这是一个房子还好说,现如今没有什么cpu绘制不了这么一个房子。但游戏对象肯定不止一个,大型游戏可能有一堆,几百个,上千个物体

所以作为开发者,我们无需把一个精度那么高的模型,还放在那里,给CPU GPU增加工作量

这时候我们就可以用 LOD 技术,来对模型进行 分层级显示

视角离近时,我们让物体显示精细度高的模型

视角离远时,我们让物体显示精细度低的模型

这就是 Level of detail 多层次细节优化


2

Example —— Unity 层次优化例子


Unity 为我们提供了一个组件 LOD Group

开发者可以极为方便创建,并进行 LOD 优化

在层次面板中创建一个空物体,并创建3个子物体: Cube Sphere Capsule
举个栗子黑白88
这里写图片描述


3

Set LOD Group —— 添加设置层次细节组


Add ComPonent 添加组件 LOD Group

并将 3 个子物体,对应设置到组件相应的参数的层级中

注意:

其实游戏开发时,多数都是在参数中直接关联 预设物 ,而并非层次面板中的游戏对象

所以,LOD技术带来性能优化的同时,存在的一个 缺点就是会增大程序包的体积

因为本来一个模型,现在要准备起码2个/3个/4个,打包时自然而然程序包体积就会增大!
举个栗子黑白88
这里写图片描述


4

Ultimate Impact —— 最终效果


现在你可以缩放镜头,来查看效果了,就这么简单

LOD Group 组件会根据你设置的 距离百分比,来显示相应的游戏对象
举个栗子黑白88
这里写图片描述


5

Set Parameter —— 设置参数


层级显示的距离的远近,可以通过调节组件上方的显示百分比来调节

LOD Group 组件会根据你设置的 距离百分比,来显示相应的游戏对象

下边演示了,绑定预设物与设置距离的具体操作步骤
举个栗子黑白88
这里写图片描述
至此:LOD教程基本用法完美结束


支持

May Be —— 搞开发,总有一天要做的事!


拥有自己的服务器,无需再找攻略!

Chinar 提供一站式教程,闭眼式创建!

为新手节省宝贵时间,避免采坑!


先点击领取 —— 阿里全产品优惠券 (享受最低优惠)


1 —— 云服务器超全购买流程 (新手必备!)

2 —— 阿里ECS云服务器自定义配置 - 购买教程(新手必备!)

3—— Windows 服务器配置、运行、建站一条龙 !

4 —— Linux 服务器配置、运行、建站一条龙 !




<script type="math/tex" id="MathJax-Element-2"> </script>
技术交流群:806091680 ! Chinar 欢迎你的加入


END

本博客为非营利性个人原创,除部分有明确署名的作品外,所刊登的所有作品的著作权均为本人所拥有,本人保留所有法定权利。违者必究

对于需要复制、转载、链接和传播博客文章或内容的,请及时和本博主进行联系,留言,Email: ichinar@icloud.com

对于经本博主明确授权和许可使用文章及内容的,使用时请注明文章或内容出处并注明网址

Level of Detail for 3D Graphics作者: David Luebke , Martin Reddy , Jonathan D. Cohen , Amitabh Varshney , Benjamin Watson , Robert Huebner 出版:Morgan Kaufmann The Morgan Kaufmann Series in Computer Graphics and Geometric ModelingSeries Editor: Brian A. Barsky, University of California, BerkeleyLevel of detail (LOD) techniques are increasingly used by professional real-time developers to strike the balance between breathtaking virtual worlds and smooth, flowing animation. Level of Detail for 3D Graphics brings together, for the first time, the mechanisms, principles, practices, and theory needed by every graphics developer seeking to apply LOD methods.Continuing advances in level of detail management have brought this powerful technology to the forefront of 3D graphics optimization research. This book, written by the very researchers and developers who have built LOD technology, is both a state-of-the-art chronicle of LOD advances and a practical sourcebook, which will enable graphics developers from all disciplines to apply these formidable techniques to their own work.This Book:* Is a complete, practical resource for programmers wishing to incorporate LOD technology into their own systems.* Is an important reference for professionals in game development, computer animation, information visualization, real-time graphics and simulation, data capture and preview, CAD display, and virtual worlds.* Is accessible to anyone familiar with the essentials of computer science and interactive computer graphics.* Covers the full range of LOD methods from mesh simplification to error metrics, as well as advanced issues of human perception, temporal detail, and visual fidelity measurement.* Includes an accompanying Web site rich in supplementary material including source code, tools, 3D models, public domain software, documentation, LOD updates, and more.http://pixhost
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值