This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
static_batching [2021/12/11 21:42] guycalledfrank [Batching and MaterialPropertyBlocks] |
static_batching [2021/12/12 23:11] starasgames Added a bit of informaton about how static batching works in Editor |
||
---|---|---|---|
Line 18: | Line 18: | ||
Static batching is done at build-time, so mobile developers should be aware that static batching can unexpectedly increase your build size. Static Batching can result in significantly more mesh data being generated, if many batch meshes are created. | Static batching is done at build-time, so mobile developers should be aware that static batching can unexpectedly increase your build size. Static Batching can result in significantly more mesh data being generated, if many batch meshes are created. | ||
+ | |||
+ | In the Editor static batching occurs after the scene is loaded (after Awake and OnEnable). It is considered a [[https:// | ||
==== Lightmap UV Coordinates ==== | ==== Lightmap UV Coordinates ==== | ||
Line 33: | Line 35: | ||
This data is efficiently managed by the engine and uploaded to the GPU as fast as Unity can. The idea is to abuse some of these built-in values to pass custom data. Good candidates are '' | This data is efficiently managed by the engine and uploaded to the GPU as fast as Unity can. The idea is to abuse some of these built-in values to pass custom data. Good candidates are '' | ||
- | When using custom SRP and SRP batching, the recipe is following: | + | When using SRP batching, the recipe is following: |
+ | |||
+ | '' | ||
- | '' | ||
'' | '' | ||
- | '' | + | For custom SRPs: '' |
+ | |||
+ | On the GPU you should have a '' | ||
- | On the GPU you should have a UnityPerDraw cbuffer with float4 unity_DynamicLightmapST in it, and it will be filled with custom data. | ||
- | Note that the " | + | Note that the " |