summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/environment
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-07-22 20:06:19 +0200
committerkobewi <kobewi4e@gmail.com>2022-10-14 14:34:15 +0200
commit072f6feabac70a6c4ed1a16f4e983bf31ad62d50 (patch)
tree6df3f7297a4af9799c1f6bc88e5c633235246362 /servers/rendering/renderer_rd/environment
parent39534a7aecc4ca4215af67244b23dda09ea339f8 (diff)
Make some Image methods static
Diffstat (limited to 'servers/rendering/renderer_rd/environment')
-rw-r--r--servers/rendering/renderer_rd/environment/gi.cpp2
-rw-r--r--servers/rendering/renderer_rd/environment/sky.cpp4
2 files changed, 2 insertions, 4 deletions
diff --git a/servers/rendering/renderer_rd/environment/gi.cpp b/servers/rendering/renderer_rd/environment/gi.cpp
index 9b6be0b422..f4a27144d9 100644
--- a/servers/rendering/renderer_rd/environment/gi.cpp
+++ b/servers/rendering/renderer_rd/environment/gi.cpp
@@ -2335,7 +2335,7 @@ void GI::SDFGI::render_region(Ref<RenderSceneBuffersRD> p_render_buffers, int p_
img.instantiate();
for (uint32_t i = 0; i < cascade_size; i++) {
Vector<uint8_t> subarr = data.slice(128 * 128 * i, 128 * 128 * (i + 1));
- img->create(cascade_size, cascade_size, false, Image::FORMAT_L8, subarr);
+ img->set_data(cascade_size, cascade_size, false, Image::FORMAT_L8, subarr);
img->save_png("res://cascade_sdf_" + itos(cascade) + "_" + itos(i) + ".png");
}
diff --git a/servers/rendering/renderer_rd/environment/sky.cpp b/servers/rendering/renderer_rd/environment/sky.cpp
index 4ff2a66975..6940276040 100644
--- a/servers/rendering/renderer_rd/environment/sky.cpp
+++ b/servers/rendering/renderer_rd/environment/sky.cpp
@@ -772,9 +772,7 @@ Ref<Image> SkyRD::Sky::bake_panorama(float p_energy, int p_roughness_layers, con
Vector<uint8_t> data = RD::get_singleton()->texture_get_data(rad_tex, 0);
RD::get_singleton()->free(rad_tex);
- Ref<Image> img;
- img.instantiate();
- img->create(p_size.width, p_size.height, false, Image::FORMAT_RGBAF, data);
+ Ref<Image> img = Image::create_from_data(p_size.width, p_size.height, false, Image::FORMAT_RGBAF, data);
for (int i = 0; i < p_size.width; i++) {
for (int j = 0; j < p_size.height; j++) {
Color c = img->get_pixel(i, j);