Steps to reproduce:
- Create a new 3D (URP) project
- In Edit > Project Settings > Quality > current URP asset, make sure Light Probe System is set to Adaptive Probe Volumes
- Create a Cube (GameObject > 3D Object > Cube), and with the Cube selected press Add Component and add a Visual Effect component
- With the Cube selected, enable the Static checkbox in the top right of the Inspector (Contribute GI on)
- Make sure the scene has an Adaptive Probe Volume (GameObject > Light > Adaptive Probe Volume)
- Select Generate Lighting in the Lighting window
- Observe the Console window
Actual results: "InvalidCastException: Specified cast is not valid." is thrown when Generate Lighting starts, from the Virtual Offset acceleration structure build:
at AccelStructAdapter.AddInstance (Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs:136)
at AdaptiveProbeVolumes+DefaultVirtualOffset.BuildAccelerationStructure (Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs:155)
at DefaultVirtualOffset.Initialize, BakeData.InitVirtualOffsetJob, Lightmapping+VirtualOffsetBake.InitializeData
Virtual Offset is enabled by default on the APV baking set, so a default APV bake hits this with no extra settings.
With Sky Occlusion additionally enabled (Lighting window, Adaptive Probe Volumes tab), the same cast also throws from the Sky Occlusion path:
at AccelStructAdapter.AddInstance
at AdaptiveProbeVolumes+DefaultSkyOcclusion.BuildAccelerationStructure (Editor/Lighting/ProbeVolume/ProbeGIBaking.SkyOcclusion.cs:227)
The bake continues but the affected acceleration structure build is interrupted by the exception.
Expected results: No exception - renderer types that are not MeshRenderer are skipped (or supported) when building the bake acceleration structures (Virtual Offset and Sky Occlusion), the same way SkinnedMeshRenderer is already skipped.
Reproducible with versions: 6000.0.7f1, 6000.0.83f1, 6000.3.23f1, 6000.5.11f1, 6000.6.0f1, 6000.7.0a6
Not reproducible with versions: 6000.0.6f1
Tested on (OS): Windows 11