Unity 3D 光照贴图快速入门 Lightmapping Quickstart

This an introductory description of lightmapping in Unity. For more advanced topics see in-depth description of lightmapping in Unity

这是一个Unity 光照贴图的引导手册。如果想查看更多的高级功能请查看in-depth description of lightmapping in Unity

Unity has a built-in lightmapper: it‘s Beast by Illuminate Labs. Lightmapping is fully integrated in Unity. This means that Beast will bake lightmaps for your scene based on how your scene is set up within Unity, taking into account meshes, materials, textures and lights. It also means that lightmapping is now an integral part of the rendering engine - once your lightmaps are created you don‘t need to do anything else, they will be automatically picked up by the objects.

Unity内置的光照贴图烘培工具是Illuminate Labs 的Beast。烘培光照贴图流程被完美的整合到Unity中。这就意味着使用Beast可以根据你的网格物体,材质贴图和灯光属性的设置来烘培你的场景,从而得到完美的光照贴图。同时也意味着光照图将作为渲染引擎的一部分。只要你烘培一次光照贴图你就不需要其他任何操作。光照图将自动指定到物体上。

Preparing the scene and baking the lightmaps

准备需要烘培的光照贴图的场景

Selecting Window – Lightmapping from the menu will open the Lightmapping window:

从菜单栏选择Window – Lightmapping打开光照图工具窗口。

  1. Make sure any mesh you want to be lightmapped has proper UVs for lightmapping. The easiest way is to choose the Generate Lightmap UVs option in mesh
    import settings

    检查你将要烘培的模型上是否存在一个合适的用来定位光照贴图的UVs。你也可以从mesh import settings面板中的勾选Generate Lightmap UVs选项来生成一个用于定位光照图UV的集。
  2. In the Object pane mark any Mesh Renderer or Terrain as static – this will tell Unity, that those objects won‘t move nor change and they can be lightmapped.
    在物体面板中将要烘培光照贴图的物体设置为Static(静态),这样Unity就会知道哪些物体是需要被烘培的。 
  3. To control the resolution of the lightmaps, go to the Bake pane and adjust the Resolution value. (To have a better understanding on how you spend your lightmap texels, look
    at the small Lightmap Display window within the Scene View and select Show Resolution).
    在Bake面板下调整Resolution的值控制光照贴图的分辨率。(在Scene View面板里勾选上小窗口Lightmap Display中的Show Resolution选项可以帮助你更直观的查看贴图分辨率设置)。 
  4. Press Bake 
    点击Bake(烘培)
  5. A progress bar appears in Unity Editor‘s status bar, in the bottom right corner. 
    在Unity编辑器底部的状态栏的右边会出现一个进度条。
  6. When baking is done, you can see all the baked lightmaps at the bottom of the Lightmap Editor window. 
    当烘培结束时,你可以从光照图编辑器的底部预览窗口中查看所有烘培好的贴图。

Scene and game views will update - your scene is now lightmapped!

场景和游戏窗口将会更新。现在在你的场景中已经可以看到光照贴图效果了!

Tweaking Bake Settings 调节烘焙设置

Final look of your scene depends a lot on your lighting setup and bake settings. Let‘s take a look at an example of some basic settings that can improve lighting quality.

最终场景的渲染效果取决与你对灯光和烘培选项的更多设置。让我们来看一个通过基础设置改进光照的质量的小例子。

This is a basic scene with a couple of cubes and one point light in the centre. The light is casting hard shadows and the effect is quite dull and artificial.

这是一个简单的场景,包含一组立方体和一个位于场景中心的点光源。灯光产生硬阴影,看起来效果相当平淡而不自然。

Selecting the light and opening the Object pane of the Lightmapping window exposes Shadow Radius and Shadow Samples properties. Setting Shadow Radius to 1.2, Shadow Samples to 100 and re-baking produces soft shadows with wide penumbra - our image
already looks much better.

选择灯光打开物体面板,展开阴影范围和阴影采样属性。设置阴影范围为1.2,阴影采样为100重新烘培,会产生一个半影范围很宽的软阴影。我们画面看起来真的好多了。
 

With Unity Pro we can take the scene one step further by enabling Global Illumination and adding a Sky Light. In the Bake pane we set the number of Bounces to 1 and the Sky Light Intensity to 0.5. The result is much softer lighting with subtle diffuse
interreflection effects (color bleeding from the green and blue cubes) - much nicer and it‘s still only 3 cubes and a light!

使用专业版Unity能够开启全局光照和天光进行烘培画面效果能得到更大的改进。在Bake(烘培)面板设置Bounces(反弹)为1,Sky Light Intensity天光强度为0.5。能够烘培出带有微妙变化的反射效果的软光源。(会从绿色和蓝色的盒子上产生色彩溢出)。

 

Lightmapping In-Depth 光照贴图深入了解

For more information about the various lightmapping-related settings, please refer to the in-depth description of lightmapping
in Unity
.

更多的和光照贴图设置有关的信息请查阅in-depth description of lightmapping in Unity

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

原文地址:https://www.cnblogs.com/skiwnchiwns/p/10345399.html

时间: 2024-08-28 09:39:10

