Skip to content

Commit

Permalink
Probe Volume:
Browse files Browse the repository at this point in the history
Probe Volumes: Fix case when ShaderConfig enables them, but they have not yet been enabled in the frame settings. Previously this case would spill errors about unassigned compute parameters like _ProbeVolumeAtlasSH - this comes up when creating standalone HDRP template projects for repro demos

Probe Volume sampling quality (#102)

* Added a frame setting for Probe Volume lighting sampling quality between SHL0, SHL1 and SHL2.

* Probe Volume sampling quality cleanup.

* WIP switch Probe Volume spherical harmonics level with global keywords. L0 and L1 are not supported by Dynamic GI yet.

* Implemented missing SH L0 and L1 modes for Dynamic GI.

* Removed Probe Volume SHL0 option to save shader variants. Fixed Volumetric Lighting.

* Fixed VFX shaders after introducing different Probe Volume encodings.

* Support baking SHL2 fallback radiance from within the SHL1 mode. Cleanup.

Check if probeVolumeAtlas is null before trying to release a slot from it. The atlas could be not created yet as we are doing it later in a rendering now to match the selected SH encoding for a given frame. (#108)

Probe Volumes: Remove an unnecessary editor only GC.Alloc

Reflection Probe Normalization: Fix bad rebase merge of reflection probe normalization code
  • Loading branch information
pastasfuture committed Oct 19, 2022
1 parent 9ed02f9 commit 1bdf5e9
Show file tree
Hide file tree
Showing 36 changed files with 343 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ public enum ShaderOptions
/// <summary>The probe volume bilateral filtering sample mode.</summary>
/// <seealso cref="ProbeVolumesBilateralFilteringSampleModes"/>
ProbeVolumesBilateralFilteringSampleMode = ProbeVolumesBilateralFilteringSampleModes.ApproximateSample,
/// <summary>The probe volume encoding method.</summary>
/// <seealso cref="ProbeVolumesEncodingModes"/>
ProbeVolumesEncodingMode = ProbeVolumesEncodingModes.SphericalHarmonicsL2,

/// <summary>Support for area lights.</summary>
AreaLights = 1,
Expand Down Expand Up @@ -158,9 +155,6 @@ public class ShaderConfig
/// <summary>Specifies the probe volume filtering mode.</summary>
///<seealso cref="ShaderOptions.ProbeVolumesBilateralFilteringMode"/>
public static ProbeVolumesBilateralFilteringSampleModes s_ProbeVolumesBilateralFilteringSampleMode = (ProbeVolumesBilateralFilteringSampleModes)ShaderOptions.ProbeVolumesBilateralFilteringSampleMode;
/// <summary>Specifies the probe volume encoding method.</summary>
///<seealso cref="ShaderOptions.ProbeVolumesEncodingMode"/>
public static ProbeVolumesEncodingModes s_ProbeVolumesEncodingMode = (ProbeVolumesEncodingModes)ShaderOptions.ProbeVolumesEncodingMode;
/// <summary>Indicates whether to support area lights.</summary>
///<seealso cref="ShaderOptions.AreaLights"/>
public static int s_AreaLights = (int)ShaderOptions.AreaLights;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#define SHADEROPTIONS_PROBE_VOLUMES_ADDITIVE_BLENDING (1)
#define SHADEROPTIONS_PROBE_VOLUMES_BILATERAL_FILTERING_MODE (1)
#define SHADEROPTIONS_PROBE_VOLUMES_BILATERAL_FILTERING_SAMPLE_MODE (0)
#define SHADEROPTIONS_PROBE_VOLUMES_ENCODING_MODE (2)
#define SHADEROPTIONS_AREA_LIGHTS (1)
#define SHADEROPTIONS_BARN_DOOR (0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Shader "Hidden/Debug/ProbeVolumeSHPreview"
#pragma vertex vert
#pragma fragment frag

#pragma multi_compile PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1 PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
Expand Down Expand Up @@ -125,14 +127,21 @@ Shader "Hidden/Debug/ProbeVolumeSHPreview"

#if SHADEROPTIONS_PROBE_VOLUMES_EVALUATION_MODE != PROBEVOLUMESEVALUATIONMODES_DISABLED

#if SHADEROPTIONS_PROBE_VOLUMES_ENCODING_MODE == PROBEVOLUMESENCODINGMODES_SPHERICAL_HARMONICS_L1
#if defined(PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L0)
ProbeVolumeSphericalHarmonicsL0 coefficients;
ZERO_INITIALIZE(ProbeVolumeSphericalHarmonicsL0, coefficients);
ProbeVolumeLoadAccumulateSphericalHarmonicsL0(probeIndexAtlas3D, 1.0f, coefficients);
ProbeVolumeSwizzleAndNormalizeSphericalHarmonicsL0(coefficients);
outgoingRadiance = coefficients.data[0].xyz;

#elif defined(PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1)
ProbeVolumeSphericalHarmonicsL1 coefficients;
ZERO_INITIALIZE(ProbeVolumeSphericalHarmonicsL1, coefficients);
ProbeVolumeLoadAccumulateSphericalHarmonicsL1(probeIndexAtlas3D, 1.0f, coefficients);
ProbeVolumeSwizzleAndNormalizeSphericalHarmonicsL1(coefficients);
outgoingRadiance = SHEvalLinearL0L1(normalWS, coefficients.data[0], coefficients.data[1], coefficients.data[2]);

#elif SHADEROPTIONS_PROBE_VOLUMES_ENCODING_MODE == PROBEVOLUMESENCODINGMODES_SPHERICAL_HARMONICS_L2
#elif defined(PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2)
ProbeVolumeSphericalHarmonicsL2 coefficients;
ZERO_INITIALIZE(ProbeVolumeSphericalHarmonicsL2, coefficients);
ProbeVolumeLoadAccumulateSphericalHarmonicsL2(probeIndexAtlas3D, 1.0f, coefficients);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,20 @@ static class CoreKeywordDescriptors
}
};

