Version: 2023.2

LightProbes

class in UnityEngine

/

继承自:Object

切换到手册

描述

存储所有当前已加载场景的光照探针。

数据包括:探针位置、球谐函数 (SH) 系数和四面体曲面细分。

You can modify the probe positions and coefficients, and update the tetrahedral tessellation at runtime. You can also swap the entire LightProbes object for a different pre-baked one using LightmapSettings.lightProbes.

To retrieve the LightProbes objects for a specific scene, use LightProbes.GetInstantiatedLightProbesForScene or LightProbes.GetSharedLightProbesForScene.

另请参阅:Unity 手册中的光照探针LightmapSettingsReceiveGI

变量

bakedProbes烘焙光照探针的系数。
cellCount空间划分为的单元格数(只读)。
cellCountSelfThe number of cells space is divided into for this LightProbes object (Read Only).
count光照探针数(只读)。
countSelfThe number of light probes stored in this LightProbes object (Read Only).
positions烘焙光照探针的位置(只读)。

公共函数

GetPositionsSelfGets the positions of the baked light probes stored in this LightProbes object.
SetPositionsSelfSets the positions of the baked light probes stored in this LightProbes object.

静态函数

CalculateInterpolatedLightAndOcclusionProbes计算给定世界空间位置处的光照探针和遮挡探针。
GetInstantiatedLightProbesForSceneGets an instantiated clone of the LightProbes object for a specific scene.
GetInterpolatedProbeReturns an interpolated probe for the given position for both real-time and baked light probes combined.
GetSharedLightProbesForSceneGets the shared LightProbes object for a specific scene.
TetrahedralizeSynchronously tetrahedralize the currently loaded LightProbe positions.
TetrahedralizeAsync异步四面体化所有当前已加载的 LightProbe 位置。

Events

lightProbesUpdatedUnity raises this event to indicate that the light probe structure (tetrahedralization) or values (spherical harmonics coefficients) have changed.
needsRetetrahedralizationAn event which is called when the number of currently loaded light probes changes due to additive scene loading or unloading.
tetrahedralizationCompletedEvent which is called after LightProbes.Tetrahedralize or LightProbes.TetrahedralizeAsync has finished computing a tetrahedralization.

继承的成员

变量

hideFlags该对象应该隐藏、随场景一起保存还是由用户修改?
name对象的名称。

公共函数

GetInstanceIDGets the instance ID of the object.
ToString返回对象的名称。

静态函数

Destroy移除 GameObject、组件或资源。
DestroyImmediate立即销毁对象 /obj/。强烈建议您改用 Destroy。
DontDestroyOnLoad在加载新的 Scene 时,请勿销毁 Object。
FindAnyObjectByTypeRetrieves any active loaded object of Type type.
FindFirstObjectByTypeRetrieves the first active loaded object of Type type.
FindObjectsByTypeRetrieves a list of all loaded objects of Type type.
Instantiate克隆 original 对象并返回克隆对象。

运算符

bool该对象是否存在?
operator !=比较两个对象是否引用不同的对象。
operator ==比较两个对象引用,判断它们是否引用同一个对象。