Search Issue Tracker
Fixed in 2018.3
[HDPR] Null Reference Exception when using Particle System Lighting Module
SRP Repo: Issue #1650
When using Unity Particles with the light module enabled, it breaks the scene's lighting, stops the particle system and spam the following error :
"NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Experimental.Rendering.HDPipeline.LightLoop.PrepareLightsForGPU (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Experimental.Rendering.HDPipeline.HDCamera hdCamera, UnityEngine.Experimental.Rendering.ShadowSettings shadowSettings, CullResults cullResults, UnityEngine.Experimental.Rendering.HDPipeline.ReflectionProbeCullResults reflectionProbeCullResults, DensityVolumeList densityVolumes) (at C:/Users/Utilisateur/AppData/Local/Unityemail@example.com/HDRP/Lighting/LightLoop/LightLoop.cs:1494)
UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.Render (ScriptableRenderContext renderContext, UnityEngine.Camera cameras) (at C:/Users/Utilisateur/AppData/Local/Unityfirstname.lastname@example.org/HDRP/RenderPipeline/HDRenderPipeline.cs:930)
UnityEngine.Experimental.Rendering.RenderPipelineManager.DoRenderLoop_Internal (IRenderPipelineAsset pipe, UnityEngine.Camera cameras, IntPtr loopPtr) (at C:/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:32)
The message stops if I set all particle system's light module parameters to a value of 0 (which is the same as disabling it, it doesn't use the light).
The error both works in play and edit mode.
Packages used : HDRenderPipeline 2.0.4 preview
Project : empty project with the HDRP template used.
Create project with the HDRP Template
Update HDRP package to 2.0.4 in package manager
Create a new particle system
Create a new point light
Enable the Light module of the particle system
Set the ratio to a value like 1
Add the point light previously created to the particle system's light module
Watch the scene lighting die instantly and the console spamming errors
Unity version : 2018.2.0f2
PC Standalone on Windows 10
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Visual C# Compiler cannot find source files because it is looking at old file locations
- Ghost empty folders are left behind when after calling Refresh, Directory.Move is called
- [OSX] The Scene icon in the Unity Editor's title bar can be dragged and dropped out of the project
- [Metal][Editor] Memory grows continuously until Editor crashes when importing 100k materials
- Investigate why .meta files are sometimes not parsed right