Skip to content

Commit 49b4c20

Browse files
committed
Preserve existing alpha channel when using Normal Map Invert Y import option
While normal maps with RGTC compression cannot contain an alpha channel, it is possible for Godot to read non-RGTC normal maps that can contain an alpha channel that custom shaders can read. The visual output for opaque images (including RGTC normal maps) is unaffected by this change.
1 parent 811ce36 commit 49b4c20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

editor/import/resource_importer_texture.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
558558
for (int i = 0; i < width; i++) {
559559
for (int j = 0; j < height; j++) {
560560
const Color color = target_image->get_pixel(i, j);
561-
target_image->set_pixel(i, j, Color(color.r, 1 - color.g, color.b));
561+
target_image->set_pixel(i, j, Color(color.r, 1 - color.g, color.b, color.a));
562562
}
563563
}
564564
}

0 commit comments

Comments
 (0)