Cant bake APV with sky occlusion

I get the following error when i try to bake adaptive light probes, specifically with sky occlusion enabled. it mentions ray traycing but i do not have ray tracing enabled anywhere.

I can bake adaptive probes with sky occlusion disabled, it only happens each time i try to bake with it enabled, and it happens within 2 seconds.

UnityEngine.Rendering.UnifiedRayTracing.ComputeRayTracingAccelStruct.AllocateBlas (UnityEngine.Mesh mesh, System.Int32 submeshIndex, UnityEngine.Rendering.UnifiedRayTracing.ComputeRayTracingAccelStruct+MeshBlas blas) (at ./Library/PackageCache/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Compute/ComputeRayTracingAccelStruct.cs:251)
UnityEngine.Rendering.UnifiedRayTracing.ComputeRayTracingAccelStruct.GetOrAllocateMeshBlas (UnityEngine.Mesh mesh, System.Int32 subMeshIndex) (at ./Library/PackageCache/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Compute/ComputeRayTracingAccelStruct.cs:190)
UnityEngine.Rendering.UnifiedRayTracing.ComputeRayTracingAccelStruct.AddInstance (UnityEngine.Rendering.UnifiedRayTracing.MeshInstanceDesc meshInstance) (at ./Library/PackageCache/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Compute/ComputeRayTracingAccelStruct.cs:78)
UnityEngine.Rendering.UnifiedRayTracing.AccelStructAdapter.AddInstance (UnityEngine.Rendering.UnifiedRayTracing.MeshInstanceDesc instanceDesc, System.UInt32 materialID, System.UInt32 renderingLayerMask) (at ./Library/PackageCache/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs:170)`
UnityEngine.Rendering.UnifiedRayTracing.AccelStructAdapter.AddHeightmap (UnityEngine.Rendering.UnifiedRayTracing.TerrainDesc terrainDesc, System.Collections.Generic.List`1[UnityEngine.Rendering.UnifiedRayTracing.AccelStructAdapter+InstanceIDs]& instanceHandles) (at ./Library/PackageCache/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs:122)
UnityEngine.Rendering.UnifiedRayTracing.AccelStructAdapter.AddInstance (System.Int32 objectHandle, UnityEngine.Rendering.UnifiedRayTracing.TerrainDesc terrainDesc) (at ./Library/PackageCache/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs:106)
UnityEngine.Rendering.UnifiedRayTracing.AccelStructAdapter.AddInstance (System.Int32 objectHandle, UnityEngine.Component meshRendererOrTerrain, System.Span`1[T] perSubMeshMask, System.Span`1[T] perSubMeshMaterialIDs, System.UInt32 renderingLayerMask) (at ./Library/PackageCache/com.unity.rendering.light-transport/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs:69)
UnityEngine.Rendering.AdaptiveProbeVolumes+DefaultVirtualOffset.BuildAccelerationStructure (System.Int32 mask) (at ./Library/PackageCache/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs:156)
UnityEngine.Rendering.AdaptiveProbeVolumes+DefaultVirtualOffset.Initialize (UnityEngine.Rendering.ProbeVolumeBakingSet bakingSet, Unity.Collections.NativeArray`1[T] probePositions) (at ./Library/PackageCache/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs:115)
UnityEngine.Rendering.AdaptiveProbeVolumes+BakeData.Init (UnityEngine.Rendering.ProbeVolumeBakingSet bakingSet, Unity.Collections.NativeList`1[T] probePositions, System.Collections.Generic.List`1[T] requests) (at ./Library/PackageCache/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs:472)
UnityEngine.Rendering.AdaptiveProbeVolumes.PrepareBaking () (at ./Library/PackageCache/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs:929)
UnityEngine.Rendering.AdaptiveProbeVolumes.BakeAsync () (at ./Library/PackageCache/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs:1445)
UnityEngine.Rendering.ProbeVolumeLightingTab.<OnBakeButtonGUI>g__BakeButtonCallback|32_0 (System.Object data) (at ./Library/PackageCache/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeLightingTab.cs:312)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at <43e76eb92538417eb982ad34fee8a720>:0) ```

but i do not have ray tracing enabled anywhere.

Probe volumes use raytracing during baking. It’s not something you turn on or off - it’s just how the baking step works.

I think you’ve cut off some of the error. This just looks like a callstack, but the actual error message is missing. It should be just above the callstack. Could you post it?

It looks like you have a terrain (or maybe several) in your scene. Is that right? If so, try disabling and rebaking - does the issue still occur? And what kind of scene is this in general?

If this is blocking you, you should submit a bug report. Hard to troubleshoot much more than this without access to the scene.

1 Like

I have 1 terrain, and i tried turning it off like you said, and lo and behold it does bake with the occlusion now…as for what scene it is, its a open world desert terrain that is sand texture and 3 small cliff objects for testing, theres almost nothing really going on in it.

however its converted to a microsplat terrain if that matters at all.


it succeeded the bake before i even finished typing this.

turning the terrain back on brings me with the same error again.

As for the error being cut off. that is strange, its all im getting when i copy it.

Im hoping its just a particular setting on my terrain that i messed up?

Also I’m confused about the documentation for the sky occlusion, is there even a point in using it if I’m not going to set the sky to gradient and then alter the sky gradient in code?

I’m using the light scenarios at the moment for morning,
day, evening, night, with a day/night cycle (sun and moon) directional lights set to realtime. And I blend into the relevant scenarios based on the moon and sun position.

And the documentation makes it sound like sky occlusion is an “alternate” way to do a night cycle instead of scenarios.

It looks like your terrain might be hitting the triangle count limit - it is derived from the heightmap resolution. Unity currently has a somewhat arbitrary global restriction of 2gb GPU allocations. We are working towards removing it, and towards better handling of large triangle counts. Unfortunately for the time being, the only advice I can really give you is to lower the triangle count (resolution).

1 Like

Thanks, I guess I will keep everything at 2k :slight_smile:

something worse has been happening though, the past few days i can no longer select my light scenarios, they have completely broken down, not sure if its fixable or if my whole project is just broken at this point but it persists in a new scene.

So i cant bake anymore either.

Hmm. That’s not good - what does the UI look like, could you post a screenshot?

1 Like

Thanks for your time…


I added both a screenshot and a video so you can see how its not responding to clicks whatsoever.

This happened both before I cleared the lighting cache and data and after.

It comes and goes at random on a daily basis.

ontop of that, whenever i DO manage to bake i get this weird checkered discolored boxes across my terrain:

most of these issues popped up once i changed my terrain to 1000x1000, it was working pretty much fine on 10000 10000 which is even larger so im surprised im having more issues on a smaller terrain, i tried a fresh standard empty terrain in a new scene even and it didnt help.

I tried deleting library folder and clearing the gi cache and also manually the empty folders inside there.


these are my light settings.

if i try probe spacing 5 or 1, i get errors somtimes immediatly like this for example:

Render Graph execution error at pass 'After Post-Process Objects' (103)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

InvalidOperationException: Trying to use a texture (SSSBuffer) that was already released or not yet created. Make sure you declare it for reading in your pass or you don't read it before it's been written to at least once.
UnityEngine.Rendering.RenderGraphModule.RenderGraphResourceRegistry.CheckTextureResource (UnityEngine.Rendering.RenderGraphModule.TextureResource texResource) (at ./Library/PackageCache/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs:177)
UnityEngine.Rendering.RenderGraphModule.RenderGraphResourceRegistry.GetTexture (UnityEngine.Rendering.RenderGraphModule.TextureHandle& handle) (at ./Library/PackageCache/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs:185)
UnityEngine.Rendering.RenderGraphModule.RenderGraph.PreRenderPassSetRenderTargets (UnityEngine.Rendering.RenderGraphModule.RenderGraph+CompiledPassInfo& passInfo, UnityEngine.Rendering.RenderGraphModule.RenderGraphPass pass, UnityEngine.Rendering.RenderGraphModule.InternalRenderGraphContext rgContext) (at ./Library/PackageCache/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs:2186)
UnityEngine.Rendering.RenderGraphModule.RenderGraph.PreRenderPassExecute (UnityEngine.Rendering.RenderGraphModule.RenderGraph+CompiledPassInfo& passInfo, UnityEngine.Rendering.RenderGraphModule.RenderGraphPass pass, UnityEngine.Rendering.RenderGraphModule.InternalRenderGraphContext rgContext) (at ./Library/PackageCache/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs:2224)
UnityEngine.Rendering.RenderGraphModule.RenderGraph.ExecuteCompiledPass (UnityEngine.Rendering.RenderGraphModule.RenderGraph+CompiledPassInfo& passInfo) (at ./Library/PackageCache/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs:2119)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Render Graph Execution error
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)


UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

in which case it will say its baking but stay stuck at 0%.

but if i set probe spacing to like 10 its pretty much instant to 99% and then 3 mins or so after it succeeds:


however i get the weird checkered artifacts on the terrain.

another bake that technically makes it through but still checkered all over:

and if i just go as low as 1 probe i get this error every time at like 50% or higher and then seems to remain at that point forever:

which points to this file:
image

so apart from the UI breaking for my APV’s I’m also hoping you have some advice on recommended settings i can try in the lighting and apv window and hopefully a solution to fixing the checker issue… :pray:

Hi pema do you have any ideas at all? :pray:

Hey, sorry I didn’t respond, I’m quite busy this week.

It sounds like you’ve run into a triple whammy of bugs here.

The issue with not being able to select scenarios very clearly looks like a bug. I don’t think I’ll be able to give you any useful advice without access to the project or at least the assets. Please submit a bug report via the in-engine reporter.

The same goes for the issue with bakes not finishing / not being able to start.

As for the checkered pattern: I’m not sure what you are seeing here. Does it still happen if you disable sky occlusion? Also, try bumping the geometry bias and/or search distance under virtual offset. Almost looks like a kind of shadow acne.

I would try investigating the pattern using the debug visualization options in the Rendering Debugger. You can check if the probes above and under the plane look reasonable, and there is a mode where you select a pixel, and can then see which probes are sampled for that pixel and with which weights. It can be quite useful for figuring out issues like this.

I learnt from you in another thread that in my certain use case sky occlusion isn’t necessary so simply disabling it means I don’t have to deal with the checkered terrain issue anymore :smiling_face: