Skip to content

Commit 31add26

Browse files
committed
LightmapGI: fix crash during baking when sky is null
1 parent fafc073 commit 31add26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

servers/rendering/renderer_rd/renderer_scene_render_rd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Ref<Image> RendererSceneRenderRD::environment_bake_panorama(RID p_env, bool p_ba
138138

139139
if (use_cube_map) {
140140
Ref<Image> panorama = sky_bake_panorama(environment_get_sky(p_env), environment_get_bg_energy_multiplier(p_env), p_bake_irradiance, p_size);
141-
if (use_ambient_light) {
141+
if (use_ambient_light && panorama.is_valid()) {
142142
for (int x = 0; x < p_size.width; x++) {
143143
for (int y = 0; y < p_size.height; y++) {
144144
panorama->set_pixel(x, y, ambient_color.lerp(panorama->get_pixel(x, y), ambient_color_sky_mix));

0 commit comments

Comments
 (0)