Version: Unity 6.1 Alpha (6000.1)
LanguageEnglish
  • C#

InputExtraction.ExtractFromScene

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static bool ExtractFromScene(out LightTransport.InputExtraction.BakeInput bakeInput);

Parameters

bakeInput The bake input generated by the this method (output variable).

Returns

bool True if the extraction was successful.

Description

Extract BakeInput from the set of open scenes.

All objects of type LightProbeGroup, Light, MeshRenderer, Terrain, and their associated lists of Material are extracted when this method is called. Pass the produced BakeInput object into InputExtraction.PopulateWorld to generate the data needed for integrators implementing the IProbeIntegrator interface.

// 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();

How to extract bake input from the open scenes.