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/Unityfirstname.lastname@example.org/HDRP/Lighting/LightLoop/LightLoop.cs:1494)
UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.Render (ScriptableRenderContext renderContext, UnityEngine.Camera cameras) (at C:/Users/Utilisateur/AppData/Local/Unityemail@example.com/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.
- 'Can't add script' pop-up warns about abstract classes when dragging static classes onto GameObjects
- [Hub] Project "Remove from list" option is behind notifications when selecting the most bottom project in the list
- [Android][Vulkan] Black Screen renders on devices with Adreno 640 and Mali GPU's
- Sound/Audio is played when the VideoPlayer's attached AudioSource game object is disabled
- Editor crashes on GenerateSharedVerticesIndexList when importing .3ds file