Unity 3D 光照贴图快速入门 Lightmapping Quickstart的相关文章

光照贴图深入学习 Lightmapping In-Depth

If you are about to lightmap your first scene in Unity, this Quickstart Guide might help you out. 如果你是在Unity第一次接触光照贴图,这个快速指南可以帮助你快速了解. Lightmapping is fully integrated in Unity, so that you can build entire levels from within the Editor, lightmap the

【Unity 3D 游戏开发】Unity3D 入门 - 工作区域介绍 与 入门示例

一. 工作区域详解 1. Scence视图 (场景设计面板) scence视图简介 : 展示创建的游戏对象, 可以对所有的游戏对象进行 移动, 操作 和 放置; -- 示例 : 创建一个球体, 控制摄像机, 让球体在摄像机拍摄的视图中显示出来; (1) 摄像机导航 摄像机旋转(Tumble) : alt + 鼠标左键, 摄像机会按照鼠标滚动的垂直中线进行旋转, 可以查看摄像机当前的状态, 注意只是改变视图中的状态, 摄像机还是在视图正中央位置, 摄像机的位置属性是不变的; 摄像机移动(Track

Unity 过度光照贴图

背景:开关窗帘过程,让环境在亮和暗之间过度 事先烘培出亮.暗两张Lighting map.然后代码实现,窗帘开关由动作实现,而代码中通过动作执行进度来过度两张Lighting map void OnAnimatorMove() { AnimatorTransitionInfo transitionInfo = animator.GetAnimatorTransitionInfo(0); if (transitionInfo.normalizedTime != 0)//状态切换中 { } else

光照贴图

光照图的理论和实践 http://www.cnblogs.com/minggoddess/archive/2012/12/03/2800133.html 光照贴图快速入门 http://www.bjbkws.com/online/1091/ http://wenku.baidu.com/link?url=frxjAkZW64G8Z6ujGC75yvGFl1WxtigbaKKak7IWu9gjYkCMPKme_5cT4PsMHcbzn68sZASfD6WvGDzBdr_WMmW1fulXSprq0

Unity编辑器中光照贴图背后的PowerVR光线追踪技术

今年八月,大量的游戏开发者走进Unite 2014,齐聚在西雅图中心参加Unite第八届年度会议.在一系列令人兴奋的会议以及主题演讲中,来自我们PowerVR光线追踪团队的Jens Fursund介绍了即将推出的Unity 5光照贴图编辑器,使用光线追踪技术以快速.准确地模拟光照. 我们非常高兴与Unity的合作,在最近的展示和活动中,我们已经从观看该工具演示的一些开发者中得到很多积极反馈. 让我们来快速浏览一下PowerVR光线追踪技术如何通过新光照贴图编辑器助力开发人员和艺术家加快作品开发.

[Unity 3d]荒岛逃生游戏制作

这是我和一名同学一起制作的<Memory Island>荒岛逃生小游戏.第一次使用Unity 3D实现,游戏过程和场景都不复杂,不过是一次很有启发也颇具成就的尝试!谢谢师哥辅导! 游戏内容很简单:玩家以第一人称视角根据线索找到金.银钥匙,寻找路线,打开各种门,找到小船,便可逃离荒岛. 在此我介绍制作思路,其中附上部分基础代码,最后演示游戏过程! 一.制作过程 1. 首先,我们在unity 3d中建立荒岛模型:树.草.土丘等,搜寻箱子.钥匙.木屋.石像.船等素材放置在岛中. 设置了天空盒材质:M

【Unity】第12章 光照贴图和光影效果

分类:Unity.C#.VS2015 创建日期:2016-05-19 一.简介 在Unity 5中,Lighting是-种增强场景光照和阴影效果的技术,它可以通过较少的性能消耗使静态场景看上去更真实.丰富,以及更具有立体感,又可以对动态对象进行处理. 早期版本的Unity 4只能对"静态"对象和"动态"对象分别进行处理,称为Lightmapping(光照贴图),但是,Lightmapping不能被用来实时地处理"动态"光照:而在Unity 5中,

C# for Unity快速入门(连载14)_C#枚举类型

C# for Unity编程语言快速入门教程(连载14)_C#枚举类型 C#的枚举类型(用 "enum"关键字标识),按照笔者理解本质上是一个隐式继承了System.Enum的整形类.枚举类型的主要作用是:为了更好的识别一个变量的具体含义,且固定变量的使用"范围". 例如:形如如下定义 public enum Week{   Monday,  Tuesday,  Wenesday,  Thursday,  Friday,  Saterday,  Sunday }  

Unity 3D入门简介

最近在刚开始学习Unity 3D,在这里记录一下学习心得和学习笔记,边学边写,可能会比较零散.好了,废话不多说,今天从Unity 3D入门写起,主要简要介绍一下Unity 3D的和一些学习资料.以下如果不作特别说明,均是指Windows平台的Unity 3D,版本是4.5.1f3. Unity 3D是一款游戏开发引擎,目前支持2D和3D游戏的开发,其最大的优势就是跨平台性非常好,可以很容易的将PC端制作的游戏移植到Android.IOS等移动平台,当然也可以创建网页游戏.刚开始进行Unity 3