godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.34k stars 21.06k forks source link

Can't bake light maps on gridmap at full scale #29203

Closed RepairUnit3k6 closed 3 years ago

RepairUnit3k6 commented 5 years ago

Godot version: 3.1.1 Stable (Official build)

OS/device including version: linux Ubuntu 18.4 bionic with XFce

Issue description: GridMap at full scale is unable to bake lightmaps even though downscaled copy can bake lightmaps. Baking process get to end of "Plotting meshes" and then engine crashes. There is nothing in console, nothing in log and absolutely no clue what caused it.

Steps to reproduce:

Extraction passworld : LetGoDotBurn I chose this password because GoDot burn itself during baking

Extract packed project and open it in GoDot. Load scene named "works", select baked lightmaps node and click "bake lightmaps". And pick snack because it will take a while but it will work. Then, do same but with scene named "crash", GoDot wiil, as name sugessting, kill itself

Minimal reproduction project: As mentioned before, use password "LetGoDotBurn" to extract files 3D_Test.zip

KoBeWi commented 5 years ago

Yeah, it crashes. Here's output:

OpenGL ES 3.0 Renderer: GeForce GTX 1060/PCIe/SSE2
adding mesh..
generate..
final texsize: 8696.000000,8624.000000 - max 8692.500000,8620.500000
doneCrashHandlerException: Program crashed
qarmin commented 5 years ago

Can't reproduce with Godot a46b8e1 and Ubuntu 19.04

RepairUnit3k6 commented 5 years ago

Can't reproduce with Godot a46b8e1 and Ubuntu 19.04

Lemme try. I'll build from that commit and report back Once again, that unfortunate time come, time to build GoDot from source on my 1.9GHz CPU. Should pick snack, it will take a while

RepairUnit3k6 commented 5 years ago

@qarmin I can reproduce with GoDot a46b8e1. No log file generated, I did not happen to catch output. I'm using Ubuntu 18.4 with MESA drivers. I want 19.4 be here for a while so people have time to create drivers and provide sufficient support before I upgrade distro

bojidar-bg commented 5 years ago

Got it to crash with a debug build at eb70999ffa41d36f3b7227780b878b8dc64efdd0, here is a backtrace:

#0  0x00000000037e676c in VoxelLightBaker::Light::Light (this=0xed16f90) at scene/3d/voxel_light_baker.h:100
#1  0x00000000037e6504 in CowData<VoxelLightBaker::Light>::resize (this=0x7fffffff9a00, p_size=19247332) at ./core/cowdata.h:293
#2  0x00000000037e157f in Vector<VoxelLightBaker::Light>::resize (this=0x7fffffff99f8, p_size=19247332) at ./core/vector.h:84
#3  0x00000000037d65c3 in VoxelLightBaker::_check_init_light (this=0x7fffffff99e0) at scene/3d/voxel_light_baker.cpp:736
#4  0x00000000037d6519 in VoxelLightBaker::begin_bake_light (this=0x7fffffff99e0, p_quality=VoxelLightBaker::BAKE_QUALITY_HIGH, p_bake_mode=VoxelLightBaker::BAKE_MODE_RAY_TRACE, p_propagation=1, p_energy=1)
    at scene/3d/voxel_light_baker.cpp:723
