Get RAPTOR

IRaptorRtLightSource

Reads one light system's scene lights for the Ray-traced preview and the Lights tool.

NamespaceAssemblyKindStability
Raptor.Render.EditorToolsRaptorRender.Editorinterfacepreview, since 0.1.0

A source packs its lights into the RT GPU layout (RaptorRtLight) and names the components the Lights tool lists, picks and edits. Its Id matches the IRaptorLightBackend.Id of the backend that owns those lights, and the active light backend selects the source (RaptorRtLightSources.Active).

public interface IRaptorRtLightSource

Properties

Id

string Id { get; }

The id of the light backend this source reads: RaptorLightBackends.BakeryId, UnityId, or an added backend's id.

LightTypes

IReadOnlyList<Type> LightTypes { get; }

The light component types this source reads. Contains no null entries, and is empty when the light system is not installed.

Methods

Gather

int Gather(RaptorRtSceneSettings settings, List<RaptorRtLight> lights, List<Vector4> areaTris, List<float> areaCdf, out int hash, out Cubemap skyCube, out Matrix4x4 skyRotation)

Fills the GPU light list, the area-light triangles and the per-light CDF for the current scene, and returns the light count. hash changes whenever any input changes; the preview re-uploads only then.

ParameterTypeDescription
settingsRaptorRtSceneSettingsThe scene settings.
lightsList<RaptorRtLight>Filled with the GPU light list.
areaTrisList<Vector4>Filled with the area-light triangles.
areaCdfList<float>Filled with the area lights' per-light CDF.
hashout intA hash of what was read.
skyCubeout CubemapThe sky cubemap, or null.
skyRotationout Matrix4x4The sky's rotation.

Returns: The light count.

ReadSettings

RaptorRtSceneSettings ReadSettings()

Returns the scene's global settings that affect how a bake looks. Does not create anything.

Returns: The settings.

Traces

bool Traces(Component light)

Returns whether this source traces light, a component of one of the LightTypes.

ParameterTypeDescription
lightComponentThe light.

Returns: True if it is traced.