> For the complete documentation index, see [llms.txt](https://2yeet.gitbook.io/anvilcsg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://2yeet.gitbook.io/anvilcsg/validation-and-build/using-a-baked-map.md).

# Using a baked map

An **Anvil Baked Map** is the portable asset created by Build Map. Add an **Anvil Map Build** component to a scene to create playable scene output from that asset.

## What the asset contains

Depending on the source map and build settings, an Anvil Baked Map can store:

* Combined render meshes and materials
* Dedicated collider meshes
* Trigger volumes
* Mesh decals
* Reflection probes and their packaged textures
* Light-probe volumes and portable probe data
* Lightmap pages and renderer assignments
* Skybox material
* Mapper-script data
* Source scene identity and build signature
* Build statistics and warnings

The Baked Map Inspector shows source freshness, geometry statistics, build organization, UV2 state, lighting state, generated assets, and warnings.

## Adding a map to a scene

1. Choose **GameObject > Anvil > Map Build**.
2. Assign the Anvil Baked Map in **Map Source**.
3. Review Collision and Runtime settings.
4. Click **Build Generated Output**.

The Map Source section can also create a map from the active scene, update an assigned map, or select the asset in the Project window.

## Generated Scene Output

The component provides:

* Build Generated Output
* Rebuild Generated Output
* Replace Generated Output
* Clear Output

Generated output normally appears under `__AnvilGeneratedMap`, or the custom Generated Root Name.

A typical hierarchy contains:

```
__AnvilGeneratedMap
  World Geometry or named Build Section
    Groups
    Render
    Colliders
    Triggers
    Decals
    Reflection Probes
    Light Probes
```

This hierarchy is generated output, not the editable source map. Rebuild it from the asset instead of editing generated meshes by hand.

Anvil clears only objects carrying its generated ownership markers. Unrelated scene objects under other roots are left alone.

## Collision settings

* **Smart Merged** uses the baked collider chunks and is the recommended setting.
* **Off** creates no map collision.
* **Per Brush** is currently a debug choice, but does not yet guarantee one collider for each original source brush.

You can also assign a Physics Material and Collider Layer.

## Runtime settings

### Build at Runtime

When enabled, the component creates generated output during `Awake`. Leave it off when you want the output built in the Editor and saved with the scene.

### Replace Existing Output

When enabled, a build replaces output previously owned by this component.

### Apply Map Skybox

Applies the skybox saved in the map. The skybox belongs to the whole scene, so normally only one generated map should apply it.

### Generated Root Name

Changes the name of the generated hierarchy root. Ownership is tracked by components, not only by this name.

## What is recreated

Generated output can recreate:

* Render chunks
* Collider chunks
* Trigger volumes
* Decals
* Reflection probes
* Light-probe volumes
* Portable lightmaps
* Portable composed probe data on supported Unity versions
* Mapper scripts
* The saved map skybox when enabled

## What stays in the source scene

Ordinary source Lights are not recreated from the baked map. Arbitrary prefab entities are also not packed into the map asset.

If another scene needs those objects, place or transfer them through the normal Unity scene or prefab workflow. Reflection probes and Anvil light-probe volumes are different: those are included in the baked map.

## Keeping the map current

The Inspector reports when source brushes, decals, or terrain have changed since the map was built. Update the map from its authoring scene, then rebuild generated output in scenes that use it.

Generated output is disposable. Clearing it restores the editable workspace view in an authoring scene, and it can always be recreated from the current Baked Map asset.