#5  0x00000000035bc39a in BakedLightmap::bake (this=0xa928670, p_from_node=0xa91df30, p_create_visual_debug=false) at scene/3d/baked_lightmap.cpp:406
#6  0x0000000002b090f8 in BakedLightmapEditorPlugin::_bake (this=0xa7fb8c0) at editor/plugins/baked_lightmap_editor_plugin.cpp:40
#7  0x0000000002b0ab36 in MethodBind0<BakedLightmapEditorPlugin>::call (this=0xa7fcd40, p_object=0xa7fb8c0, p_args=0x7fffffffa0c0, p_arg_count=0, r_error=...) at ./core/method_bind.gen.inc:147
#8  0x0000000004471fce in Object::call (this=0xa7fb8c0, p_method=..., p_args=0x7fffffffa0c0, p_argcount=0, r_error=...) at core/object.cpp:940
#9  0x00000000044740f5 in Object::emit_signal (this=0xa7fbbb0, p_name=..., p_args=0x7fffffffa0c0, p_argcount=0) at core/object.cpp:1240
#10 0x00000000044726e7 in Object::emit_signal (this=0xa7fbbb0, p_name=..., p_arg1=..., p_arg2=..., p_arg3=..., p_arg4=..., p_arg5=...) at core/object.cpp:1296
#11 0x0000000003299f6f in BaseButton::pressed (this=0xa7fbbb0) at scene/gui/base_button.cpp:167
#12 0x0000000003299712 in BaseButton::_gui_input (this=0xa7fbbb0, p_event=...) at scene/gui/base_button.cpp:84
#13 0x00000000032a1ff2 in MethodBind1<BaseButton, Ref<InputEvent> >::call (this=0x669fed0, p_object=0xa7fbbb0, p_args=0x7fffffffa710, p_arg_count=1, r_error=...) at ./core/method_bind.gen.inc:867
#14 0x000000000447082c in Object::call_multilevel (this=0xa7fbbb0, p_method=..., p_args=0x7fffffffa710, p_argcount=1) at core/object.cpp:775
#15 0x0000000004471a18 in Object::call_multilevel (this=0xa7fbbb0, p_name=..., p_arg1=..., p_arg2=..., p_arg3=..., p_arg4=..., p_arg5=...) at core/object.cpp:880
#16 0x0000000003265e9e in Viewport::_gui_call_input (this=0x6c92030, p_control=0xa7fbbb0, p_input=...) at scene/main/viewport.cpp:1539
#17 0x0000000003267dbc in Viewport::_gui_input_event (this=0x6c92030, p_event=...) at scene/main/viewport.cpp:1911
#18 0x0000000003264df3 in Viewport::input (this=0x6c92030, p_event=...) at scene/main/viewport.cpp:2686
#19 0x0000000003264c74 in Viewport::_vp_input (this=0x6c92030, p_ev=...) at scene/main/viewport.cpp:1316
#20 0x000000000328e1d2 in MethodBind1<Viewport, Ref<InputEvent> const&>::call (this=0x665a390, p_object=0x6c92030, p_args=0x7fffffffbdc0, p_arg_count=1, r_error=...) at ./core/method_bind.gen.inc:867
#21 0x0000000004471fce in Object::call (this=0x6c92030, p_method=..., p_args=0x7fffffffbdc0, p_argcount=1, r_error=...) at core/object.cpp:940
#22 0x00000000044718df in Object::call (this=0x6c92030, p_name=..., p_arg1=..., p_arg2=..., p_arg3=..., p_arg4=..., p_arg5=...) at core/object.cpp:864
#23 0x0000000003228ff3 in SceneTree::call_group_flags (this=0x612e2e0, p_call_flags=2, p_group=..., p_function=..., p_arg1=..., p_arg2=..., p_arg3=..., p_arg4=..., p_arg5=...) at scene/main/scene_tree.cpp:267
#24 0x0000000003229eb1 in SceneTree::input_event (this=0x612e2e0, p_event=...) at scene/main/scene_tree.cpp:422
#25 0x0000000001735bdf in InputDefault::_parse_input_event_impl (this=0x6136640, p_event=..., p_is_emulated=false) at main/input_default.cpp:442
#26 0x0000000001733fdf in InputDefault::parse_input_event (this=0x6136640, p_event=...) at main/input_default.cpp:259
#27 0x0000000001736f5a in InputDefault::flush_accumulated_events (this=0x6136640) at main/input_default.cpp:670
#28 0x000000000171e2d3 in OS_X11::process_xevents (this=0x7fffffffd550) at platform/x11/os_x11.cpp:2484
#29 0x0000000001722319 in OS_X11::run (this=0x7fffffffd550) at platform/x11/os_x11.cpp:3030
#30 0x000000000171108f in main (argc=2, argv=0x7fffffffdcb8) at platform/x11/godot_x11.cpp:55

The crash with 3.1.1 stable had a different slightly different stacktrace:

#0  0x00000000019dd6da in VoxelLightBaker::_check_init_light() ()
#1  0x0000000000000001 in ?? ()
#2  0x000000000128a0f0 in ?? ()
#3  0x0000000100000002 in ?? ()
#4  0x00007fffffffb820 in ?? ()
#5  0x0000000000000002 in ?? ()
#6  0x0000000001879ecd in BakedLightmap::bake(Node*, bool) ()
RepairUnit3k6 commented 5 years ago

