原地址:http://www.unity蛮牛.com/thread-20005-1-1.html

Tips for Creating Better Games and Working More Efficiently in unity
在unity中高效工作以及开发更卓越的游戏的几点建议(下)
小编的话:(上)篇的链接是 http://www.unity蛮牛.com/thread-19974-1-1.html
福利又来了!大家马上看看(下)篇吧。这是蛮牛译馆中的热心译友Dusthand翻译的文章。
他非常卖力,翻译得很好。小蛮牛们一定要好好支持下他的杰作,多给点儿评论&回复吧
我挑出的关键词有(方便大家阅读):多细节层次、LOD、烘焙光照贴图、灯光探测器、灯光效果。

Use Level of Detail
多细节层次 
    The level of detail feature inside of Unity is a great tool to use to that allows you take a very detailed asset and switch it out for a lower resolution mesh depending on how close the camera is. As the camera moves further away, it’s going to switch out the mesh with the lower resolution version. This is a great optimization technique to use that can save a lot of processing time, because it only renders out the detail when it’s actually necessary.
       Unity的多细节层次是一个很好的工具,它允许你使用多层次的细节,并根据相机的远近程度切换到较低分辨率的级别。这是一个非常重要的优化技术,它仅仅在必要时,将细节进行渲染,因而可以节省大量的时间开销。

There’s no reason to display a high resolution of detail if the player isn’t close enough to actually tell the difference. Of course, this will mean you’ll need to model several versions of the same asset at different detail levels. You also need to keep in mind that this is a Unity Pro only feature. So if you’re using the free version, it won’t be available to you.
        当玩家离物体较远,而不足以分辨出差别时,我们完全没有必要呈现出较高的分辨率。当然,这意味着你需要为同一份资源在细节层次上准备多个版本。【注意:LOD是专业版的功能,如果你使用的是免费版,就不用想了。】

<ignore_js_op>

Bake Lightmaps
烘焙光照贴图
        As you start working with large levels requiring many different lights to create the look and feel you want, it can really start bogging down your game and have an impact on the framerate.
当你建造大型的场景,并且需要使用各种类型的灯光,用来营造理想的效果时,你会发现自己的游戏运行很慢,帧数也急剧下降。

To prevent your lights from impacting your game, you should be creating lightmaps. They allow you to bake all the lighting in your level directly to the actual textures. All of the lighting information stays there, but you don’t need the lights anymore. You can also add things like ambient occlusion to a lightmap to enhance the realism, but keep in mind this will increase the bake time.
为了避免光照效果影响你的游戏性能,你应该创建光照贴图。你可以将你场景中所有的灯光都烘焙到实际的纹理上。所有的照明信息都会留在上面,然后你就可以去掉这些灯光了。你还可以将环境光散射也烘焙进去,从而增加真实感,但要注意,这会增加烘焙时间。

Lightmaps may not be great for everything. Let’s say you want to give the player the ability to shoot out a light. This wouldn’t be achievable with a lightmap. So find places where you can implement lightmaps without hurting the gameplay.
        光照贴图并不是万能的。例如,你想让玩家可以发射出一束光,光照贴图是无法办到的。你所要做的是,找到可以用光照贴图实现,又不会影响游戏性的场合。

Use Light Probes
使用灯光探测器
        Anytime you create lightmaps for the lighting in your game, you’ll see it’ll look great for all the static objects in the level, but it doesn’t work for any type of dynamic asset in your game. This could be the character, enemies or anything moving. Dynamic objects will not be affected by the lightmaps. So while your level is nice and bright, the character will stay dark.
        当你为游戏创建光照贴图时,你会发现它在静态的物体上效果还不错,但它不适用于任何类型的动态物体,例如角色、敌人以及所有会移动的物体。光照贴图无法作用于动态物体,所以你会发现即使你的场景看上去十分的明亮,但是角色却是黑色的。

<ignore_js_op>

Lightmapping can’t be calculated for moving objects in real time, but it’s possible to get a similar effect that you would get with dynamic lights by using light probes. By placing light probes in your level, it’ll sample all of the lighting at each probe point. The lighting can then be interpolated between the samples taken from the nearest point. This can be done in real time so it simulates the lighting that would occur in the scene if there were actual dynamic lights set up and not lightmaps.
        光照贴图无法为移动中的物体进行实时计算,但是通过为动态光源使用灯光探测器,还是可以达到非常接近的效果。通过在场景中布置灯光探测器,可以为每个探测点的光照进行采样。然后任一点的光照就可以通过附近的点进行插值来得到。所以,在场景中没有光照贴图而存在动态光源的地方,就可以通过插值实时地模拟出光照。

When placing your light probes, you want to do it in areas with a high contrast in light. You’ll also want to put a probe between two bright areas, so you’ll get realistic results as your character moves through the level.
         在放置灯光探测器时,你可以把它放置在和光亮有较大对比的一个区域内。同样可以考虑,把灯光探测器放置在两个明亮区域之间,这样当人物在场景中移动时,会产生明显的效果。

<ignore_js_op>

Next time you fire up Unity to work on your game project, find places where you can incorporate these tips to speed up your workflow and even cut back on processing time.
         下一次,当你用Unity开发你的游戏项目时,好好回顾下我讲授的几点建议,这样能够加快你的工作和增强游戏性能。

原文:http://blog.digitaltutors.com/ti ... ficiently-in-unity/
译文:蛮牛译馆 - Dusthand & OVATION
转载注明出处!!!
 
        我是游戏蛮牛的蛮牛译馆(一个专门翻译国外资料的组织)的一员,我会陆续整理,翻译国外unity相关的新闻资讯与技术文章,以及各种视频等内容。我们也欢迎热爱游戏翻译的好友加群,一起体验翻译并分享乐趣,QQ群号:52677537。关于此篇文章翻译有错误的地方,欢迎大家指正。

转载于:https://www.cnblogs.com/123ing/p/3868114.html

在Unity中高效工作(下)相关推荐

  1. Unity中在Editor下的延迟调用

    Unity中在Editor下的延迟调用 说到延迟调用, 大家肯定首先想到的是MonoBehavior的协程, 但是在Editor不太好用. 我们这里给出两个方案供大家选择. async 第一种比较简单 ...

  2. unity android ndk的作用,Unity中编写Android下使用的so插件

    四月 24.2019. 0 Comment 在android上编写插件有多种路子: 1. c# portable library,用c#写的可移植的assembly.使用起来最简单.最方便,比如那些j ...

  3. png图片在unity中Default模式下透明区域显示白底的问题

    最近在项目开发中遇到一个问题,美术给的png图片在unity中查看的时候Default选项下透明区域会显示黑白色,用于spine动画中会显示白色的色块.但是透明区域显示黑色的地方正常. 打印图片每个像 ...

  4. 向左还是向右?Unity中俯视视角下人物智能转向的控制方法

    再利用动画控制人物移动的过程中,实现智能转向(自动判断向左还是向右转)功能的方法有许多种,效果不一而足,代码量也千差万别,在这里,博主给出以下四种可以实现转向方法以供参考 1.利用三维向量Vector ...

  5. 在后台中高效工作 – 后台任务

    https://blogs.msdn.microsoft.com/windowsappdev_cn/2012/06/07/503/

  6. unity中使用手柄控制角色移动

    unity中第三人称下使用手柄控制角色移动 本文建议结合这一篇文章观看: https://blog.csdn.net/qq_45919090/article/details/109393562 uni ...

  7. dll放在unity哪个文件夹下_程序丨如何将你的Unity代码整理到一个DLL中?

    原标题:程序丨如何将你的Unity代码整理到一个DLL中? 翻译:林政(玄猫大人) 审校:沈晓霖 代码复用的重要性 这里有一则故事也是你听过类似的: 你下载好Unity,看完Youtube上的一些教程 ...

  8. 替代Protocol buffers 的FlatBuffers:高效利用内存的序列化函数库(Unity中测试)

    孙广东   2015.7.4 http://www.open-open.com/lib/view/open1441004786315.html 虽然FB的反序列化超级快,但是数据大小还是蛮大的(可能的 ...

  9. 原来在UNITY中使用system.io下的所有函数都可以用相对路径 : Assets/xx

    原来在UNITY中使用system.io下的所有函数都可以用相对路径 : Assets/xx 代码如下图,这样就不用在绝对路径和相对路径之间不断转换了. 想要得到绝对路径时就傅 Application ...

  10. dll放在unity哪个文件夹下_unity中调用dll文件总结

    unity中调用dll文件总结 根据收集的资料,对unity中调用dll文件进行总结,目前常用的两种,在给出vs中封装dll文件的步骤. 一.调用c#中的dll文件 1.1封装dll文件 首先新建一个 ...

最新文章

  1. 二十五:设计模式的总结
  2. java按升序冒泡排序_Java实现冒泡排序算法
  3. c++怎么保留小数位数
  4. wpf在异步中给前台赋值
  5. 谋哥:App自推广这个概念就由我来创立了!
  6. php layui 框架,Thinkphp5+Layui高颜值内容管理框架
  7. php表单 提交数据,PHP表单提交数据
  8. 信息学奥赛一本通C++语言——1021: 打印字符
  9. oracle 论坛 千万级表,Oracle千万级记录操作总结
  10. OpenCV之感兴趣区域ROI
  11. android端好用的gif生成器,gif字幕生成器
  12. 架构蓝图--软件架构 “4+1“ 视图模型
  13. 图的m着色问题-回溯法
  14. Linux基本命令---2
  15. c语言组播源码_CLAA Class C简单组播业务的实现
  16. 3D动画效果照片墙demo
  17. golang时间类型字符串转时间类型
  18. 编程中的命名设计那点事
  19. PF_PACKET环形接收缓存
  20. oracle中的pl SQL,Oracle数据中的PL/SQL介绍

热门文章

  1. MetaBAT2学习笔记
  2. 现代C++编程实战02-自己动手,实现C++的智能指针
  3. 华为不胫而走的20亿奖金
  4. nestjs项目新建
  5. css Filter 滤镜
  6. 深度学习:迁移学习(Transfer learning)
  7. 爬虫(02)网络请求模块2020-12-14
  8. 常用的数据结构 JAVA
  9. js实现抖音话题发布
  10. SVM(三)支持向量机,线性不可分和核函数