Summary of "Harnessing Light with URP and the GPU Lightmapper | Unite Now 2020"
Summary: Harnessing Light with URP and the GPU Lightmapper | Unite Now 2020
This Unity presentation, led by Ciro Continisio (Lead Evangelist, EMEA at Unity), provides an in-depth tutorial and analysis on lighting techniques using the Universal Render Pipeline (URP) and the GPU Progressive Lightmapper. It targets lighting artists, environment artists, and developers aiming to improve scene visuals and performance.
Key Technological Concepts and Features Covered
1. Universal Render Pipeline (URP) Overview
- URP is a scalable, optimized rendering pipeline built on Scriptable Render Pipeline (SRP) technology.
- Supports all Unity build targets including VR, AR, consoles, mobile, and desktop.
- Scales rendering quality based on device capabilities.
- Demo features advanced URP effects such as water shaders with caustics, planar reflections, vegetation, terrain, and day/night cycles.
2. Real-Time Lighting and Shadows in URP
- Real-time lighting uses Directional Lights and Spotlights that can cast dynamic shadows.
- Shadows are controlled via Shadow Maps, with adjustable resolution (e.g., 2048 for main light, 512 for smaller spotlights).
- Shadow quality depends on resolution, distance, and cascades (multiple shadow maps with varying resolution based on distance).
- Depth Bias and Normal Bias parameters help reduce shadow artifacts (“shadow acne”).
- URP currently supports real-time shadows for Directional and Spotlights; Point lights lack real-time shadows due to forward rendering (deferred rendering support planned).
- Area Lights are baked only, not real-time.
3. Baked Lighting with GPU Progressive Lightmapper
- Static geometry is marked as Static for baking.
- Lights can be set to Baked or Mixed to participate in baking.
- Baked Area Lights simulate emissive lighting effects on small details.
- Lightmap resolution controls texels per unit, affecting detail and performance.
- Mesh Renderer’s Scale in Lightmap allows per-object resolution scaling to optimize Lightmap usage.
- Samples settings:
- Direct Samples: rays shot to detect direct lighting.
- Indirect Samples: rays for bounced light.
- Environment Samples: rays capturing bounced light from environment.
- Bounces setting controls how many times rays bounce, affecting realism.
- Filtering reduces noise in baked Lightmaps:
- Gaussian filter blurs pixels indiscriminately.
- A-Trous filter respects geometry boundaries, preserving sharpness near edges.
- AI-based denoisers further improve bake quality and reduce noise.
- Filtering is applied within UV Charts (UV islands) to avoid bleeding across geometry.
- Proper UV mapping for Lightmaps is crucial:
- Unique, non-overlapping UV islands are required.
- Unity can auto-generate Lightmap UVs, but manual authoring is recommended for best results.
- Margin between UV islands prevents light bleeding artifacts.
- Visualization modes in Unity help inspect UV charts, Lightmap coverage, and UV overlaps.
4. Mixed Lighting Modes in URP
- URP supports two mixed lighting modes:
- Baked Indirect: Direct lighting and shadows are real-time; indirect light bounces are baked.
- Subtractive: Everything baked except dynamic objects cast real-time shadows.
- Shadowmask and Distance Shadowmask modes are not yet supported but planned.
- Mixed lighting allows flexible scenarios like day/night cycles and performance optimization.
- Proper configuration requires enabling Mixed Lighting in URP Asset and setting lights to Mixed.
5. Light Probes
- Light Probes capture baked lighting at points in the scene.
- Dynamic objects sample nearby probes to receive baked indirect lighting and emissive effects.
- Light Probes approximate lighting but do not provide real-time shadows on dynamic objects.
- Placement strategy: arrange probes in pyramids around areas where lighting changes and where dynamic objects move.
- Light Probes help reduce Lightmap usage on small detailed objects (e.g., plants) by lighting them dynamically.
- Unity offers visualization tools to debug Light Probe placement and contribution.
6. Reflection Probes
- Reflection Probes capture environment reflections for materials like metal and glass.
- They work as spherical probes with defined influence volumes.
- Multiple probes can be used to reflect different areas (e.g., interior vs. exterior).
- Probes have priorities/importance to determine which is used when overlapping.
- Unity automatically creates a default Reflection Probe capturing the skybox for areas without custom probes.
- Reflection Probes are a performance-friendly alternative to expensive ray-traced reflections.
Practical Tips and Workflow Suggestions
- Bake smartly: use lower quality settings during iteration; increase quality for final bakes.
- Prepare assets carefully: author UVs manually for Lightmaps, ensure correct normals to avoid lighting artifacts.
- Tune shadow settings (resolution, distance, bias) considering player perspective rather than developer close-up inspection.
- Use Light Probes to optimize lighting on dynamic objects and detailed small objects.
- Utilize filtering and denoising to reduce bake noise without excessively increasing bake times.
- Use Unity’s visualization modes to debug UV overlaps, Lightmap coverage, Light Probes, and GI contributions.
- Adjust reflection probes to improve material realism without heavy performance costs.
Available Resources
- Demo Project available for download (includes FPS Sample and Snaps HD Art pack assets).
- Unity Documentation for deeper reading on lighting modes and settings.
- Unity Forums and dedicated threads for Q&A with Ciro and Unity lighting/URP teams.
Main Speaker
Ciro Continisio Lead Evangelist, EMEA, Unity Technologies
This talk provides a comprehensive guide and best practices for leveraging URP’s lighting system combined with the GPU Lightmapper to create visually appealing and performant scenes in Unity.
Category
Technology