diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-12-23 00:37:38 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-12-23 00:37:38 -0300 |
commit | 4e729f38e02274afc91319d8dc9d2dfea9e9438e (patch) | |
tree | 48fa8b974220e1e1de3edf32c15906af18d98fe0 /scene/3d | |
parent | f9603d82365823938129e68823a19739a3dd0b23 (diff) |
baking now shows a proper button, and bakes can be saved.
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/gi_probe.cpp | 49 | ||||
-rw-r--r-- | scene/3d/gi_probe.h | 17 |
2 files changed, 28 insertions, 38 deletions
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 93d3e51a8e..24ed12027e 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -1,12 +1,6 @@ #include "gi_probe.h" #include "mesh_instance.h" -enum DataFormat { - DATA_RGBA8, - DATA_DXT5, - DATA_ETC2_EAC, -}; - void GIProbeData::set_bounds(const AABB& p_bounds) { @@ -87,40 +81,45 @@ int GIProbeData::get_dynamic_range() const{ return VS::get_singleton()->gi_probe_get_dynamic_range(probe); } -void GIProbeData::set_static_data(const DVector<uint8_t>& p_data,DataFormat p_format,int p_width,int p_height,int p_depth){ - VS::get_singleton()->gi_probe_set_static_data(probe,p_data,VS::GIProbeDataFormat(p_format),p_width,p_height,p_depth); +RID GIProbeData::get_rid() const { + return probe; } -DVector<uint8_t> GIProbeData::get_static_data() const{ - return VS::get_singleton()->gi_probe_get_static_data(probe); -} -GIProbeData::DataFormat GIProbeData::get_static_data_format() const{ +void GIProbeData::_bind_methods() { - return GIProbeData::DataFormat(VS::get_singleton()->gi_probe_get_static_data_format(probe)); + ObjectTypeDB::bind_method(_MD("set_bounds","bounds"),&GIProbeData::set_bounds); + ObjectTypeDB::bind_method(_MD("get_bounds"),&GIProbeData::get_bounds); -} -int GIProbeData::get_static_data_width() const{ + ObjectTypeDB::bind_method(_MD("set_cell_size","cell_size"),&GIProbeData::set_cell_size); + ObjectTypeDB::bind_method(_MD("get_cell_size"),&GIProbeData::get_cell_size); - return VS::get_singleton()->gi_probe_get_static_data_width(probe); + ObjectTypeDB::bind_method(_MD("set_to_cell_xform","to_cell_xform"),&GIProbeData::set_to_cell_xform); + ObjectTypeDB::bind_method(_MD("get_to_cell_xform"),&GIProbeData::get_to_cell_xform); -} -int GIProbeData::get_static_data_height() const{ + ObjectTypeDB::bind_method(_MD("set_dynamic_data","dynamic_data"),&GIProbeData::set_dynamic_data); + ObjectTypeDB::bind_method(_MD("get_dynamic_data"),&GIProbeData::get_dynamic_data); - return VS::get_singleton()->gi_probe_get_static_data_height(probe); + ObjectTypeDB::bind_method(_MD("set_dynamic_range","dynamic_range"),&GIProbeData::set_dynamic_range); + ObjectTypeDB::bind_method(_MD("get_dynamic_range"),&GIProbeData::get_dynamic_range); -} -int GIProbeData::get_static_data_depth() const{ + ObjectTypeDB::bind_method(_MD("set_energy","energy"),&GIProbeData::set_energy); + ObjectTypeDB::bind_method(_MD("get_energy"),&GIProbeData::get_energy); - return VS::get_singleton()->gi_probe_get_static_data_depth(probe); + ObjectTypeDB::bind_method(_MD("set_interior","interior"),&GIProbeData::set_interior); + ObjectTypeDB::bind_method(_MD("is_interior"),&GIProbeData::is_interior); -} + ADD_PROPERTY(PropertyInfo(Variant::_AABB,"bounds",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_bounds"),_SCS("get_bounds")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"cell_size",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_cell_size"),_SCS("get_cell_size")); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM,"to_cell_xform",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_to_cell_xform"),_SCS("get_to_cell_xform")); -RID GIProbeData::get_rid() const { + ADD_PROPERTY(PropertyInfo(Variant::INT_ARRAY,"dynamic_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_data"),_SCS("get_dynamic_data")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_energy"),_SCS("get_energy")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"interior",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_interior"),_SCS("is_interior")); - return probe; } GIProbeData::GIProbeData() { diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index 297672198c..aea01b5367 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -10,13 +10,11 @@ class GIProbeData : public Resource { RID probe; +protected: + + static void _bind_methods(); public: - enum DataFormat { - DATA_RGBA8, - DATA_DXT5, - DATA_ETC2_EAC, - }; void set_bounds(const AABB& p_bounds); @@ -40,20 +38,13 @@ public: void set_interior(bool p_enable); bool is_interior() const; - void set_static_data(const DVector<uint8_t>& p_data,DataFormat p_format,int p_width,int p_height,int p_depth); - DVector<uint8_t> get_static_data() const; - DataFormat get_static_data_format() const; - int get_static_data_width() const; - int get_static_data_height() const; - int get_static_data_depth() const; - virtual RID get_rid() const; GIProbeData(); ~GIProbeData(); }; -VARIANT_ENUM_CAST(GIProbeData::DataFormat); + class GIProbe : public VisualInstance { OBJ_TYPE(GIProbe,VisualInstance); |