diff --git a/modules/noise/noise_texture_3d.cpp b/modules/noise/noise_texture_3d.cpp index ed242e7faae..33e257a5c25 100644 --- a/modules/noise/noise_texture_3d.cpp +++ b/modules/noise/noise_texture_3d.cpp @@ -110,6 +110,7 @@ void NoiseTexture3D::_set_texture_data(const TypedArray &p_data) { } else { texture = RS::get_singleton()->texture_3d_create(data[0]->get_format(), data[0]->get_width(), data[0]->get_height(), data.size(), false, data); } + format = data[0]->get_format(); } emit_changed(); } @@ -346,6 +347,5 @@ Vector> NoiseTexture3D::get_data() const { } Image::Format NoiseTexture3D::get_format() const { - ERR_FAIL_COND_V(!texture.is_valid(), Image::FORMAT_L8); - return RS::get_singleton()->texture_3d_get(texture)[0]->get_format(); + return format; } diff --git a/modules/noise/noise_texture_3d.h b/modules/noise/noise_texture_3d.h index 397711ca981..13125efe7f2 100644 --- a/modules/noise/noise_texture_3d.h +++ b/modules/noise/noise_texture_3d.h @@ -60,6 +60,8 @@ private: Ref color_ramp; Ref noise; + Image::Format format = Image::FORMAT_L8; + void _thread_done(const TypedArray &p_data); static void _thread_function(void *p_ud);