@bojidar-bg That explains why 3.1.1 crashes quickly but further commits hangs for a while before crashing

jarrellmark commented 4 years ago

Hi Godot developers and others,

I'm getting a similar problem when trying to bake a baked lightmap on a project I'm working on.

It seems like an out of memory error. However, I had a lot of RAM remaining, the swap did not even start to get used. Although, the RAM usage was creeping upwards until this error happened. Maybe the godot program has a limit on RAM or something. Or maybe it was the GPU RAM that ran out. I'm not sure.

Godot v3.2-alpha3_x11.64 Ubuntu LTS 18.04 GLES2 OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2)

Error:

ERROR: resize: Condition ' !_ptrnew ' is true. returned: ERR_OUT_OF_MEMORY
   At: ./core/cowdata.h:284.
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7fd42b2b6f20] (??:0)
[2] Godot_v3.2-alpha3_x11.64() [0x159606e] (<artificial>:?)
[3] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[4] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[5] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[6] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[7] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[8] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[9] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[10] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[11] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[12] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[13] Godot_v3.2-alpha3_x11.64() [0x1595435] (<artificial>:?)
[14] Godot_v3.2-alpha3_x11.64() [0x16357ac] (??:?)
[15] Godot_v3.2-alpha3_x11.64() [0x171a675] (??:?)
[16] Godot_v3.2-alpha3_x11.64() [0x1d16f53] (<artificial>:?)
[17] Godot_v3.2-alpha3_x11.64() [0x2894d49] (??:?)
[18] Godot_v3.2-alpha3_x11.64() [0xc03393] (??:?)
[19] Godot_v3.2-alpha3_x11.64() [0xc8e410] (??:?)
[20] Godot_v3.2-alpha3_x11.64() [0xc8f4e0] (??:?)
[21] Godot_v3.2-alpha3_x11.64() [0x1871305] (<artificial>:?)
[22] Godot_v3.2-alpha3_x11.64() [0x18717ce] (<artificial>:?)
[23] Godot_v3.2-alpha3_x11.64() [0x1871a81] (??:?)
[24] Godot_v3.2-alpha3_x11.64() [0x1f62526] (??:?)
[25] Godot_v3.2-alpha3_x11.64() [0xc11054] (??:?)
[26] Godot_v3.2-alpha3_x11.64() [0xbd12c1] (??:?)
[27] Godot_v3.2-alpha3_x11.64() [0x18dae26] (<artificial>:?)
[28] Godot_v3.2-alpha3_x11.64() [0x18f5eff] (<artificial>:?)
[29] Godot_v3.2-alpha3_x11.64() [0x18f6fe4] (??:?)
[30] Godot_v3.2-alpha3_x11.64() [0x18f716a] (<artificial>:?)
[31] Godot_v3.2-alpha3_x11.64() [0x27b1cd6] (??:?)
[32] Godot_v3.2-alpha3_x11.64() [0xc03393] (??:?)
[33] Godot_v3.2-alpha3_x11.64() [0xbd1345] (??:?)
[34] Godot_v3.2-alpha3_x11.64() [0x1852183] (??:?)
[35] Godot_v3.2-alpha3_x11.64() [0x1875d8c] (??:?)
[36] Godot_v3.2-alpha3_x11.64() [0x28c0e41] (??:?)
[37] Godot_v3.2-alpha3_x11.64() [0x28bde6d] (<artificial>:?)
[38] Godot_v3.2-alpha3_x11.64() [0x2a159cb] (<artificial>:?)
[39] Godot_v3.2-alpha3_x11.64() [0x84883c] (??:?)
[40] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7fd42b299b97] (??:0)
[41] Godot_v3.2-alpha3_x11.64() [0x85620e] (??:?)
-- END OF BACKTRACE --
KoBeWi commented 3 years ago

Still valid in 3.2.3

Can't test on master, because seems like meshes aren't detected (incompatible gridmap?).

Calinou commented 3 years ago

It's worth checking whether https://github.com/godotengine/godot/pull/40035 resolves this.

KoBeWi commented 3 years ago

No longer crashes in 3.2.4 rc1.