54 .id_code = LightProbe::id_type,
60 .name_plural =
N_(
"lightprobes"),
63 .asset_type_info =
nullptr,
68 .make_local =
nullptr,
70 .foreach_cache =
nullptr,
71 .foreach_path =
nullptr,
72 .foreach_working_space_color =
nullptr,
73 .foreach_asset_weak_reference =
nullptr,
74 .owner_pointer_get =
nullptr,
77 .blend_read_data =
nullptr,
78 .blend_read_after_liblink =
nullptr,
80 .blend_read_undo_preserve =
nullptr,
82 .lib_override_apply_post =
nullptr,
87 probe->type = lightprobe_type;
89 switch (probe->type) {
91 probe->distinf = 0.3f;
92 probe->falloff = 1.0f;
93 probe->clipsta = 0.01f;
96 probe->distinf = 0.1f;
97 probe->falloff = 0.5f;
98 probe->clipsta = 0.001f;
166 reader,
reinterpret_cast<float **
>(&cache->
irradiance.
L1_a), sample_count, 3);
168 reader,
reinterpret_cast<float **
>(&cache->
irradiance.
L1_b), sample_count, 3);
170 reader,
reinterpret_cast<float **
>(&cache->
irradiance.
L1_c), sample_count, 3);
202 MEM_SAFE_DELETE(
data.L0);
203 MEM_SAFE_DELETE(
data.L1_a);
204 MEM_SAFE_DELETE(
data.L1_b);
205 MEM_SAFE_DELETE(
data.L1_c);
210 dst.L0 = MEM_dupalloc(src.L0);
211 dst.L1_a = MEM_dupalloc(src.L1_a);
212 dst.L1_b = MEM_dupalloc(src.L1_b);
213 dst.L1_c = MEM_dupalloc(src.L1_c);
248 MEM_SAFE_DELETE_VOID(cache->
surfels);
251 MEM_SAFE_DELETE(cache);
258 object->lightprobe_cache = MEM_new<LightProbeObjectCache>(
"LightProbeObjectCache");
276 if (
object->lightprobe_cache ==
nullptr) {
282 if (cache->
shared ==
false) {
288 MEM_SAFE_DELETE(
object->lightprobe_cache);
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
General operations for probes.
#define BLO_read_struct(reader, struct_name, ptr_p)
#define BLT_I18NCONTEXT_ID_LIGHTPROBE
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
bool MEM_size_safe_multiply(size_t a, size_t b, size_t *result)
#define INIT_DEFAULT_STRUCT_AFTER(struct_dst, member)
#define BLI_assert_msg(a, msg)
static void lightprobe_grid_cache_frame_blend_read(BlendDataReader *reader, LightProbeGridCacheFrame *cache)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
struct LightProbeGridCacheFrame * BKE_lightprobe_grid_cache_frame_create()
static void lightprobe_foreach_id(ID *id, LibraryForeachIDData *data)
@ LIGHTPROBE_SHAPE_ELLIPSOID
static void spherical_harmonic_free(T &data)
static void lightprobe_init_data(ID *id)
void BKE_id_blend_write(BlendWriter *writer, ID *id)
static void spherical_harmonic_copy(T &dst, T &src)
void BKE_lightprobe_cache_blend_read(struct BlendDataReader *reader, struct LightProbeObjectCache *cache)
static void lightprobe_grid_cache_frame_blend_write(BlendWriter *writer, const LightProbeGridCacheFrame *cache)
void BKE_lightprobe_type_set(struct LightProbe *probe, eLightProbeType lightprobe_type)
LightProbeGridCacheFrame * BKE_lightprobe_grid_cache_frame_copy(LightProbeGridCacheFrame *src)
BMesh const char void * data
static void lightprobe_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_lightprobe_cache_blend_write(struct BlendWriter *writer, struct LightProbeObjectCache *cache)
struct LightProbe * BKE_lightprobe_add(struct Main *bmain, const char *name)
void BKE_lightprobe_cache_free(struct Object *object)
void BKE_lightprobe_grid_cache_frame_free(struct LightProbeGridCacheFrame *cache)
bool BLO_read_array(BlendDataReader *reader, T **ptr_p, const SizeT array_size, const int elems=1)
void BLO_read_array_and_validate_size(BlendDataReader *reader, T **ptr_p, SizeT *array_size, const int elems=1)
@ LIGHTPROBE_CACHE_ADAPTIVE_RESOLUTION
@ LIGHTPROBE_CACHE_UNIFORM_GRID
int64_t BKE_lightprobe_grid_cache_frame_sample_count(const struct LightProbeGridCacheFrame *cache)
LightProbeObjectCache * BKE_lightprobe_cache_copy(LightProbeObjectCache *src_cache)
void * BKE_id_new(Main *bmain, short type, const char *name)
void BKE_lightprobe_cache_create(struct Object *object)
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
void write_int8_array(int64_t num, const int8_t *data)
void write_float_array(int64_t num, const float *data)
void write_float3_array(int64_t num, const float *data)
void write_id_struct(const void *id_address, const T *id, BlendStructWriterTypedFn< T > fn=nullptr)
void write_struct(const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_struct_array(const int64_t array_size, const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
float(* virtual_offset)[4]
LightProbeBlockData * block_infos
LightProbeBakingData baking
eLightProbeGridCacheLayout data_layout
LightProbeConnectivityData connectivity
LightProbeVisibilityData visibility
LightProbeIrradianceData irradiance
struct LightProbeGridCacheFrame * grid_static_cache