Adaptive Probe Volumes (APVs) experimental release for HDRP in 2021.2

it doesn’t, especially if theres duplicates. had duplicates multiple times after upgrading unity version, I assume the duplicate would appear after baking again. there was something with the object not referencing probevolume component, and it would fail, delete the gameobject makes baking recreate it properly.

A feature request.
Can the name of the scene be included in the following error message when building?

“Missing APV data asset . Please make sure that the lighting has been baked properly.”

to

“Missing APV data asset in “Name of scene”. Please make sure that the lighting has been baked properly.”

This becomes an issue when you have a lot of scenes.

1 Like

I’m not sure if this is a mistake on my part, but lights marked to only have baked shadows are still factored in the shadow map after baking APV.

Hello everyone. Adrien will no longer be monitoring this thread. I and my colleagues will do our best to address issues and gather feedback :slight_smile:

Noted, I’ll put investigating this on our todo.

There were some recent fixes to sky occlusion in 6000.0.11f1. Maybe try it out once the version is public. What kind of changes did you have to make?

Which rendering backend are you using for Android & Quest? There were some recent issues with APV on OpenGL, so if you are using that, maybe try Vulkan instead.

You should not need to call this. This is for legacy/tetrahedral probes. They have nothing to do with APV.

Noted.

I don’t think what you are asking is possible currently, but I don’t see why it shouldn’t be possible in principle with the architecture of APV, though probably with a performance cost when toggling parts of a scenario. I’ll note it as a desired usecase.

The APV implementation exists entirely in C# - the bulk of it is in the SRP Core package, and the rest is in the URP and HDRP packages. The system is fully hackable, in that sense. There are also a few public API’s provided already for hooking into parts of the system, such as baking, but they might change a bit in the future.

Noted. Sounds like a pretty easy repro if you just need to duplicate a scene.

This is the generic error you get when a compute shader kernel fails to compile, so hard to say what is going wrong just based on this. Could you locate the compute shader asset “ProbeVolumeSubdivide.compute” in the project browser, click on, and see if the inspector shows any compilation errors? Also, btw, which graphics backend are you using?

Noted. I think I have an idea of what is going wrong here.

Good idea :slight_smile:

How are you baking, via the inspector of the probe volume? If so, try baking with the lighting window instead (Window > Rendering > Lighting > Generate Lighting). There is a hidden piece of state on each light which tells it whether to act as a realtime light or not, it might not be getting set correctly. The idea is that baked lights act as realtime until they actually have baked data, for easier authoring.

1 Like

Using lighting override mask, crashes unity. had to make such modification. the cached sky context doesn’t exist at id 1.

9935265--1438152--upload_2024-7-11_17-24-37.png

And uh in 0.10 sky occlusion bakes succesfully, but doesn’t apply to scene. will wait for 11

Also with baking scenes individually in 10f it does that without crashing or errors and some 3-4 scenes successfully bake individually, but once you go on with more scenes, previous scene bakes get wiped. baking set size in lighting window drops to lower MB and only last 3 or 4 or so scenes stay baked. I would assume there is a limit to the size of baking set in MB’s (which is not mentioned anywhere) or it’s a bug. havent tested on 11f yet, but I assume nothing is changed since it’s not mentioned in changelog.

The latest APV improvements like quality sampling and layers look great!

I’m using 6000.0.11f1 and I have a couple of issues:

  1. I must be missing something about sky occlusion - I can bake the scene with it enabled (along with sky direction), but rotating my sun light does not change the indirect lighting at all in the editor. Is there something specific I need to do to hook this up? The docs only mention setting Ambient Mode to Dynamic which I have done. [Edit: Oh, I think sky occlusion is only for color and intensity.]
  2. Baking APVs seems to hang the editor completely on Mac (Metal/M3) and I cannot get it to bake. This has been the case for many versions, I can only seem to do it on Windows. In a previous build, maybe 2023.1 or something, it worked on Mac (and was in fact faster to bake on there than on my 4090 somehow).
  3. Is there a runtime cost to having many probe volumes? I am currently automatically generating them around my navmesh so that I have denser probes near gameplay areas, but this results in a lot of probe volumes. Will this impact runtime performance or is it all baked away?

Thanks!

Please, make tutorial how to use APV in Unity6 for exterior and interior.

4 Likes

@Avol I did a bit of testing with multiple scenes, unloading and reloading some of them, and baking in between each load/unload. I couldn’t reproduce this. Could you give a bit more detail on how you are going about baking individual scenes in a set? There’s no limit on baking set size to my knowledge, so I doubt that’s the issue.

@valarnur We released a new blog post Unity 6's New Global Illumination Lighting Features with some tidbits about rendering layers and leak reduction. Might be worth looking at. We are currently working on some tutorial resources and a sample project to go with them. Can’t comment on when they will be released, though.

