Legacy Documentation: Version 4.6(go to latest)
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Renderer.lightmapIndex

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public var lightmapIndex: int;
public int lightmapIndex;
public lightmapIndex as 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.

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.

See Also: LightmapSettings class, lightmapTilingOffset property, ShaderLab properties.