...
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
BakeSystemResource
object. 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
IBakeInputLighting
object. - Now, for each
BakeSystemResource
, create anIBakeVisibilityBuffer
with theIBake
API. This operation is slow; therefore if only the lights have changed (and not the geometry) you can pass in anIBakeVisibilityBuffer
from a previous run and it will be updated. - Call
IBake::BakeSystemDirect()
to create theIBakeOutputSystemDirect
. Optionally pass in aBakeSystemResource
object 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.
...