13 [](
const entt::meta_any& obj)
19 entt::meta_factory<reflection_probe_component>{}
20 .type(
"reflection_probe_component"_hs)
36 .data<&reflection_probe_component::set_update_mode, &reflection_probe_component::get_update_mode>(
"update_mode"_hs)
42 "On Demand: never refreshes until explicitly requested (runtime default, cheapest)."
43 "\nOnce: bakes a single time on load or after edits, then stops."
44 "\nRealtime: refreshes continuously, time-sliced by Faces Per Frame and Update Interval."},
46 .data<&reflection_probe_component::set_update_interval, &reflection_probe_component::get_update_interval>(
"update_interval"_hs)
52 "Seconds between refreshes when Update Mode is Realtime. 0 means every available frame."},
56 .data<&reflection_probe_component::set_faces_per_frame, &reflection_probe_component::get_faces_per_frame>(
"faces_per_frame"_hs)
62 "Number of cubemap faces to refresh per frame while a bake is in progress. "
63 "Higher values finish bakes faster but cost more per frame. "
64 "Only applies while the probe is dirty; probes at rest cost nothing."},
68 .data<&reflection_probe_component::set_apply_prefilter, &reflection_probe_component::get_apply_prefilter>(
"apply_prefilter"_hs)
73 entt::attribute{
"tooltip",
"Enables prefiltering which improves quality but may impact performance"},
75 .data<&reflection_probe_component::set_resolution, &reflection_probe_component::get_resolution>(
"resolution"_hs)
80 entt::attribute{
"tooltip",
"Cubemap face resolution in pixels. Higher values improve quality but increase bake cost and memory."},
82 .data<&reflection_probe_component::set_capture_sky, &reflection_probe_component::get_capture_sky>(
"capture_sky"_hs)
88 "When enabled, the atmospheric sky pass is rendered into the cubemap. "
89 "Disable for interior or local probes that should only reflect nearby geometry."},
91 .data<&reflection_probe_component::set_capture_shadows, &reflection_probe_component::get_capture_shadows>(
"capture_shadows"_hs)
97 "When enabled, shadow maps are built and sampled during cubemap capture. "
98 "Disable to reduce bake cost when shadows are not needed in reflections."},
104 try_save(ar, ser20::make_nvp(
"probe", obj.get_probe()));
105 try_save(ar, ser20::make_nvp(
"update_mode", obj.get_update_mode()));
106 try_save(ar, ser20::make_nvp(
"update_interval", obj.get_update_interval()));
107 try_save(ar, ser20::make_nvp(
"faces_per_frame", obj.get_faces_per_frame()));
108 try_save(ar, ser20::make_nvp(
"apply_prefilter", obj.get_apply_prefilter()));
109 try_save(ar, ser20::make_nvp(
"resolution", obj.get_resolution()));
110 try_save(ar, ser20::make_nvp(
"capture_sky", obj.get_capture_sky()));
111 try_save(ar, ser20::make_nvp(
"capture_shadows", obj.get_capture_shadows()));
120 if(
try_load(ar, ser20::make_nvp(
"update_mode", update_mode)))
122 obj.set_update_mode(update_mode);
125 float update_interval = obj.get_update_interval();
126 if(
try_load(ar, ser20::make_nvp(
"update_interval", update_interval)))
128 obj.set_update_interval(update_interval);
132 if(
try_load(ar, ser20::make_nvp(
"probe", probe)))
134 obj.set_probe(probe);
137 size_t faces_per_frame = obj.get_faces_per_frame();
138 if(
try_load(ar, ser20::make_nvp(
"faces_per_frame", faces_per_frame)))
140 obj.set_faces_per_frame(faces_per_frame);
143 bool apply_prefilter =
false;
144 if(
try_load(ar, ser20::make_nvp(
"apply_prefilter", apply_prefilter)))
146 obj.set_apply_prefilter(apply_prefilter);
150 if(
try_load(ar, ser20::make_nvp(
"resolution", resolution)))
152 obj.set_resolution(resolution);
155 bool capture_sky = obj.get_capture_sky();
156 if(
try_load(ar, ser20::make_nvp(
"capture_sky", capture_sky)))
158 obj.set_capture_sky(capture_sky);
161 bool capture_shadows = obj.get_capture_shadows();
162 if(
try_load(ar, ser20::make_nvp(
"capture_shadows", capture_shadows)))
164 obj.set_capture_shadows(capture_shadows);
Class that contains core reflection probe data, used for rendering and other purposes.
auto get_probe() const -> const reflection_probe &
Gets the reflection probe object.
auto get_update_mode() const -> probe_update_mode
Gets the probe's update policy.
void set_probe(const reflection_probe &probe)
Sets the reflection probe object.
auto property_predicate(property_predicate_t< T > predicate) -> property_predicate_t< T >
attributes::value_type attribute
std::map< std::string, meta_any > attributes
BinaryInputArchive iarchive_binary_t
simd::JSONOutputArchive oarchive_associative_t
BinaryOutputArchive oarchive_binary_t
simd::JSONInputArchive iarchive_associative_t
probe_update_mode
Enum class describing when a reflection probe refreshes its cubemap.
probe_resolution
Fixed cubemap face resolutions supported by reflection probes.
#define SAVE_INSTANTIATE(cls, Archive)
auto try_save(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
#define LOAD_INSTANTIATE(cls, Archive)
auto try_load(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
Structure representing a reflection probe.