1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Use fill() to fill an entire image instead of setting pixels individually.

This commit is contained in:
Anilforextra
2022-01-08 17:43:15 +05:45
parent c09c4e0154
commit c9f5d88f3a
6 changed files with 9 additions and 43 deletions

View File

@@ -545,11 +545,7 @@ Ref<Image> RendererSceneRenderRD::environment_bake_panorama(RID p_env, bool p_ba
Ref<Image> panorama;
panorama.instantiate();
panorama->create(p_size.width, p_size.height, false, Image::FORMAT_RGBAF);
for (int x = 0; x < p_size.width; x++) {
for (int y = 0; y < p_size.height; y++) {
panorama->set_pixel(x, y, panorama_color);
}
}
panorama->fill(panorama_color);
return panorama;
}