summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2017-12-17 18:00:00 +0100
committerHein-Pieter van Braam <hp@tmm.cx>2017-12-17 18:00:00 +0100
commitc4c7fa3f5ee80f998b69ea5d84bf8ba5b50f887f (patch)
treece0113a2507197b25879657bbc0baa36a55636c0
parentad3393743c2e505f68a12b20113f9c2bda88fa89 (diff)
Limit the lightmapper subdivide to 1024
Due to memory contraints in other places in Godot it is unlikely that anything higher than 1024 will actually work. When/if we improve memory management for vectors we can increase this limit again
-rw-r--r--scene/3d/baked_lightmap.cpp6
-rw-r--r--scene/3d/baked_lightmap.h2
2 files changed, 2 insertions, 6 deletions
diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp
index 99d14e7f74..7afac94e71 100644
--- a/scene/3d/baked_lightmap.cpp
+++ b/scene/3d/baked_lightmap.cpp
@@ -298,7 +298,7 @@ BakedLightmap::BakeError BakedLightmap::bake(Node *p_from_node, bool p_create_vi
Ref<BakedLightmapData> new_light_data;
new_light_data.instance();
- static const int subdiv_value[SUBDIV_MAX] = { 8, 9, 10, 11, 12, 13 };
+ static const int subdiv_value[SUBDIV_MAX] = { 8, 9, 10, 11 };
VoxelLightBaker baker;
@@ -678,7 +678,7 @@ void BakedLightmap::_bind_methods() {
ClassDB::bind_method(D_METHOD("debug_bake"), &BakedLightmap::_debug_bake);
ClassDB::set_method_flags(get_class_static(), _scs_create("debug_bake"), METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR);
- ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_subdiv", PROPERTY_HINT_ENUM, "128,256,512,1024,2048,4096"), "set_bake_subdiv", "get_bake_subdiv");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_subdiv", PROPERTY_HINT_ENUM, "128,256,512,1024"), "set_bake_subdiv", "get_bake_subdiv");
ADD_PROPERTY(PropertyInfo(Variant::INT, "capture_subdiv", PROPERTY_HINT_ENUM, "128,256,512"), "set_capture_subdiv", "get_capture_subdiv");
ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_quality", PROPERTY_HINT_ENUM, "Low,Medium,High"), "set_bake_quality", "get_bake_quality");
ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_mode", PROPERTY_HINT_ENUM, "ConeTrace,RayTrace"), "set_bake_mode", "get_bake_mode");
@@ -693,8 +693,6 @@ void BakedLightmap::_bind_methods() {
BIND_ENUM_CONSTANT(SUBDIV_256);
BIND_ENUM_CONSTANT(SUBDIV_512);
BIND_ENUM_CONSTANT(SUBDIV_1024);
- BIND_ENUM_CONSTANT(SUBDIV_2048);
- BIND_ENUM_CONSTANT(SUBDIV_4096);
BIND_ENUM_CONSTANT(SUBDIV_MAX);
BIND_ENUM_CONSTANT(BAKE_QUALITY_LOW);
diff --git a/scene/3d/baked_lightmap.h b/scene/3d/baked_lightmap.h
index 5595ec1e61..f63749a0b4 100644
--- a/scene/3d/baked_lightmap.h
+++ b/scene/3d/baked_lightmap.h
@@ -64,8 +64,6 @@ public:
SUBDIV_256,
SUBDIV_512,
SUBDIV_1024,
- SUBDIV_2048,
- SUBDIV_4096,
SUBDIV_MAX
};