static_batching
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
static_batching [2021/04/30 17:34] – 73.95.178.156 | static_batching [2021/12/11 21:46] – [Batching and MaterialPropertyBlocks] guycalledfrank | ||
---|---|---|---|
Line 23: | Line 23: | ||
The lightmap coordinates from [[lightingdataasset|Lighting Data Asset]] are baked into the Combined Mesh UV coordinates when the scene loads((I think this also happens **during** standalone build, not at runtime, but I'm not sure)). Afterwards, querying '' | The lightmap coordinates from [[lightingdataasset|Lighting Data Asset]] are baked into the Combined Mesh UV coordinates when the scene loads((I think this also happens **during** standalone build, not at runtime, but I'm not sure)). Afterwards, querying '' | ||
+ | Static batching can actually work with manually provided lightmap scale/ | ||
+ | |||
+ | ===== Batching and MaterialPropertyBlocks ===== | ||
+ | |||
+ | Static and SRP batching is incompatible with MaterialPropertyBlocks, | ||
+ | |||
+ | This is the data sent by the SRP batcher for each draw call: https:// | ||
+ | |||
+ | 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 SRP batching, the recipe is following: | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | For custom SRPs: '' | ||
+ | <br> | ||
+ | |||
+ | 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 " |
static_batching.txt · Last modified: 2025/01/15 04:35 by 127.0.0.1