public static KeywordDescriptor ProbeVolumesEncoding = new KeywordDescriptor()
{
displayName = "Probe Volumes Encoding",
referenceName = "PROBE_VOLUMES_ENCODING",
type = KeywordType.Enum,
definition = KeywordDefinition.MultiCompile,
scope = KeywordScope.Global,
entries = new KeywordEntry[]
{
new KeywordEntry() { displayName = "Spherical Harmonics L1", referenceName = "SPHERICAL_HARMONICS_L1" },
new KeywordEntry() { displayName = "Spherical Harmonics L2", referenceName = "SPHERICAL_HARMONICS_L2" },
}
};

public static KeywordDescriptor SurfaceTypeTransparent = new KeywordDescriptor()
{
displayName = "Surface Type Transparent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ protected override void CollectPassKeywords(ref PassDescriptor pass)
{
pass.keywords.Add(CoreKeywordDescriptors.Shadow);
pass.keywords.Add(CoreKeywordDescriptors.ScreenSpaceShadow);
pass.keywords.Add(CoreKeywordDescriptors.ProbeVolumesEncoding);

if (pass.lightMode == HDShaderPassNames.s_TransparentBackfaceStr)
pass.defines.Add(CoreKeywordDescriptors.LightList, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ static void Drawer_SectionLightingSettings(SerializedFrameSettings serialized, E
// Probe Volumes
area.AmmendInfo(FrameSettingsField.ProbeVolume, overrideable: () => hdrpSettings.supportProbeVolume);
area.AmmendInfo(FrameSettingsField.NormalizeReflectionProbeWithProbeVolume, overrideable: () => hdrpSettings.supportProbeVolume);
area.AmmendInfo(FrameSettingsField.ProbeVolumeEncoding,
customGetter: () => (ProbeVolumesEncodingSetting)serialized.probeVolumeEncoding.intValue, // Levels 1-2
customSetter: v => serialized.probeVolumeEncoding.intValue = Math.Max(1, Math.Min((int)v, 2)), // Levels 1-2
hasMixedValues: serialized.probeVolumeEncoding.hasMultipleDifferentValues,
overrideable: () => hdrpSettings.supportProbeVolume
);
area.AmmendInfo(FrameSettingsField.ProbeVolumeDynamicGI, overrideable: () => hdrpSettings.supportProbeVolume && hdrpSettings.supportProbeVolumeDynamicGI);
area.AmmendInfo(FrameSettingsField.ProbeVolumeDynamicGIInfiniteBounces, overrideable: () => hdrpSettings.supportProbeVolume && hdrpSettings.supportProbeVolumeDynamicGI);
area.AmmendInfo(FrameSettingsField.ProbeVolumeDynamicGIPropagationQuality,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class SerializedFrameSettings
public SerializedProperty maximumLODLevel;
public SerializedProperty maximumLODLevelMode;
public SerializedProperty maximumLODLevelQualityLevel;
public SerializedProperty probeVolumeEncoding;
public SerializedProperty probeVolumeDynamicGIPropagationQuality;
public SerializedProperty probeVolumeDynamicGIMaxSimulationsPerFrame;
public SerializedProperty probeVolumeDynamicGIMixedLightMode;
Expand Down Expand Up @@ -104,6 +105,7 @@ public SerializedFrameSettings(SerializedProperty rootData, SerializedProperty r
maximumLODLevel = rootData.FindPropertyRelative("maximumLODLevel");
maximumLODLevelMode = rootData.FindPropertyRelative("maximumLODLevelMode");
maximumLODLevelQualityLevel = rootData.FindPropertyRelative("maximumLODLevelQualityLevel");
probeVolumeEncoding = rootData.FindPropertyRelative("probeVolumeEncoding");
probeVolumeDynamicGIPropagationQuality = rootData.FindPropertyRelative("probeVolumeDynamicGIPropagationQuality");
probeVolumeDynamicGIMaxSimulationsPerFrame = rootData.FindPropertyRelative("probeVolumeDynamicGIMaxSimulationsPerFrame");
probeVolumeDynamicGIMixedLightMode = rootData.FindPropertyRelative("probeVolumeDynamicGIMixedLightMode");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Pass
${VFXHDRPForwardDefines}
#pragma multi_compile USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST
#pragma multi_compile SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH
#pragma multi_compile PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1 PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2
#pragma multi_compile _ DEBUG_DISPLAY
//#pragma enable_d3d11_debug_symbols

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Pass
${VFXHDRPForwardDefines}
#pragma multi_compile USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST
#pragma multi_compile SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH
#pragma multi_compile PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1 PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2
#pragma multi_compile _ DEBUG_DISPLAY
//#pragma enable_d3d11_debug_symbols

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Shader "Hidden/HDRP/Deferred"
#pragma multi_compile SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON
#pragma multi_compile _ DEBUG_DISPLAY
#pragma multi_compile SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH
#pragma multi_compile PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1 PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2

#define USE_FPTL_LIGHTLIST // deferred opaque always use FPTL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#pragma multi_compile SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON

#pragma multi_compile SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH
#pragma multi_compile PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1 PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2

#ifdef DEBUG_DISPLAY
// Don't care about this warning in debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Shader "Hidden/HDRP/DeferredTile"
#pragma multi_compile _ SHADOWS_SHADOWMASK /// Variant with and without shadowmask
#pragma multi_compile_local VARIANT0 VARIANT1 VARIANT2 VARIANT3 VARIANT4 VARIANT5 VARIANT6 VARIANT7 VARIANT8 VARIANT9 VARIANT10 VARIANT11 VARIANT12 VARIANT13 VARIANT14 VARIANT15 VARIANT16 VARIANT17 VARIANT18 VARIANT19 VARIANT20 VARIANT21 VARIANT22 VARIANT23 VARIANT24 VARIANT25 VARIANT26 VARIANT27 VARIANT28
#pragma multi_compile SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH
#pragma multi_compile PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1 PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2

#define USE_INDIRECT // otherwise TileVariantToFeatureFlags() will not be defined in Lit.hlsl!!!

Expand Down Expand Up @@ -307,6 +308,7 @@ Shader "Hidden/HDRP/DeferredTile"
#pragma multi_compile _ SHADOWS_SHADOWMASK /// Variant with and without shadowmask
#pragma multi_compile SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON
#pragma multi_compile SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH
#pragma multi_compile PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1 PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2

#define USE_FPTL_LIGHTLIST 1 // deferred opaque always use FPTL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Shader "Hidden/ScriptableRenderPipeline/DebugDisplayProbeVolume"
#pragma target 4.5
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch

#pragma multi_compile PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1 PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#if SHADEROPTIONS_PROBE_VOLUMES_EVALUATION_MODE != PROBEVOLUMESEVALUATIONMODES_DISABLED
Expand Down Expand Up @@ -74,7 +76,21 @@ Shader "Hidden/ScriptableRenderPipeline/DebugDisplayProbeVolume"
// Convert to specific view section of atlas.
uvw = uvw * _TextureViewScale + _TextureViewBias;

#if SHADEROPTIONS_PROBE_VOLUMES_ENCODING_MODE == PROBEVOLUMESENCODINGMODES_SPHERICAL_HARMONICS_L1
#if defined(PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L0)
ProbeVolumeSphericalHarmonicsL0 coefficients;
ZERO_INITIALIZE(ProbeVolumeSphericalHarmonicsL0, coefficients);
ProbeVolumeSampleAccumulateSphericalHarmonicsL0(uvw, 1.0f, coefficients);
ProbeVolumeSwizzleAndNormalizeSphericalHarmonicsL0(coefficients);
float4 valueShAr = float4(0, 0, 0, saturate((coefficients.data[0].x - _ValidRange.x) * _ValidRange.y));
float4 valueShAg = float4(0, 0, 0, saturate((coefficients.data[0].y - _ValidRange.x) * _ValidRange.y));
float4 valueShAb = float4(0, 0, 0, saturate((coefficients.data[0].z - _ValidRange.x) * _ValidRange.y));

float4 valueShBr = 0.0f;
float4 valueShBg = 0.0f;
float4 valueShBb = 0.0f;
float4 valueShC = 0.0f;

#elif defined(PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1)
ProbeVolumeSphericalHarmonicsL1 coefficients;
ZERO_INITIALIZE(ProbeVolumeSphericalHarmonicsL1, coefficients);
ProbeVolumeSampleAccumulateSphericalHarmonicsL1(uvw, 1.0f, coefficients);
Expand All @@ -88,7 +104,7 @@ Shader "Hidden/ScriptableRenderPipeline/DebugDisplayProbeVolume"
float4 valueShBb = 0.0f;
float4 valueShC = 0.0f;

#elif SHADEROPTIONS_PROBE_VOLUMES_ENCODING_MODE == PROBEVOLUMESENCODINGMODES_SPHERICAL_HARMONICS_L2
#elif defined(PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2)
ProbeVolumeSphericalHarmonicsL2 coefficients;
ZERO_INITIALIZE(ProbeVolumeSphericalHarmonicsL2, coefficients);
ProbeVolumeSampleAccumulateSphericalHarmonicsL2(uvw, 1.0f, coefficients);
Expand All @@ -102,6 +118,8 @@ Shader "Hidden/ScriptableRenderPipeline/DebugDisplayProbeVolume"
float4 valueShBb = saturate((coefficients.data[5] - _ValidRange.x) * _ValidRange.y);
float4 valueShC = saturate((coefficients.data[6] - _ValidRange.x) * _ValidRange.y);

#else
#error "Unsupported Probe Volumes atlas encoding";
#endif

float valueValidity = saturate((ProbeVolumeSampleValidity(uvw) - _ValidRange.x) * _ValidRange.y);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#pragma multi_compile BASIS_SPHERICAL_GAUSSIAN BASIS_SPHERICAL_GAUSSIAN_WINDOWED BASIS_AMBIENT_DICE_SHARP BASIS_AMBIENT_DICE_SOFTER BASIS_AMBIENT_DICE_SUPER_SOFT BASIS_AMBIENT_DICE_ULTRA_SOFT
#pragma multi_compile BASIS_PROPAGATION_OVERRIDE_NONE BASIS_PROPAGATION_OVERRIDE_SPHERICAL_GAUSSIAN BASIS_PROPAGATION_OVERRIDE_AMBIENT_DICE_WRAPPED_SOFTER BASIS_PROPAGATION_OVERRIDE_AMBIENT_DICE_WRAPPED_SUPER_SOFT BASIS_PROPAGATION_OVERRIDE_AMBIENT_DICE_WRAPPED_ULTRA_SOFT
#pragma multi_compile _ RADIANCE_ENCODING_LOGLUV RADIANCE_ENCODING_HALFLUV RADIANCE_ENCODING_R11G11B10
#pragma multi_compile PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L1 PROBE_VOLUMES_ENCODING_SPHERICAL_HARMONICS_L2

#include "Packages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
Expand Down Expand Up @@ -163,31 +164,30 @@ SHIncomingIrradiance ProbeVolumeEvaluateIncomingIrradiance(float3 positionWS, ui
SHIncomingIrradiance shIncomingIrradiance;
ZERO_INITIALIZE(SHIncomingIrradiance, shIncomingIrradiance);
float weightHierarchy = 0.0;
SHOutgoingRadiosityWithProjectedConstantsPacked outgoingRadiosityProjectedConstantsPacked;
ZERO_INITIALIZE(SHOutgoingRadiosityWithProjectedConstantsPacked, outgoingRadiosityProjectedConstantsPacked);

#if PROBE_VOLUMES_SAMPLING_MODE == PROBEVOLUMESENCODINGMODES_SPHERICAL_HARMONICS_L0
// #error "Need to define implementation of ProbeVolumeEvaluateIncomingRadiance for PROBEVOLUMESENCODINGMODES_SPHERICAL_HARMONICS_L0"
// TODO:
// ProbeVolumeSphericalHarmonicsL0 coefficients;
// ProbeVolumeAccumulateSphericalHarmonicsL0(posInput, normalWS, normalWS, renderingLayers, coefficients, weightHierarchy);
// bakeDiffuseLighting += ProbeVolumeEvaluateSphericalHarmonicsL0(normalWS, coefficients);
ProbeVolumeSphericalHarmonicsL0 coefficients;
ProbeVolumeAccumulateDynamicGINeighborsSphericalHarmonicsL0(posInput, normalWSForBias, viewDirectionWSForBias, renderingLayers, coefficients, weightHierarchy);
outgoingRadiosityProjectedConstantsPacked.data[0] = coefficients.data[0];

#elif PROBE_VOLUMES_SAMPLING_MODE == PROBEVOLUMESENCODINGMODES_SPHERICAL_HARMONICS_L1
// #error "Need to define implementation of ProbeVolumeEvaluateIncomingRadiance for PROBEVOLUMESENCODINGMODES_SPHERICAL_HARMONICS_L1"
// TODO:
// ProbeVolumeSphericalHarmonicsL1 coefficients;
// ProbeVolumeAccumulateDynamicGINeighborsSphericalHarmonicsL1(posInput, normalWSForBias, viewDirectionWSForBias, renderingLayers, coefficients, weightHierarchy);
ProbeVolumeSphericalHarmonicsL1 coefficients;
ProbeVolumeAccumulateDynamicGINeighborsSphericalHarmonicsL1(posInput, normalWSForBias, viewDirectionWSForBias, renderingLayers, coefficients, weightHierarchy);
[unroll] for (int i = 0; i < 3; ++i) { outgoingRadiosityProjectedConstantsPacked.data[i] = coefficients.data[i]; }

#elif PROBE_VOLUMES_SAMPLING_MODE == PROBEVOLUMESENCODINGMODES_SPHERICAL_HARMONICS_L2
ProbeVolumeSphericalHarmonicsL2 coefficients;
ProbeVolumeAccumulateDynamicGINeighborsSphericalHarmonicsL2(posInput, normalWSForBias, viewDirectionWSForBias, renderingLayers, coefficients, weightHierarchy);
[unroll] for (int i = 0; i < 7; ++i) { outgoingRadiosityProjectedConstantsPacked.data[i] = coefficients.data[i]; }
#endif

float skyWeight = 1 - weightHierarchy;
SHOutgoingRadiosityWithProjectedConstantsPacked outgoingRadiosityProjectedConstantsPacked;
[unroll] for (int i = 0; i < SH_PACKED_COEFFICIENT_COUNT; ++i) { outgoingRadiosityProjectedConstantsPacked.data[i] = coefficients.data[i] + _AmbientProbe[i] * skyWeight; }
[unroll] for (int j = 0; j < SH_PACKED_COEFFICIENT_COUNT; ++j) { outgoingRadiosityProjectedConstantsPacked.data[j] += _AmbientProbe[j] * skyWeight; }
SHOutgoingRadiosityWithProjectedConstants outgoingRadiosityProjectedConstants = SHOutgoingRadiosityWithProjectedConstantsCompute(outgoingRadiosityProjectedConstantsPacked);
SHOutgoingRadiosity bakedOutgoingRadiosity = SHOutgoingRadiosityCompute(outgoingRadiosityProjectedConstants);
shIncomingIrradiance = SHIncomingIrradianceCompute(bakedOutgoingRadiosity);
#endif

return shIncomingIrradiance;
}
Expand Down

0 comments on commit 1bdf5e9

Please sign in to comment.