Prerendered indirect light map for a scene.
    public class BakedLightmap : VisualInstance

Baked lightmaps are an alternative workflow for adding indirect (or baked) lighting to a scene. Unlike the GIProbe approach, baked lightmaps work fine on low-end PCs and mobile devices as they consume almost no resources in run-time.

Inheritance Chain

Constructors

    public BakedLightmap()

Properties

    public float BakeCellSize { get; set; }

Grid subdivision size for lightmapper calculation. The default value will work for most cases. Increase for better lighting on small details or if your scene is very large.

    public float BakeDefaultTexelsPerUnit { get; set; }

If a Mesh.LightmapSizeHint isn’t specified, the lightmap baker will dynamically set the lightmap size using this value. This value is measured in texels per world unit. The maximum lightmap texture size is 4096x4096.

    public float BakeEnergy { get; set; }

Multiplies the light sources’ intensity by this value. For instance, if the value is set to 2, lights will be twice as bright. If the value is set to 0.5, lights will be half as bright.

    public Vector3 BakeExtents { get; set; }

The size of the affected area.

    public bool BakeHdr { get; set; }

If true, the lightmap can capture light values greater than 1.0. Turning this off will result in a smaller file size.

    public BakeModeEnum BakeMode { get; set; }

Lightmapping mode. See BakeMode.

    public float BakePropagation { get; set; }

Defines how far the light will travel before it is no longer effective. The higher the number, the farther the light will travel. For instance, if the value is set to 2, the light will go twice as far. If the value is set to 0.5, the light will only go half as far.

    public BakeQualityEnum BakeQuality { get; set; }

Three quality modes are available. Higher quality requires more rendering time. See BakeQuality.

    public float CaptureCellSize { get; set; }

Grid size used for real-time capture information on dynamic objects. Cannot be larger than BakeCellSize.

    public string ImagePath { get; set; }

The location where lightmaps will be saved.

    public BakedLightmapData LightData { get; set; }

The calculated light data.

Methods

    public BakeError Bake(Node fromNode = null, bool createVisualDebug = false)

Bakes the lightmaps within the currently edited scene.

    public void DebugBake()

Executes a dry run bake of lightmaps within the currently edited scene.

    [Obsolete("GetBakeCellSize is deprecated. Use the BakeCellSize property instead.")]
    public float GetBakeCellSize()

Getter for BakeCellSize

    [Obsolete("GetBakeDefaultTexelsPerUnit is deprecated. Use the BakeDefaultTexelsPerUnit property instead.")]
    public float GetBakeDefaultTexelsPerUnit()

Getter for BakeDefaultTexelsPerUnit

    [Obsolete("GetBakeMode is deprecated. Use the BakeMode property instead.")]
    public BakeModeEnum GetBakeMode()

Getter for BakeMode

    [Obsolete("GetBakeQuality is deprecated. Use the BakeQuality property instead.")]
    public BakeQualityEnum GetBakeQuality()

Getter for BakeQuality

    [Obsolete("GetCaptureCellSize is deprecated. Use the CaptureCellSize property instead.")]
    public float GetCaptureCellSize()

Getter for CaptureCellSize

    [Obsolete("GetEnergy is deprecated. Use the BakeEnergy property instead.")]
    public float GetEnergy()

Getter for BakeEnergy

    [Obsolete("GetExtents is deprecated. Use the BakeExtents property instead.")]
    public Vector3 GetExtents()

Getter for BakeExtents

    [Obsolete("GetImagePath is deprecated. Use the ImagePath property instead.")]
    public string GetImagePath()

Getter for ImagePath

    [Obsolete("GetLightData is deprecated. Use the LightData property instead.")]
    public BakedLightmapData GetLightData()

Getter for LightData

    [Obsolete("GetPropagation is deprecated. Use the BakePropagation property instead.")]
    public float GetPropagation()

Getter for BakePropagation

    [Obsolete("IsHdr is deprecated. Use the BakeHdr property instead.")]
    public bool IsHdr()

Getter for BakeHdr

    [Obsolete("SetBakeCellSize is deprecated. Use the BakeCellSize property instead.")]
    public void SetBakeCellSize(float bakeCellSize)

Setter for BakeCellSize

    [Obsolete("SetBakeDefaultTexelsPerUnit is deprecated. Use the BakeDefaultTexelsPerUnit property instead.")]
    public void SetBakeDefaultTexelsPerUnit(float texels)

Setter for BakeDefaultTexelsPerUnit

    [Obsolete("SetBakeMode is deprecated. Use the BakeMode property instead.")]
    public void SetBakeMode(BakeModeEnum bakeMode)

Setter for BakeMode

    [Obsolete("SetBakeQuality is deprecated. Use the BakeQuality property instead.")]
    public void SetBakeQuality(BakeQualityEnum bakeQuality)

Setter for BakeQuality

    [Obsolete("SetCaptureCellSize is deprecated. Use the CaptureCellSize property instead.")]
    public void SetCaptureCellSize(float captureCellSize)

Setter for CaptureCellSize

    [Obsolete("SetEnergy is deprecated. Use the BakeEnergy property instead.")]
    public void SetEnergy(float energy)

Setter for BakeEnergy

    [Obsolete("SetExtents is deprecated. Use the BakeExtents property instead.")]
    public void SetExtents(Vector3 extents)

Setter for BakeExtents

    [Obsolete("SetHdr is deprecated. Use the BakeHdr property instead.")]
    public void SetHdr(bool hdr)

Setter for BakeHdr

    [Obsolete("SetImagePath is deprecated. Use the ImagePath property instead.")]
    public void SetImagePath(string imagePath)

Setter for ImagePath

    [Obsolete("SetLightData is deprecated. Use the LightData property instead.")]
    public void SetLightData(BakedLightmapData data)

Setter for LightData

    [Obsolete("SetPropagation is deprecated. Use the BakePropagation property instead.")]
    public void SetPropagation(float propagation)

Setter for BakePropagation

Inner Types

BakeError

Name Value Description
Ok 0  
NoSavePath 1  
NoMeshes 2  
CantCreateImage 3  
UserAborted 4  

BakeModeEnum

Name Value Description
ConeTrace 0 Less precise but faster bake mode.
RayTrace 1 More precise bake mode but can take considerably longer to bake.

BakeQualityEnum

Name Value Description
Low 0 The lowest bake quality mode. Fastest to calculate.
Medium 1 The default bake quality mode.
High 2 The highest bake quality mode. Takes longer to calculate.
Tags: