光照贴图UV Lightmapping UVs

1649 篇文章 12 订阅
1623 篇文章 23 订阅

Unity will use UV2 for lightmaps, if the channel is present. Otherwise it will use primary UVs.

Unity使用 展开好的UV2通道作为光照贴图的坐标,否则将用主UV通道作为光照图坐标。

Unity can unwrap your mesh for you to generate lightmap UVs. Just use the Generate Lightmap UVs setting in Mesh Import Settings.

你只需使用网格导入设置(Mesh Import setting)生成光照图UV集设置,Unity可以帮你自动展开网格光照图通道UV。

Advanced Options for Generate Lightmap UVs:

生成光照UV集的高级选项:

  • Pack Margin 紧缩间隔
    The margin between neighboring patches, assuming the mesh will take entire 1024x1024 lightmap measured in pixels. That has great effect: to allow filtering, Lightmap will contain lighting information in texels near patch border. So to avoid light bleeding when applying Lightmap there should be some margin between patches.
    假设网格需要1024x1024的光照贴图,这个选项控制相邻碎片之间的间隔,从而更有效的利用每一像素。这是一个非常有用的设置,它可以过滤图片中相邻的光照信息。尽量减少碎片的间隔,从而避免浪费生成光照图时浪费贴图资源。
  • Hard Angle 硬边角度
    The angle between neighboring triangles, after which the edge between them will be considered hard edge and seam will be created. If you set it to 180 degrees all edges will be considered smooth: this is useful for organic models. The default value 88 degrees: this is useful for mechanical models
    相邻三角面夹角的阈值,设置哪些边将作为硬边和接缝处理。如果你设置这个值为180度那么所有的边角将都被圆滑,这个参数在处理原始模型时非常有用。默认值为88度:这个角度能够更好的处理一些机械模型。
  • Angle Error 角度误差
    Maximum possible deviation of UVs angles from source geometry angles, in percentage. Basically it controls how similar triangles in uv space will be to triangles in original geometry (the value, the more similar triangles will be). Usually you wants it pretty low to avoid artifacts when applying Lightmap. Default is 8 percent. (This value goes from 0 to 100)
    原始模型夹角可能影响的最大Uvs  角度误差,用来控制基于原始模型影响Uv是坐标空间的相似三角面的百分比。(值越大相似三角面 越多)。通常你希望设置一个很小的数值从而避免烘培光照贴图时产生问题。默认设置为百分之8(可以设置0到100的数值)
  • Area Error 面积误差
    Maximum possible deviation of UVs areas from source geometry areas, in percentage. Basically it controls how good relative triangle areas are preserved. Usually that is not very critical, and moving that up can allow to create less patches; although you should recheck that distortion do not deteriorate Lightmap quality, as that way triangles may have different resolution. Default is 15 percent. (This value goes from 0 to 100)
    原始模型面积可能影响的最大Uvs 面积误差,用来控制基于多大的相对三角形面积被更好的保护。通常这个值不会带来太多的负面影响,将此值设置为一个较大的数值可以得到更少的Uv碎片。然而你应该再次确认这个设置是否产生了降低光照贴图质量的失真,不同的数值会使三角面占用不同的分辨率。默认设置为百分之15(可设置0到100的数值)。

If you prefer to provide your own UVs for lightmapping, remember that a good UV set for lightmapping:

如果你更喜欢自己手动展开光照贴图通道的Uvs,记住下列事项这样才能获得一个较好的光照贴图UV集

  • Is contained within the [0,1]x[0,1] space
    UV必须包含在[0,1]x[0,1]的坐标空间中
  • Has no overlapping faces.
    不要有重叠的UV
  • Has low angle distortion, that is deviation of angles in UVs and in source geometry.
    UVs 中的角度和原始模型的角度相比尽量避免较大的失真。
  • Has low area distortion, that is, relative scale of triangles is mostly preserved, unless you really want some areas to have bigger Lightmap Resolution.
    尽量避免面积大小的失真,三角面之间的相对比例尽量一致,除非你真的想缩放某些面积占用的更多的分辨率。
  • Has enough margin between individual patches.
    碎片之间要有足够的间隙。

Some examples of the hints suggested above:

下面我们来看一下上面这些出色建议的实例:

Angle distortion 角度失真

These screenshots were made for equal resolution, but with different uvs. Look at artefacts, and how the shape of light was slightly changed. There are only 4 triangles, actually, so shape distortion can be far uglier.

这些截图是使用相同分辨率的截图,但是使用了不同的UV。让我们来看一下这个物体表面的灯光形状有些轻微的变化,这个物体只有四个三角面,居然看起来形状失真是这么的糟糕。

Area distortion 面积失真

There are 2 spotlight with same parameters, the difference being only pointing to areas with different lightmap resolution, due to relative triangle scale being not preserved

下面有两盏同样参数的聚光灯,两张图片的区别仅仅在于不同的面积由于使用了非等比缩放而产生了不同的光照贴图分辨率。

页面最后更新: 2010-07-01

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值