@wilgieseler

  1. Not too sure about the limitations of sky occlusion. I’ll follow up with a colleague.
  2. There were some architectural changes to baking of APV in recent versions. If you are getting freezes or crashes during bakes recently, the best you can do is to file a bug report. Btw, are you unable to bake any scene, or just not able to bake some specific ones?
  3. VRAM usage will scale with the amount of probes. This often won’t directly affect frame times, but VRAM is a limited resource, and if you run out, you’ll face issues. Additionally, if you are using streaming, there is a cost associated with loading chunks of probe data at runtime. Once the data has been loaded, though, there shouldn’t be any additional performance cost to adding more probes.
1 Like

Is that the higher resolution for the lightmaps? i’m asking because:
1 - i have not tried APV myself i don’t even have unity 6 (maybe i should try it)
2 - i’ve seen the same effect on your tests…
The sahdows looks very blurry on areas where needs to be sharper because right now it looks like objects are floating, which is a very common problem when the shadows are unaccurate or low resolution lightmap.

Here:

Edit: It should be something like this:

APV is a 3D grid of light probes, placed with large interval (0.5m in my case, this parameter is adjustable), so lightmap equivalent will be 0.5m per lightmap pixel. This is nowhere near enough for realistic shadows, but for medium quality games it’s better overall than lightmaps because of many other benefits (unified objects look thanks to 3D grid of light probes (Unity lightmapper simply can’t light clean modular architecture), faster baking in many cases, lower memory consumption, no UVs needed and so on).

I made an editor script that goes over 60 or so scenes. I have baking scenes, which only have APV component and separate geometry scenes, maybe the problem lies there? I have separate bake scenes because I don’t want to use scene.loadasync and use DOTS streamable scenes instead, which to I convert with a script to subscenes later. It basically does this:

OpenScenesAround(x, y, true);

Scene scene = EditorSceneManager.OpenScene(bakeScene.path, OpenSceneMode.Additive);

for (int i = 0; i < ProbeVolumeBakingSet.sceneGUIDs.Count; i++)
{
				if (ProbeVolumeBakingSet.sceneGUIDs[i] == AssetDatabase.AssetPathToGUID(bakeScene.path))
				{
					ProbeVolumeBakingSet.SetSceneBaking(ProbeVolumeBakingSet.sceneGUIDs[i], true);
					foundBakingScene = true;
				}
				else
				{
					ProbeVolumeBakingSet.SetSceneBaking(ProbeVolumeBakingSet.sceneGUIDs[i], false);
				}
}

 AdaptiveProbeVolumes.BakeAsync();
EditorSceneManager.SaveScene(all scenes);

Some get baked, after reaching some amount it clears all bakes. And starts bake fresh from some 5th scene or so at random, I assume that number is when it reaches some size of baking set, maybe not.

It happens also when I do it all manually, and it was happening after 1 scene before 10f update. now it happens after more scenes on 10f+ version. So I don’t think I did something wrong in my code. I’m not really sure how to share the project, since it 300gb in size. But I think the only way to test it would be on a huge project. My baking set size never reaches 1gb+ in size since it gets cleared on next scene bakes, I think the maximum it reached was something around 700mb and that approx 5 scenes of mine.
I’ve also tried many variations like having all bake scenes open, only 1 scene open etc, only marking one to bake. And I always use the bake probe volumes button only, not generate lighting, so It should not clear the bake.

I see… i’m trying APV right now, this is maybe my 3rd try in my life :slight_smile: i have a little question, when you said

What do you mean? where is that option? Are you talking about “Light probe sampler multiplier” which is in: Lighting > Scene > Lightmapping settings, just below Enviroment Samples?
sdsd

Yeah, this one.

Having 100 000x the samples for each probes seems completely wrong to me. Probes are indeed floating around and not a surface for the rays to bounce on, but I can’t see any reason why we could see a difference between 20x and 50x, let along 100 000x. Can you provide some screenshot to see how things compare in your situation and parameters?

Here some from couple of weeks ago:
Adaptive Probe Volumes (APVs) experimental release for HDRP in 2021.2 - #971 by Lex4art

Is there a big difference in baking times if you have a lot of samples? I thought this didn’t make any difference for APV

Are these settings meant for APV at all? If yes, it is absolutely not clear for me from the GUI. as it’s
a) being labeled for light probes, not APV, and
b) it’s not available if I switch Baked Global Illumination off

It’s also not clear what the best way is to use ONLY APV. Would I choose “Baked GI” on and use “Baked Indirect”?

Totally agree, all settings that affect APV should also be inside the Adaptive Probe Volumes tab and not the “Lightmapping settings” in the Scene tab even if some inputs are shared between the two (better to separate them anyway).

Yep, it can take hours to bake one scene with medium-sized house when 50K samples fired for each probe…