May 09, 18
講演者：Ciro Continisio(Unity Technologies)
Ciro Continisio Technical Evangelist Unity Technologies
Lighting and GI
Progressive Lightmapper Introduced in 5.6 - Now feature complete
Progressive Lightmapper Soft shadows Area lights and emissive
Prioritize View • • Will start baking what is framed in the Scene View first Once it’s done, it will bake the rest
Force Stop • Gathers all the data baked so far, and finalises it • Filtering • Baking light probes and reflection probes • If you bake again, Unity resumes where you left!
Samples and Lightmap Resolution
Texel Resolution • • • Start with a very low resolution to iterate quickly (10-15) Don’t inspect the game with the eyes of a creator… • … but think of how the player will see it! You always need a lower resolution than you think!
Texel Resolution per object Very low res in background Per object (or prefab) Higher res in foreground
Samples • Each texel will shoot these many samples
Direct Samples Finds light Emitted
Indirect Samples Finds skybox Emitted Bounces x times
Light bounces Light Darkrecesses areas Even softer shadows
How many bounces? 1 Bounce 3 min 2 Bounces 5 min
Filtering Filtering is an operation that smooths out the result of the bake. • • • • Happens after the bake Happens even if Force Stop is pressed Can be None, Auto or Advanced If you want to change filtering, you don’t need to bake again!
Filtering Samples 10/300 - No filtering 3:48 Samples 3/100 - Advanced filtering 1:45
Filtering • In Advanced: choose between Gaussian and the new A-Trous • Gaussian smooths A LOT • A-Trous is edge-aware: preserves hard edges and AO better
Filtering comparison Gaussian A-Trous
UV Charts Objects are broken down into charts, based on their normals. • Created when the bake starts, based on the normals of the object • NOT the same as the ones used by Enlighten for Realtime GI!
UV Charts Limits of filtering
UV Charts • • You can redo your normals in your modelling package Or ask Unity to generate them:
Light Probes • • They allow to capture baked lights to be used for moving objects Lay them out in pyramids
Light Probes usage Dark areas Coloured lights Area lights and emissives
Light Probes debugging
Light Probes trick
Mixed Modes Mixed Lighting is not an option you turn on/off. Choose the type: • Baked Indirect • Shadowmask • Subtractive And then use lights marked as Mixed.
Subtractive • Cheapest of all, but least appealing
Baked Indirect • Bakes indirect light, rest is realtime. CPU expensive, but dynamic
Shadowmask • Most lighting is baked into lightmaps. Cheap and flexible.
Distance Shadowmask • Realtime shadows up close, baked in big environments
Compression settings • Iterate faster by keeping probes and lightmaps uncompressed • Once you are happy with your bake, compress them again
Fixing seams Irregular lighting on a surface, or between adjacent objects which should be parallel • They can be particularly annoying in modular 3D art • Seams can depend on many factors
Thank you! Ciro Continisio @CiroContns connect.unity.com/u/Ciro Technical Evangelist Unity Technologies