You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probe Volumes: Make all bake requests go through the AdditionalGIBakeRequestsManager. Track the generationIndex in the least significant 8 bits of the lightmapperBakeID, and talk to the lightmapper with this composite ID. This ensures that anytime we call SetAdditionalBakeProbes we generate a completely unique bake request from the perspective of the lightmapper, ensuring that we will always bake this data (because the lightmapper will hash these IDs to determine if it has any work to do). Previously, if we set an ID with new data, or if we cleared an ID then set it with new data, the lightmapper wouldnt track these data changes, and so it would skip baking these actually new bake requests. (#17)
// When baking, the lightmapper hashes its state (i.e: the list of all AdditionalBakedProbes requests)
69
+
// and only bakes data if this hash is not changed.
70
+
// By storing a generation ID inside of our lightmapperBakeID, we ensure that Sets will always look like a completely new bake request to the lightmapper.
71
+
// The lightmapper will always bake it.
72
+
// Without storing this generation index, if we clear our bake request by setting positions to NULL, then set our bake request with valid data,
73
+
// then bake, the lightmapper will treat the new bake request as an already completed old one, and skip doing any work.
74
+
// In the future, after proving out this generation based approach, it would be a good idea to move this generation tracking code into the lightmapper,
75
+
// so that users dont need to do this bookkeeping for the lightmapper - they can simply set and clear requests and always get the correct, fresh results.
// Leave the whole top bit free. We shouldn't encounter it in practice, avoiding it allows us to not worry about handling the signed case.
103
+
elseif(lightmapperBakeIDNext==((1<<23)-1))
69
104
{
70
105
success=false;
71
106
lightmapperBakeID=-1;
72
-
Debug.LogWarningFormat("Error: Used up all lightmapper bake IDs. This should never happen. Somehow all {0} ids have been used up. This must be the result of a bug. Unlikely that you created and baked {0} unique bake requests. Quit and reopen unity to flush all IDs.",s_BakingID-1);
107
+
Debug.LogWarningFormat("Error: Used up all lightmapper bake IDs. This should never happen. Somehow all {0} ids have been used up. This must be the result of a bug. Unlikely that you created and baked {0} unique bake requests. Quit and reopen unity to flush all IDs.",(1<<23)-1);
Debug.LogFormat("Failed to get data at id: {0}, with lightmapperBakeID {1}, with probe volume: {2}, and parent: {3}, companionGameObject: {4}",GetBakeID(),lightmapperBakeID,name,parentName,companionString);
1418
+
Debug.LogFormat("Failed to get data at id: {0}, with probe volume: {1}, and parent: {2}, companionGameObject: {3}",GetBakeID(),name,parentName,companionString);
0 commit comments