Skip to Content
DocumentationFeaturesOcclusion & Lightmap

Occlusion & Lightmap

Occlusion & Lightmap exposes the standard AO and lightmap controls plus a bent-normal slot for proper indirect-specular direction. It grounds a Genesis material into baked lighting and gives crevices the contact-darkening that PBR needs to read.

When to use it

  • Every Lit material in a lightmapped scene.
  • Hero props where baked AO sells the contact shadows.
  • Indirect specular — bent normals bias the environment sample toward unoccluded directions.
  • Mobile baked-lighting workflows.

How it works

The shader samples _OcclusionMap from the selected channel, scales by _OcclusionStrength, and multiplies into the diffuse and indirect terms. When a bent normal is provided, it replaces the geometric normal for the SH and reflection-probe samples only; direct lighting stays accurate.

Properties

Inspector labelShader propertyTypeDefaultDescription
Occlusion Map_OcclusionMapTexture2DwhiteGreyscale AO texture.
AO Channel_OcclusionChannelEnumGWhich channel holds AO. G is the Unity convention.
Strength_OcclusionStrengthFloat (0–1)1.00 = no darkening, 1 = full.
Affects Direct_OcclusionAffectsDirectFloat (0–1)0.00 = indirect only (PBR-correct), 1 = direct too.
Bent Normal_BentNormalMapTexture2DNoneOptional bent normal for indirect direction.
Lightmap Influence_LightmapInfluenceFloat (0–2)1.0Scales the lightmap contribution.
Lightmap Tint_LightmapTintColorRGB(1,1,1)Tint applied to the baked lightmap.

Usage

  1. Bake an AO map with the AO Baker tool, using a UV1 unwrap.
  2. Pack AO into the G channel of a Metallic/AO/Smoothness texture (Unity convention).
  3. Set the AO Channel to G and dial Strength to taste; 0.8 is the sweet spot.
  4. For hero props, bake a bent normal in the same pass and assign it for cleaner indirect.
material.SetTexture("_OcclusionMap", aoTex); material.SetFloat("_OcclusionStrength", 0.85f); material.SetTexture("_BentNormalMap", bentNormal);

Tips & gotchas

  • AO multiplies indirect only by default, matching PBR convention. Raise Affects Direct only for stylized art.
  • Lightmap UVs (UV1) must be unique; overlapping UV1 produces bake artifacts.
  • Bent normals are tangent space — use the same import settings as a regular normal map.
  • AO is free when packed into an existing mask. Bent normals add one sample, usually worth it.
Last updated on