Renderer.lightmapIndex 光照贴图索引

var lightmapIndex : int

Description描述

The index of the lightmap applied to this renderer.

应用到该渲染器的光照贴图的索引。

The index refers to lightmaps array in LightmapSettings class. A value of 255 means no lightmap has been assigned, which is the default. A value of 254 is internally used for objects, that have their scale in lightmap set to 0, so behave as lightmapped, but don't have a lightmap assigned. The index can't be larger than 253.

索引是参考在LightmapSettings类的lightmaps数组。255的值意思是没有光照贴图被指定,这个值是默认的。254的值是物体内部使用的,有它们在光照贴图比例设置为0,因此表现为已应用了光照贴图,但是并没有光照贴图被指定。索引不能比253大。我总结一下,上面原文翻译的不太通顺

默认值为255,不使用光照贴图的意思,254是内部用,能使用的值是253~0。

A scene can have several lightmaps stored in it, and Renderer can use one of those lightmaps. This makes it possible to use the same material on multiple objects, while each object can refer to a different lightmap or different portion of the same lightmap.

一个场景可以储存多个光照贴图,并且渲染器可以使用这些光照贴图其中之一。这使得有可能在多个物体使用相同的材质,虽然每个物体可以引用不同的光照贴图或同一光照的不同部分。

参见: LightmapSettings 类, lightmapTilingOffset 属性

最后修改:2010年12月17日 Friday 21:33

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。