bakeInput | The bake input to use. |
progress | Progress tracker. |
context | Device context. |
world | The world to populate with the contents of the bake input. |
bool True if the world was populated successfully.
Populate the given world from a bake input.
This method generates the world space data structures used by integrators. For example, acceleration structures, lookup tables, and other data structures that can be shared between integrators. Related content: IWorld.
How to populate a world from a bake input.
// Extract bake input.
bool result = UnityEngine.LightTransport.InputExtraction.ExtractFromScene(out var input);
Assert.IsTrue(result);
// Create context and world.
var context = new RadeonRaysContext();
Assert.NotNull(context);
var contextInitialized = context.Initialize();
Assert.AreEqual(true, contextInitialized);
var world = new RadeonRaysWorld();
// Populate the integration world.
using var progress = new BakeProgressState();
var worldResult = UnityEngine.LightTransport.InputExtraction.PopulateWorld(input, progress, context, world);
Assert.IsTrue(worldResult);
Context.Dispose();