Skip to content

Commit 6778be0

Browse files
FrancescoC-unityanisunityJulienIgnace-Unityadrien-de-tocquevilleAntoine Lelievre
committed
Avoid errors if user define null params in volume component (#2320)
* Null guard and warning * Changelog * Fixing exceptions in the console when putting the SSGI in low quality mode (render graph). (#2323) * Add VT frame settings (#2286) * Add frame setting * changelog * Grey setting out and make it always available. * Reverts tuff meant for antoher branch Co-authored-by: JulienIgnace-Unity <[email protected]> * Fix undo/redo compositor (#2300) * Rename function * Undoable "enable compositor" * Undo/Redo Enable/Disable compositor Co-authored-by: JulienIgnace-Unity <[email protected]> * Restored purge of unused resources in render graph (#2306) * Improve punctual shadow resolution rescale algorithm (#2309) * Improved the punctual shadow algorithm (it's less agressive now) * Updated changelog * Remove unused references of the HDRP asset in decal code (#2326) * Remove perChannelMask * changelog * Fix diffusion profile dependency (#2327) * Fixed a nullref when a diffusion profile was created * Updated changelog * Trying to fix diffusion profile asset dependency * Fixed export as package * Updated changelog Co-authored-by: JulienIgnace-Unity <[email protected]> * Standardize naming for Transparent receive SSR (#2329) * Renaming * Changelog * Fix typos * Revert "Standardize naming for Transparent receive SSR (#2329)" This reverts commit 58152f0. # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md * Improvements to the DXR Wizard (#2295) * - Now the DXR wizard displays the name of the target asset that needs to be changed. - The DXR wizard displays asset changes as warnings and default frame settings as infos. - Added the status check of default camera frame settings in the DXR wizard. * review corrections Co-authored-by: JulienIgnace-Unity <[email protected]> * Expose HDRP shader tag IDs and per object config (#2292) * Expose shader pass names API * Updated changelog * exposed per object data in HDUtils * changed constants to accessors * Moved getters to static Co-authored-by: JulienIgnace-Unity <[email protected]> * - Updated the documentation about shadow matte and SSShadow and RTShadows. (#2339) * - Updated the documentation about shadow matte and SSShadow and RTShadows. * Update CHANGELOG.md Co-authored-by: sebastienlagarde <[email protected]> * Fixed warnings when new input system is enabled (#2274) * Fix nan when decal affect normals (#2319) * Use SafeNormalize * Update CHANGELOG.md Co-authored-by: JulienIgnace-Unity <[email protected]> * Fix bleeding of a view into another caused by TAA (#2317) * Make sure we clamp correctly when sampling in TAA * Changelog * More safe fix. Co-authored-by: JulienIgnace-Unity <[email protected]> * Reset RT Handle size every now and then in editor if set to a big resolution and then reverted back (#2322) * Reset every now and then * Changelog * Bump min to 1440 * Update CHANGELOG.md Fixed changelog * Avoid reset if we still need the high res Co-authored-by: JulienIgnace-Unity <[email protected]> * Hdrp/standardize transparent receive ssr (#2338) * Renaming * Changelog * Fix typos * Update HDWizard.Window.cs typo * Update HDWizard.Window.cs typo 2 Co-authored-by: FrancescoC-Unity <[email protected]> * Added default volume profile asset change to the undo stack (case 1285268). (#2330) * Added default volume profile asset change to the undo stack. * Updated changelog. * ... * ... Co-authored-by: JulienIgnace-Unity <[email protected]> * Restored default directional light intensity constant (#2345) * Fixed changelog * More changelog fix * Remove useless menu entry (#2335) * Fixed the ray tracing shadow UI being displayed while it shouldn't (case 1286391). (#2341) Co-authored-by: sebastienlagarde <[email protected]> * Add fade distance for light impact on volumetrics (#2291) * Fade * changelog * Don't display on directional Co-authored-by: sebastienlagarde <[email protected]> * Fix bit in FrameSettings * Update sample cubemap image * Revert "Update sample cubemap image" This reverts commit 32ba2a8. * revert: Improve punctual shadow resolution rescale algorithm (#2309) * Update TestCaseFilters.asset * Merge branch 'master' into hd/bugfix * Update SG_DS_Flipped.mat * update settings * Update CHANGELOG.md * remove test case filter in runtime test * migrate correctly to enable virtual texturing. * revert some change one in Hdrp/standardize transparent receive ssr #2338 * Fix breaking change in CoreEditorUtils.cs * Revert "remove test case filter in runtime test" This reverts commit ce8389b. * Revert "Restored purge of unused resources in render graph (#2306)" This reverts commit bc54701. * Update documentation * Revert: Fix nan when decal affect normals (#2319) * Update CoreEditorUtils.cs Co-authored-by: anisunity <[email protected]> Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Adrien de Tocqueville <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> Co-authored-by: sebastienlagarde <[email protected]> Co-authored-by: Emmanuel Turquin <[email protected]>
1 parent a113c7f commit 6778be0

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ protected virtual void OnEnable()
9696
.AsReadOnly();
9797

9898
foreach (var parameter in parameters)
99-
parameter.OnEnable();
99+
{
100+
if(parameter != null)
101+
parameter.OnEnable();
102+
else
103+
Debug.LogWarning("Volume Component " + GetType().Name + " contains a null parameter; please make sure all parameters are initialized to a default value. Until this is fixed the null parameters will not be considered by the system.");
104+
}
100105
}
101106

102107
/// <summary>
@@ -108,7 +113,10 @@ protected virtual void OnDisable()
108113
return;
109114

110115
foreach (var parameter in parameters)
111-
parameter.OnDisable();
116+
{
117+
if (parameter != null)
118+
parameter.OnDisable();
119+
}
112120
}
113121
/// <summary>
114122
/// Interpolates a <see cref="VolumeComponent"/> with this component by an interpolation
@@ -222,7 +230,10 @@ public override int GetHashCode()
222230
public void Release()
223231
{
224232
for (int i = 0; i < parameters.Count; i++)
225-
parameters[i].Release();
233+
{
234+
if(parameters[i] != null)
235+
parameters[i].Release();
236+
}
226237
}
227238
}
228239
}

com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ void ReplaceData(VolumeStack stack, List<VolumeComponent> components)
227227

228228
for (int i = 0; i < count; i++)
229229
{
230-
target.parameters[i].overrideState = false;
231-
target.parameters[i].SetValue(component.parameters[i]);
230+
if(target.parameters[i] != null)
231+
{
232+
target.parameters[i].overrideState = false;
233+
target.parameters[i].SetValue(component.parameters[i]);
234+
}
232235
}
233236
}
234237
}

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Changelog
1+
# Changelog
22
All notable changes to this package will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
@@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4343
- Fixed the ray tracing shadow UI being displayed while it shouldn't (case 1286391).
4444
- Fixed issues with physically-based DoF, improved speed and robustness
4545
- Fixed a warning happening when putting the range of lights to 0.
46+
- Fixed issue when null parameters in a volume component would spam null reference errors. Produce a warning instead.
4647

4748
### Changed
4849
- Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass.

0 commit comments

Comments
 (0)