MaterialPropertyBlock.CopySHCoefficientArraysFrom

Switch to Manual
public void CopySHCoefficientArraysFrom (List<SphericalHarmonicsL2> lightProbes);
public void CopySHCoefficientArraysFrom (SphericalHarmonicsL2[] lightProbes);

Parameters

lightProbes要从中复制的 SH 值的数组。

Description

此函数将整个源数组都转换并复制到名为 unity_SHBbunity_SHBbunity_SHBbunity_SHBbunity_SHBbunity_SHBbunity_SHC 的 7 个 Vector4 属性数组中,用于实例化light probe渲染。

If the array properties don't exist on the MaterialPropertyBlock, they will be created with the length of the source array.
Call LightProbes.CalculateInterpolatedLightAndOcclusionProbes to calculate SH values at the given world space positions.
ArgumentNullException is thrown if lightProbes is null.
Note that all MaterialPropertyBlock arrays can only have a maximum of 1023 elements. Warnings are printed and the excess array elements are ignored if the source array exceeds the range.

另请参阅:CopyProbeOcclusionArrayFromGraphics.DrawMeshInstancedCommandBuffer.DrawMeshInstanced


public void CopySHCoefficientArraysFrom (SphericalHarmonicsL2[] lightProbes, int sourceStart, int destStart, int count);
public void CopySHCoefficientArraysFrom (List<SphericalHarmonicsL2> lightProbes, int sourceStart, int destStart, int count);

Parameters

lightProbes要从中复制的 SH 值的数组。
sourceStart要从中复制的源数组中第一个元素的索引。
destStart要复制到的目标 MaterialPropertyBlock 数组中第一个元素的索引。
count要复制的元素数量。

Description

此函数使用指定源和目标范围将整个源数组都转换并复制到名为 unity_SHBbunity_SHBbunity_SHBbunity_SHBbunity_SHBbunity_SHBbunity_SHC 的 7 个 Vector4 属性数组中,用于实例化light probe渲染。

If the array properties don't exist on the MaterialPropertyBlock, they will be created with the length of the spcified range.
Call LightProbes.CalculateInterpolatedLightAndOcclusionProbes to calculate SH values at the given world space positions.
ArgumentNullException is thrown if occlusionProbes is null.
ArgumentOutOfRangeException is thrown if the source or destination range is invalid.
Note that all MaterialPropertyBlock arrays can only have a maximum of 1023 elements. Warnings are printed and the excess array elements are ignored if the source array exceeds the range.

另请参阅:CopyProbeOcclusionArrayFromGraphics.DrawMeshInstancedCommandBuffer.DrawMeshInstanced