Commit Graph

13 Commits

Author SHA1 Message Date
Alibek Omarov
b3bb2fc16f engine: imagelib: add IL_HOST_ENDIAN flag to mark on-disk data that's already in host endianness 2026-04-26 04:12:52 +05:00
Sergey Degtyar
e87f307ac1 engine: image: fix blue halo around sprays 2026-04-10 15:00:02 +05:00
lewa_j
8a75104cbc commoon: engine: Fix not including all dependencies for headers. (Just some used in ref) 2026-01-12 13:52:04 +05:00
Alibek Omarov
44fb4fb594 engine: common: imagelib: remove dependency on OpenGL declarations in texture formats 2025-12-13 23:59:40 +05:00
Alibek Omarov
16c849d085 engine: common: imagelib: refactoring 2025-12-13 23:11:48 +05:00
Alibek Omarov
e2835a7614 engine: common: imagelib: fix incorrect check for big endian pixel formats 2025-12-13 22:30:03 +05:00
Alibek Omarov
93dfcc344b engine: implement loading luma in half-life 2025-11-18 15:35:20 +05:00
Ivan Avdeev
a251600c8a engine: common: imagelib: add KTX2 support (#1455)
* engine: common: imagelib: add KTX2 support

Adds basic KTX2 support for a few compressed formats. KTX2 essentially
is a Vulkan-centric texture format that supports literally hundreds of
pixel formats.
For now only support for these is added:
- `VK_FORMAT_BC4_UNORM_BLOCK`
- `VK_FORMAT_BC4_SNORM_BLOCK`
- `VK_FORMAT_BC5_UNORM_BLOCK`
- `VK_FORMAT_BC5_SNORM_BLOCK`
- `VK_FORMAT_BC6H_UFLOAT_BLOCK`
- `VK_FORMAT_BC6H_SFLOAT_BLOCK`
- `VK_FORMAT_BC7_UNORM_BLOCK`
- `VK_FORMAT_BC7_SRGB_BLOCK`

Adding more formats is relatively straightforward:
- Copy format definition from `VkFormat` enum in `vulkan_core.h`
- Add a new definition into `pixformat_t` enum.
- Add format size calculation into `Image_ComputeSize()`

While we're at it, also adds a few new formats to DDS:
- BC4_UNORM -- PF_BC4_UNSIGNED
- BC4_SNORM -- PF_BC4_SIGNED
- BC5_UNORM -- PF_BC5_UNSIGNED
- BC5_SNORM -- PF_BC5_SIGNED
- BC7 is expanded into BC7_UNORM and BC7_SRGB

ref_gl and ref_soft code is updated where it made sense. But not tested
really. Support for these formats has been tested with ref_vk.

* address spaces-vs-parentheses formatting where noticed

* parenthesize sizeofs

* move ktx2.h to imagelib as img_ktx2.h; massage it a bit

* use SetBits() instead of |=

* remove stale TODO comments
2023-10-18 10:31:40 +03:00
Alibek Omarov
e48b708fa6 engine: imagelib: img_png: validate image size through common engine function 2022-12-05 04:54:20 +03:00
SNMetamorph
6473efa995 engine: added support for BC7 and BC6H compression formats of DDS textures 2022-03-07 02:03:40 +03:00
Alibek Omarov
e0efe0aa23 engine: remove emboss filter. There seems no real use for it. 2021-12-07 09:09:45 +03:00
Alibek Omarov
b797e0af1a Merge 4483 update 2019-05-25 02:44:24 +03:00
Alibek Omarov
e193ac2c04 ref: more @mittorn's changes on RefAPI 2019-02-23 21:49:46 +03:00