diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index 2dcf6239958..91380456536 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -1030,10 +1030,8 @@ Ref TextureStorage::texture_2d_get(RID p_texture) const { if (texture->compressed) { glPixelStorei(GL_PACK_ALIGNMENT, 4); glGetCompressedTexImage(texture->target, i, &w[ofs]); - } else { glPixelStorei(GL_PACK_ALIGNMENT, 1); - glGetTexImage(texture->target, i, texture->gl_format_cache, texture->gl_type_cache, &w[ofs]); } } @@ -2123,7 +2121,7 @@ void TextureStorage::_update_render_target(RenderTarget *rt) { texture->layers = 1; } texture->gl_format_cache = rt->color_format; - texture->gl_type_cache = GL_UNSIGNED_BYTE; + texture->gl_type_cache = !rt->hdr ? GL_UNSIGNED_BYTE : GL_FLOAT; // to set HDR format size to 8 and keep 4 for LDR format texture->gl_internal_format_cache = rt->color_internal_format; texture->tex_id = rt->color; texture->width = rt->size.x;