Commit Graph

113 Commits

Author SHA1 Message Date
271067eb2b Fix certain channel masks for Texture previewer 2025-01-15 18:40:53 +01:00
c7a9d64eaf Add color channel filter to editor texture previews 2025-01-11 23:27:48 +00:00
3c304ab7cc Merge pull request #96076 from AThousandShips/improve_null_check_core_drivers
[Core,Drivers] Improve use of `Ref.is_null/valid`
2024-12-23 11:14:58 -06:00
be86ce3103 Apply iwyu suggestion in core. 2024-12-19 00:43:47 +08:00
335077a03f Image: More cleanup and reduced code duplication. 2024-12-12 11:52:59 +01:00
88ffe07de9 Betsy: Add BC3 and BC5 support 2024-11-27 12:27:05 +01:00
3b6705a641 Support uid:// in more places 2024-11-16 21:43:18 +01:00
0dabcd9941 Resource UID fixes and improvements 2024-11-14 16:37:54 +01:00
80a9c0d569 Clean up Image 2024-11-01 21:32:16 +01:00
ec650a2f09 [Core,Drivers] Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-11-01 16:50:11 +01:00
38f9769bc6 [Core] Improve error messages with vformat 2024-10-30 15:55:51 +01:00
95fd45d9a5 Betsy: Implement BC4 compression 2024-09-22 10:16:37 +02:00
a6d84bc0ce Merge pull request #97059 from Gaktan/fix_weird_msvc_compilation_error
Fix weird MSVC compilation error
2024-09-16 13:36:06 +02:00
453f32ae0a Fix weird MSVC compilation error
For some reason, MSVC doesn't appreciate uint8 math with enum constants
2024-09-15 23:13:24 +02:00
606eedb0c9 Betsy: Add caching and BC1 compression support 2024-09-11 23:48:29 +02:00
194bdde947 Cleanup of raw nullptr checks with Ref
Using `is_valid/null` over checks with `nullptr` or `ERR_FAIL_NULL` etc.
2024-08-31 15:01:09 +02:00
76c8211653 Image: Add a method for detecting signed values 2024-08-27 09:23:17 +02:00
4b8946102b Merge pull request #91535 from BlueCube3310/betsy-bc6h
Add Betsy to speed up BC6 compression
2024-08-21 06:38:03 +02:00
f4037d6f6c Merge pull request #92496 from clayjohn/HDR-2D-sRGB
Ensure MovieWriter output is in gamma space when using HDR 2D
2024-08-19 12:08:40 +02:00
394ea653aa Add Betsy to speed up BC6 compression 2024-08-18 11:14:05 +02:00
eb684cccdc Merge pull request #92291 from BlueCube3310/image-convert-optimized
Optimize image conversion for half and float formats.
2024-08-16 10:33:32 +02:00
0ed45629fd Support 64-bit image sizes for VRAM compression 2024-07-21 21:06:14 +02:00
0445ccf428 Fix Image CowData crash when baking large lightmaps
This switches to 64-bit integers in select locations of the Image
class, so that image resolutions of 16384×16384 (used by
lightmap texture arrays) can be used properly. Values that are larger
should also work.

