MaterialPropertyBlock.CopySHCoefficientArraysFrom

切换到手册
public void CopySHCoefficientArraysFrom (List<SphericalHarmonicsL2> lightProbes);
public void CopySHCoefficientArraysFrom (SphericalHarmonicsL2[] lightProbes);

参数

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

描述

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

如果数组属性在 MaterialPropertyBlock 中不存在,则使用源数组的长度创建它们。\ 调用 LightProbes.CalculateInterpolatedLightAndOcclusionProbes 可计算给定世界空间位置处的 SH 值。\ 如果 lightProbes 为 /null/,则抛出 ArgumentNullException。\ 请注意,所有 MaterialPropertyBlock 数组都最多只能有 1023 个元素。如果源数组超过范围,则输出警告并忽略多余的数组元素。

另请参阅: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);

参数

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

描述

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

如果数组属性在 MaterialPropertyBlock 中不存在,则使用指定范围的长度创建它们。\ 调用 LightProbes.CalculateInterpolatedLightAndOcclusionProbes 可计算给定世界空间位置处的 SH 值。\ 如果 occlusionProbes 为 /null/,则抛出 ArgumentNullException。\ 如果源或目标范围无效,则抛出 ArgumentOutOfRangeException。\ 请注意,所有 MaterialPropertyBlock 数组都最多只能有 1023 个元素。如果源数组超过范围,则输出警告并忽略多余的数组元素。

另请参阅:CopyProbeOcclusionArrayFromGraphics.DrawMeshInstancedCommandBuffer.DrawMeshInstanced

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961