summaryrefslogtreecommitdiff
path: root/scene/3d/gi_probe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/gi_probe.cpp')
-rw-r--r--scene/3d/gi_probe.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index 7370e1330c..96311236ef 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -881,11 +881,11 @@ void GIProbe::_fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z, Bak
}
}
-Vector<Color> GIProbe::_get_bake_texture(Image &p_image, const Color &p_color) {
+Vector<Color> GIProbe::_get_bake_texture(Ref<Image> p_image, const Color &p_color) {
Vector<Color> ret;
- if (p_image.empty()) {
+ if (p_image.is_null()) {
ret.resize(bake_texture_size * bake_texture_size);
for (int i = 0; i < bake_texture_size * bake_texture_size; i++) {
@@ -895,14 +895,14 @@ Vector<Color> GIProbe::_get_bake_texture(Image &p_image, const Color &p_color) {
return ret;
}
- if (p_image.is_compressed()) {
+ if (p_image->is_compressed()) {
print_line("DECOMPRESSING!!!!");
- p_image.decompress();
+ p_image->decompress();
}
- p_image.convert(Image::FORMAT_RGBA8);
- p_image.resize(bake_texture_size, bake_texture_size, Image::INTERPOLATE_CUBIC);
+ p_image->convert(Image::FORMAT_RGBA8);
+ p_image->resize(bake_texture_size, bake_texture_size, Image::INTERPOLATE_CUBIC);
- PoolVector<uint8_t>::Read r = p_image.get_data().read();
+ PoolVector<uint8_t>::Read r = p_image->get_data().read();
ret.resize(bake_texture_size * bake_texture_size);
for (int i = 0; i < bake_texture_size * bake_texture_size; i++) {
@@ -934,7 +934,7 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater
Ref<Texture> albedo_tex = mat->get_texture(SpatialMaterial::TEXTURE_ALBEDO);
- Image img_albedo;
+ Ref<Image> img_albedo;
if (albedo_tex.is_valid()) {
img_albedo = albedo_tex->get_data();
@@ -950,7 +950,7 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater
emission_col.g *= mat->get_emission_energy();
emission_col.b *= mat->get_emission_energy();
- Image img_emission;
+ Ref<Image> img_emission;
if (emission_tex.is_valid()) {
@@ -960,7 +960,7 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater
mc.emission = _get_bake_texture(img_emission, emission_col);
} else {
- Image empty;
+ Ref<Image> empty;
mc.albedo = _get_bake_texture(empty, Color(0.7, 0.7, 0.7));
mc.emission = _get_bake_texture(empty, Color(0, 0, 0));