VRAM compression is also supported, although most VRAM-compressed
formats are limited to individual slices of 16384×16384. WebP
is limited to 16383×16383 due to format limitations.
2024-07-19 16:04:30 +02:00
e651421905 [TextServer, GDExtension] Fix building text servers as GDExtension, expose new/changed low-level methods to GDExtension API. 2024-06-12 19:30:19 +03:00
3b9d074fd7 Ensure MovieWriter output is in gamma space when using HDR 2D 2024-05-28 15:30:13 -07:00
d260a2ba74 Optimize half and float image conversion 2024-05-24 11:01:20 +02:00
28a18cf1b8 Merge pull request #88763 from BlueCube3310/image-is-compressed-static
Image: Add static `is_format_compressed` function.
2024-05-02 14:01:18 +02:00
75d65195ae Remove a redundant MAX comparison within a loop in compute_image_metrics 2024-03-28 22:23:15 +01:00
9903e6779b Enforce template syntax typename over class 2024-03-07 22:39:09 -06:00
8239aeec8e Image: Add static is_format_compressed function. 2024-02-28 19:42:06 +01:00
eac054f1cc Merge pull request #87971 from bruvzg/font_no_image_dup
[TextServer / Font] Do not duplicate images to prevent unnecessary embedding.
2024-02-15 17:35:36 +01:00
b457a30311 Merge pull request #87628 from YuriSizov/assets-bigger-better-errors
Improve error reporting in the asset library and in related types
2024-02-09 18:09:16 +01:00
684752e75b Replace error checks against size with is_empty 2024-02-09 12:50:15 +01:00
19f1d5afa9 [TextServer / Font] Do not duplicate images to prevent unnecessary embedding. 2024-02-05 10:38:32 +02:00
815038962f Improve error reporting in the asset library and in related types
This also makes errors related to asset image loading
verbose-only, because, frankly, users can't do much about
those errors. Spamming them with error messages
about some assets on the frontend being broken
is pointless.
2024-01-26 20:33:22 +01:00
47d991678d Fix lossless formats in PortableCompressedTexture2D
Update scene/resources/portable_compressed_texture.cpp

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-01-05 00:11:01 +05:00
dec2269bca Added error to catch conversion on invalid image 2023-12-10 15:06:22 -05:00
9877fa5058 Fix uninitialized variable in Image::fix_alpha_edges()
`core\io\image.cpp:3776:33: error: 'closest_color[0]' may be used uninitialized [-Werror=maybe-uninitialized]`
2023-10-29 22:59:03 -07:00
b5705958e6 Fix import crash
I was trying to import a solid colored metal/roughness texture that
worked in Godot 4.1.1 but failed to load on master. I eventually tracked
it down to this: to_x and to_y can be 0, which then leads them to be -1
later, which then causes ofs to overflow.

Some of these cases were hidden because of the use of Vector so we were
just happily scribbling in ram elsewhere.

Switched to LocalVector as it made debugging a bit easier.
2023-09-26 23:50:50 +02:00
16c3a19d91 Expose and document Image.get_mipmap_count() 2023-09-19 14:34:59 +03:00
893f889d74 [Core] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-11 19:45:49 +02:00
0045dc204c Revert "Implement loading DDS textures at run-time"
This reverts commit 34ab1c8a36.
2023-08-29 14:25:16 +02:00
a00cf02241 Add support for KTX & KTX2 image format
Add support glTF KHR_texture_basisu extension
2023-08-19 10:27:29 +02:00
34ab1c8a36 Implement loading DDS textures at run-time 2023-07-31 21:31:26 +02:00
e88934cb74 Merge pull request #74238 from bitsawer/fix_image_convert
Fix `Image.convert()` overwriting custom mipmaps
2023-07-12 17:15:39 +02:00
26eb3db234 Added Image's load_svg_from_(buffer|string)
No core dependency to the svg module.
2023-06-23 00:43:43 -03:00
c8cac39446 Grayscale fix for Image::premultiply_alpha() and Image::convert(FORMAT_L8) while using REC.709, with added test case 2023-05-27 18:01:44 -05:00
cf64e2fa47 Expose more compression formats in Image and fix compress check
Check for compressing ASTC checked if the function for BPTC was present
2023-04-13 09:39:03 +02:00
5a9d7fd8a6 Fix Image.convert() overwriting custom mipmaps 2023-03-02 16:46:06 +02:00
28f51ba547 Refactor high quality texture import
* Only two texture import modes for low/high quality now:
  * S3TC/BPTC
  * ETC2/ASTC
* Makes sense given this is the general preferred and most compatible combination in most platforms.
* Removed lossy_quality from VRAM texture compression options. It was unused everywhere.
* Added a new "high_quality" option to texture import. When enabled, it uses BPTC/ASTC (BC7/ASTC4x4) instead of S3TC/ETC2 (DXT1-5/ETC2,ETCA).
* Changed MacOS export settings so required texture formats depend on the architecture selected.

This solves the following problems:

* Makes it simpler to import textures as high quality, without having to worry about the specific format used.
* As the editor can now run on platforms such as web, Mac OS with Apple Silicion and Android, it should no longer be assumed that S3TC/BPTC is available by default for it.
2023-01-30 15:53:23 +01:00