This is the first step for refactoring the lightcache system. Each probe instance (as in `Object`) will now store its own baked data. The data is currently stored in uncompressed readable format. This introduces two new operators for baking to avoid confusion with the previous light baking pipeline. These do nothing other than creating empty caches that will be populated by EEVEE later on. The DNA storage is made to be able to include multiple caches in case of baked simulation over time but it isn't yet supported. I prefer to keep the implementation simple for now as the long term goals for this feature are uncertain. There is still a type flag (`LightProbeObjectCache.cache_type`) that will be used for versioning. The naming convention of structs is a bit weird but that's all I found in order to avoid interfering with the old scene light cache that is still used by (old) EEVEE. Related task #106449. Pull Request: https://projects.blender.org/blender/blender/pulls/106808
62 lines
1.6 KiB
C
62 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright Blender Foundation */
|
|
|
|
#pragma once
|
|
|
|
/** \file
|
|
* \ingroup bke
|
|
* \brief General operations for probes.
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct LightProbe;
|
|
struct Main;
|
|
struct BlendWriter;
|
|
struct BlendDataReader;
|
|
struct LightProbeObjectCache;
|
|
struct LightProbeGridCacheFrame;
|
|
struct Object;
|
|
|
|
void BKE_lightprobe_type_set(struct LightProbe *probe, short lightprobe_type);
|
|
void *BKE_lightprobe_add(struct Main *bmain, const char *name);
|
|
|
|
void BKE_lightprobe_cache_blend_write(struct BlendWriter *writer,
|
|
struct LightProbeObjectCache *cache);
|
|
|
|
void BKE_lightprobe_cache_blend_read(struct BlendDataReader *reader,
|
|
struct LightProbeObjectCache *cache);
|
|
|
|
/**
|
|
* Create a single empty irradiance grid cache.
|
|
*/
|
|
struct LightProbeGridCacheFrame *BKE_lightprobe_grid_cache_frame_create(void);
|
|
|
|
/**
|
|
* Free a single grid cache.
|
|
*/
|
|
void BKE_lightprobe_grid_cache_frame_free(struct LightProbeGridCacheFrame *cache);
|
|
|
|
/**
|
|
* Create the grid cache list depending on the lightprobe baking settings.
|
|
* The list is left empty to be filled by the baking process.
|
|
*/
|
|
void BKE_lightprobe_cache_create(struct Object *object);
|
|
|
|
/**
|
|
* Free all irradiance grids allocated for the given object.
|
|
*/
|
|
void BKE_lightprobe_cache_free(struct Object *object);
|
|
|
|
/**
|
|
* Return the number of sample stored inside an irradiance cache.
|
|
* This depends on the light cache type.
|
|
*/
|
|
int64_t BKE_lightprobe_grid_cache_frame_sample_count(const struct LightProbeGridCacheFrame *cache);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|