DNA: Move irradiance grid light cache data to Object level #106808

Merged
Clément Foucault merged 13 commits from fclem/blender:lightprobe-data into main 2023-04-17 17:12:31 +02:00
2 changed files with 12 additions and 1 deletions
Showing only changes of commit 1f47deb86c - Show all commits

View File

@ -187,6 +187,8 @@ static void lightprobe_grid_cache_frame_blend_read(BlendDataReader *reader,
cache->baking.L1_a = nullptr;
cache->baking.L1_b = nullptr;
cache->baking.L1_c = nullptr;
cache->surfels = nullptr;
cache->surfels_len = 0;
if (cache->irradiance.L0 != nullptr) {
BLO_read_float3_array(reader, sample_count, (float **)&cache->irradiance.L0);
@ -257,6 +259,7 @@ void BKE_lightprobe_grid_cache_frame_free(LightProbeGridCacheFrame *cache)
spherical_harmonic_free(cache->irradiance);
spherical_harmonic_free(cache->visibility);
MEM_SAFE_FREE(cache->connectivity.bitmask);
MEM_SAFE_FREE(cache->surfels);
MEM_SAFE_FREE(cache);
}

View File

@ -279,11 +279,19 @@ typedef struct LightProbeGridCacheFrame {
/** Sparse or adaptive layout only: specify the blocks positions. */
LightProbeBlockData *block_infos;
/** Baked data. */
/** In-progress baked data. Not stored in file. */
LightProbeBakingData baking;
/** Baked data. */
LightProbeIrradianceData irradiance;
LightProbeVisibilityData visibility;
LightProbeConnectivityData connectivity;
char _pad[4];
/** Number of debug surfels. */
int surfels_len;
/** Debug surfels used to visualize the baking process. Not stored in file. */
void *surfels;
} LightProbeGridCacheFrame;
/** #LightProbeGridCacheFrame.data_layout (int) */