Getting Started
Introduction
Installation
Project Configuration
Testing in Your Sandbox
Samples & Examples
Core Concepts & Glossary
Package Types
Spaces & Space Templates
Custom Avatars
Custom Avatar Animations
Avatar Attachments
Custom Prefab Objects
Embedded Packages
Drivable Vehicles
Scene Setup
Testing In Unity vs Sandbox
Controlling the Camera
Custom Collision, Layers, and Tags
Audio Mixers and Groups
Key Differences from Standard Unity3D development
Economy
Quests and Rewards
Economy Overview
Monetization
Items
Consumable Items
Rewarding Items
World Currency
Selling Items
Scripting
- C# Scripting
- Visual Scripting
- Sync and Multiplayer
Components
Entrance Point
Camera Passthrough
Interactable
Trigger Event
Point Of Interest
Environment Settings Overrides
Render Pipeline Settings Overrides
Movement Materials
Climbable
Avatar Teleporter
Empty Frame
Projector Surface
Seat Hotspot
Guidelines
Supported Features and Limitations
Performance Guidelines
Lighting
Publishing to Spatial
Finding Published Packages
Support
FAQs
Help and Support
Release Notes
Asset Import Settings
Lighting
<aside>
đĄ We recommend completing Unityâs course on Lighting before working with lighting components.
</aside>
Typical Recommended Setup
You may create as many lights in your scene as you want, but all of them (except for 1) should be marked as âBakedâ.
Only one Directional Light in the space may be set to âMixedâ and may also have âSoft Shadowsâ enabled. This main directional light will be used for real-time shadows on systems that match the system requirements.
For lightmapping, these are the settings youâll need to make things work correctly in Spatial. You can open the lighting panel from the âWindows/Rendering/Lightingâ menu bar item in the top.
Lightmapping Settings
- Mixed Lighting Mode: Use Shadowmask. Distance Shadowmask will produce incorrect results for mixed realtime and baked lighting.
- Lightmapper: GPU lightmapper is a lot faster than others. If your graphics card is not good enough to this, Unity will switch it to CPU automatically. (In the case, lower Max Lightmap Size and try again.)
- Direct Samples: 32 is default and good enough. You can decrease for the fast iteration and increase to have better result.
- Indirect Samples: 512 is default and good enough. If your scene doesnât have much direct light and use bounced lights mostly, like indoor and sun light from outside is the only light source, and if you see noise on the lightmaps, increase this to 768 or 1024. Keep in mind that this will increase baking time a lot.
- Environment Samples: 256 is default and good enough. This is sample count of lights from your skybox. If you still see noises after increasing Indirect Samples, try increase this. This count is necessary when you have less light objects and most of lighting is done with skybox.
- Min/Max Bounces: 1 for min and 2 for max is default and good enough for outdoor environments. You may need to experiment with this value if your environment is mostly indoors with dark areas, which will utilize bounce calculations more effectively.
- Filtering: Auto is default and Iâd recommend not to set this manually because itâs very easy to cause noises or artifacts with this Filtering option.
- Lightmap Resolution: 30 texels per unit is relatively good, but this varies depending on your environmentâs physical dimensions. Our Public Park has 37 and it has 8 of 1k lightmaps. Our Agora has 27 and it has 9 of 2k lightmaps and 1 of 1k lightmap. You need to find the best number and it is important for efficient use of lightmaps. The larger your environment is, the lower your lightmap resolution will have to be, since having too many lightmap textures will use too much memory.
- Max Lightmap Size: Note that Unity bakes lightmaps per object. So if thereâs not enough space for the lightmap to bake the object, Unity will create another lightmap so 1024 could waste more pixels than 2048. And if one object is very large, 1024 could be too small to bake details. (Unity will fit it to the max size). 4096 could take too much bandwidth for mobile devices, so 2048 is relatively good.
- Lightmap Compression: This compression option will just set the texture compression to ETC2 or DXT5. Weâd recommend to use ASTC (ASTC6x6 or 8x8) instead. You can manually change the format manually in the texture settings after baking. (Note that once you bake lightmaps again, Unity will overwrite the format by this setting.)
- Directional Mode: Currently, only Non-directional is supported. Directional lightmaps will produce incorrect results.
- Lightmap Parameters: Use âVery Lowâ when testing and âMediumâ will be enough for final. (âHighâ if youâre a perfectionist. But itâs hard to notice the difference.)
Tips
Note that for objects to be included in the baked lightmap, they have to be marked as âStaticâ.
Troubleshooting - Asset Import Utility
To help creators optimize their builds to smoothly across all Spatial-supported devices, we introduced the Asset Import Utility in July 2023. In some instances it may cause unintended optimization of some project files and textures. Check out the Asset Import utility documentation for help with troubleshooting these optimization changes:
Asset Import Utility: https://docs.spatial.io/faqs/asset-import-settings
Lighting FAQ
My object isnât receiving light-mapped shadows. How do I fix this?
My environment has no ambient color and the scene looks dark.
Skybox(panoramic) has a seamline.
Terrain isnât rendered with normal maps on web and sandbox.
Lightmap results are unsatisfactory.
If the particles in your experience appear to have changed, Click Here for how to fix the issue.
Terrain appears Shiny.
If the particles in your experience appear to have changed, Click Here for how to fix the issue.
The appearance of particles has changed.
If the particles in your experience appear to have changed, Click Here for how to fix the issue.
Scripts that read textures or meshes no longer function properly.
If the particles in your experience appear to have changed, Click Here for how to fix the issue.
â Previous
Performance Guidelines
Next â
Publishing to Spatial