Commit graph

17 commits

Author SHA1 Message Date
2219f8c9ad Fix compiler warnings and hints. 2025-03-18 18:34:54 +01:00
a38138582e Add support for OpenImageIO. 2025-03-18 17:05:13 +01:00
cd05c590cc Rework texture loading and caching system:
* Create a cache module to query and load cached files without having to load or
download the original file, as well as comparing changed time and size.
* Change `loadUri` to allow fetching the modification time and size of a file.
* Change `onload` of `loadable` to have a single `FetchResult` objects instead
  of many arguments (ok, err, data, time, size).
* Removed Pixie support.
* Added a buffer copy to simplify potentially problematic code.
* Add cache_key to newTexture when loading from buffer.
* For packed images, use the name of the blend file and the image as cache_key.
2025-01-25 14:25:26 +01:00
71aac99e5c Ensure only one of BC/ASTC is considered native, prefer ASTC on android. 2025-01-21 13:27:37 +01:00
a5c9bb3c70 Make Quat distinct, replace GameObject.rotation by a union (with quat and euler).
Replace `@` quat multiplication by `*` to avoid confusion.
2025-01-21 12:56:34 +01:00
b4c7061fc9 Shader library: Fix SH9 not working with some devices because of buggy vec3. 2024-12-16 21:24:42 +01:00
67307032da Textures: Add several defines and constructor options for compression, cache.
* Add defines `myouForceAstc`, `myouMinTextureChannels`, 
  `myouLoadUncompressedTextures` and `myouAllCacheFilesExist`.
* Suppress warning messages about emulation for `myouForceAstc`.
* Add argument `use_compression` to `newTexture` (default `true`)
2024-12-16 21:05:21 +01:00
1640040f93 Fix some textures not being destroyed when it should. 2024-09-21 02:06:32 +02:00
60a896f513 Workaround for images with less channels than the supposed texture format. 2024-09-13 02:18:37 +02:00
5b588fddf1 Allow compilation with threads off. 2024-09-13 02:15:32 +02:00
dd75d19399 Use quality settings for BCn formats in texture_optimize. 2024-09-10 00:50:33 +02:00
f7108225bd Add some documentation and fix fixdocs.nim. 2024-09-06 01:16:06 +02:00
45dc99b483 Add CacheSettings for automatically saving and loading compressed textures. 2024-09-06 01:14:35 +02:00
7f0ebc122a Add support for BCn texture compression formats (except BC2, BC6) with BC7enc. 2024-09-05 00:22:05 +02:00
878137db71 Load textures in a thread and optionally compress them (in ASTC only for now). 2024-09-03 15:59:15 +02:00
d784dd3a52 Replace the use of pointer/len and "done()" by SliceMem and destructors. 2024-08-31 00:40:02 +02:00
49d919f43d Move API-agnostic image procs out of texture, to prepare to add threads.
* Procs `loadFileFromPointersLen`, `getDimensionsFormat` and related graphics
API-agnostic functions have been moved into their own module `texture_decode`.
* New directory `gpu_formats` added, where we will put all modules related to
decoding, optimizing and caching meshes and textures (independently of the
graphics API being used) in a separate thread or threads.
2024-08-29 22:54:04 +02:00