...
The diagram below shows the creation of one IBakeInputSystem. Repeat for each output map required.
| Excerpt | ||
|---|---|---|
| ||
Direct light baking
- First, all the bake systems have to be combined into a
BakeSystemResourceobject. This object is used to create a KD tree for the other stages to trace against, so requires updating if any geometry changes. - Next, copy lighting information into an
IBakeInputLightingobject. - Now, for each
BakeSystemResource, create anIBakeVisibilityBufferwith theIBakeAPI. This operation is slow; therefore if only the lights have changed (and not the geometry) you can pass in anIBakeVisibilityBufferfrom a previous run and it will be updated. - Call
IBake::BakeSystemDirect()to create theIBakeOutputSystemDirect. Optionally pass in aBakeSystemResourceobject to be able to apply a visibility-aware post-processing filter, with its size set as the filter size baking property. The final output texture, in FP16 format, can be pulled from this object.
...