ConvertToUnityFormat(IDeviceContext, BufferSlice<SphericalHarmonicsL2>, BufferSlice<SphericalHarmonicsL2>, int)
Converts light probes encoded as SphericalHarmonicsL2 to the format expected by the Unity renderer.
Read time 1 minuteLast updated 7 days ago
Definition
- Type: Method
- Namespace: UnityEngine.LightTransport.PostProcessing
- Assembly: UnityEditor.CoreModule
public bool ConvertToUnityFormat(IDeviceContext context, BufferSlice<SphericalHarmonicsL2> irradianceIn, BufferSlice<SphericalHarmonicsL2> irradianceOut, int probeCount)
Parameters
Device context.
Buffer containing input irradiance.
Output buffer containing the irradiance array after the conversion to the format compatible with a Unity renderer.
Number of SphericalHarmonicsL2 probes to convert.
Returns
Type | Description |
|---|---|
| bool | True if the operation was successfully added to the command queue on the context. |
Remarks
The irradiance SphericalHarmonicsL2 light probes must satisfy the following conditions when used with a Unity renderer:
- For L0 and L1, the coefficients must have the SH standard normalization terms folded into them (to avoid doing this multiplication in a shader).
- The coefficients must be divided by Pi (π) for compatibility reasons.
- L1 must be ordered as yzx (rather than xyz). The order is flipped back right before rendering in the GetShaderConstantsFromNormalizedSH function, before the SphericalHarmonicsL2 probes are passed to a shader.