summaryrefslogtreecommitdiff
path: root/scene/resources/sky.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/sky.cpp')
-rw-r--r--scene/resources/sky.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/scene/resources/sky.cpp b/scene/resources/sky.cpp
index cbe86b16b2..7e32516f94 100644
--- a/scene/resources/sky.cpp
+++ b/scene/resources/sky.cpp
@@ -43,7 +43,6 @@ void Sky::set_radiance_size(RadianceSize p_size) {
}
Sky::RadianceSize Sky::get_radiance_size() const {
-
return radiance_size;
}
@@ -59,8 +58,9 @@ Sky::ProcessMode Sky::get_process_mode() const {
void Sky::set_material(const Ref<Material> &p_material) {
sky_material = p_material;
RID material_rid;
- if (sky_material.is_valid())
+ if (sky_material.is_valid()) {
material_rid = sky_material->get_rid();
+ }
RS::get_singleton()->sky_set_material(sky, material_rid);
}
@@ -69,12 +69,10 @@ Ref<Material> Sky::get_material() const {
}
RID Sky::get_rid() const {
-
return sky;
}
void Sky::_bind_methods() {
-
ClassDB::bind_method(D_METHOD("set_radiance_size", "size"), &Sky::set_radiance_size);
ClassDB::bind_method(D_METHOD("get_radiance_size"), &Sky::get_radiance_size);
@@ -85,8 +83,8 @@ void Sky::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_material"), &Sky::get_material);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "sky_material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,PanoramaSkyMaterial,ProceduralSkyMaterial,PhysicalSkyMaterial"), "set_material", "get_material");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Automatic,HighQuality,HighQualityIncremental,RealTime"), "set_process_mode", "get_process_mode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "radiance_size", PROPERTY_HINT_ENUM, "32,64,128,256,512,1024,2048"), "set_radiance_size", "get_radiance_size");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "HighQuality,RealTime"), "set_process_mode", "get_process_mode");
BIND_ENUM_CONSTANT(RADIANCE_SIZE_32);
BIND_ENUM_CONSTANT(RADIANCE_SIZE_64);
@@ -97,17 +95,18 @@ void Sky::_bind_methods() {
BIND_ENUM_CONSTANT(RADIANCE_SIZE_2048);
BIND_ENUM_CONSTANT(RADIANCE_SIZE_MAX);
+ BIND_ENUM_CONSTANT(PROCESS_MODE_AUTOMATIC);
BIND_ENUM_CONSTANT(PROCESS_MODE_QUALITY);
+ BIND_ENUM_CONSTANT(PROCESS_MODE_INCREMENTAL);
BIND_ENUM_CONSTANT(PROCESS_MODE_REALTIME);
}
Sky::Sky() {
- mode = PROCESS_MODE_QUALITY;
+ mode = PROCESS_MODE_AUTOMATIC;
radiance_size = RADIANCE_SIZE_256;
sky = RS::get_singleton()->sky_create();
}
Sky::~Sky() {
-
RS::get_singleton()->free(sky);
-} \ No newline at end of file
+}