Baked Lighting How-To

Good Morning!

Following the RCP 3 lightmap workflow: I've added Lightmap components to my entities and hit Bake, but I get "Lightmap bake failed: no lightmappable entities found — enable Process for Lightmaps in an asset's Geometry Transform Settings." I can't locate that flag anywhere in the GUI, and my scene objects are prototype instances. Could you walk through the complete end-to-end setup for baking lighting: where the Process for Lightmaps flag actually lives (on the instance or the source asset?), whether lightmap UVs must be authored or are auto-generated, and how the Lightmap component relates to that eligibility flag?

Answered by Apple Designer in 891518022

Good morning!

You can find the Geometry Transform Settings by adding it as a new asset in the Project Browser via the context menu or the New Asset button in the top left of the Project Browser tab's toolbar.

I'll try to get a response for the other parts of your question, but that might not happen until later today.

Good morning!

You can find the Geometry Transform Settings by adding it as a new asset in the Project Browser via the context menu or the New Asset button in the top left of the Project Browser tab's toolbar.

I'll try to get a response for the other parts of your question, but that might not happen until later today.

Here's some guidance on the Lightmap workflow:

Making Lightmap-Ready Meshes

All meshes participating in a lightmapped scene are required to have a set of UV coordinates where each individual polygon's UVs do not intersect with others. This set can be provided in addition to the main UV set.

Reality Composer Pro is able to generate lightmap-friendly UV sets for meshes at import time. To do so, the "Generate Lightmap UVs" flag needs to be enabled in the Geometry Import Settings corresponding to the mesh that needs the lightmap-friendly UVs. For meshes that do not have this flag enabled, the system would fall back on the last available UV unwrap (e.g. if the mesh contains both UV and UV1, UV1 would be used for lightmap purposes).

To set up Geometry Import Settings:

  1. Create a Geometry Import Settings asset in the Project Browser via context menu or the New Assets button in the toolbar
  2. Select the newly created Geometry Import Settings asset
  3. Add a new category to the Geometry Import Settings asset in the inspector and click the disclosure arrow to view the new category
  4. Under "Lightmap Settings", enable "Generate Lightmap UVs"
  5. Click the Apply button at the bottom of the inspector to generate lightmap UVs for assets in the folder and its descendants

Any new assets imported into the folder containing the Geometry Import Settings asset or its descendants will have their Lightmap UVs generated automatically.

Choosing Which Lights to Bake

The Spot Light, Point Light and Directional Light components all contain a "light mobility" option. Set this to "dynamic" for lights that you expect to be able to move at runtime, so that their contribution is excluded from the light map. Add lights to the hierarchy of the entity with the Lightmap component.

Lightmap Component

The Lightmap Component manages the lightmap for a hierarchy of entities. It should be added to the root of the hierarchy that you wish to generate a lightmap for.

An entity possessing a Lightmap Component is called a lightmap root.

To add a new lightmap to the scene, select the entity that you wish to become a lightmap root in the Entity Hierarchy panel. Click "Add Component" in the Inspector panel, then search for "Lightmap Component" and select it to add the component to the scene.

Any descendant entities of a lightmap root entity will participate in the corresponding lightmap, as long as one the following conditions are met:

  1. The entity has a Model component referencing a mesh with auto-generated lightmap UVs.
  2. The entity has a Baked Lighting Overrides component with the "Include in Bake" flag enabled.
  3. The entity has a Spot/Point/Directional Light component with a non-dynamic mobility (in this case the entity will act as a light source of the corresponding type).

If none of those conditions are met, the entity will not be considered lightmappable.

The error message you're seeing that asks you to enable "Process for Lightmaps" is incorrect. I'd greatly appreciate it if you could file a bug report for us to correct the message and post the FB number here once you do.

Bug Reporting: How and Why? has tips on creating your bug report.

Baked Lighting How-To
 
 
Q