Skip to content

Commit

Permalink
[Textures] Fix image naming in 32bit_texture and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
muczc1wek committed Jul 24, 2024
1 parent 76e31fb commit 166a97e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions docs/zengin/textures/32bit_texture.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# 32 Bit texture support

By default ZenGin supports only compresed `DXT1` and `DXT3` textures. [zSurface32 patch](https://worldofplayers.ru/threads/43009/page-3#post-1180504), created by Gratt improves texture quality by adding proper `RGBA8888`, `BGRA8888`, `ARGB8888` and `ABGR8888` format readout and DirectX 32 Bit surface support in ZenGin[^1].
By default, ZenGin supports only compressed `DXT1` and `DXT3` textures. [zSurface32 patch](https://worldofplayers.ru/threads/43009/page-3#post-1180504), created by Gratt improves texture quality by adding proper `RGBA8888`, `BGRA8888`, `ARGB8888` and `ABGR8888` format readout and DirectX 32 Bit surface support in ZenGin[^1].

To use the patch you must have [Union](../union/index.md) installed. Download the `.patch` file [here](https://worldofplayers.ru/attachments/114570/), and put it into `system\` directory.

!!! Warning
It is advised to use `BGRA8888` due to performance reasons, as other colorspaces require additional conversion at runtime.
It is advised to use `BGRA8888` due to performance reasons, as other [color spaces](https://en.wikipedia.org/wiki/RGBA_color_model) require additional conversion at runtime.

## Compilation

ZenGin doesn’t natively support the compilation of such textures. This can only be achieved using external programs. The simplest method to create a texture is by utilizing [zTEXiPy](https://gitlab.com/Shoun2137/ztexipy).

1. Open your texture in zTEXiPy[^2]:
![zTEXiPy's splash dialog](../../assets/images/STEP_1.WEBP)
![zTEXiPy's splash dialog](../../assets/images/32bit-texture-support/STEP_1.WEBP)
2. Choose `Save TEX as...`
3. In this window:
![zTEXiPy's saving dialog](../../assets/images/STEP_3.WEBP)
![zTEXiPy's saving dialog](../../assets/images/32bit-texture-support/STEP_3.WEBP)
- Uncheck `Generate Mipmaps` if your texture is meant to be used as UI.
- Set the `Colorspace` to `BGRA8888 (zEnum:3)` or other supported format.
4. Press `Save` and check your texture in-game:
![Ingame Example](../../assets/images/EXAMPLE_INGAME.WEBP)
![In-game Example](../../assets/images/32bit-texture-support/EXAMPLE_INGAME.WEBP)

## But why?

This type of texture is compatible with any asset, whether it’s armour or a sword. However, the primary application for such high-quality textures is in user interface elements, which make extensive use of gradients and the alpha channel:

=== "BGRA8888 vs DXT3"

![Comparison between BGRA8888 vs DXT3 (Alpha)](../../assets/images/EXAMPLE_1.WEBP)
![Comparison between BGRA8888 vs DXT3 (Alpha)](../../assets/images/32bit-texture-support/EXAMPLE_1.WEBP){: style='background-color: white;'}

This example shows comparison between raw BGRA8888 colorspace and DXT3 (BC2)[^3] compression.
DXT3 shows noticible banding throughout entire texture wherever there's alpha channel, while BGRA8888 has smooth gradient transition.
This example shows comparison between raw BGRA8888 color space and DXT3 (BC2)[^3] compression.
DXT3 shows noticeable banding throughout entire texture wherever there's alpha channel, while BGRA8888 has smooth gradient transition.

=== "BGRA8888 vs DXT1"

![Comparison between BGRA8888 vs DXT1](../../assets/images/EXAMPLE_2.WEBP)
![Comparison between BGRA8888 vs DXT1](../../assets/images/32bit-texture-support/EXAMPLE_2.WEBP)

This example shows comparison between raw BGRA8888 colorspace and DXT1 (BC1)[^3] compression.
This example shows comparison between raw BGRA8888 color space and DXT1 (BC1)[^3] compression.
DXT1 shows lossy quantization artifacts, while BGRA8888 has none.

[Source comparison files are available here.](../../assets/EXAMPLE_SOURCE.7z)
[Source comparison files are available here.](../../assets/examples/32bit_texture_support.7z)

The drawback of using these textures is their large size, as they contain uncompressed color data. However, this is a small price to pay for the improved quality of the final product.

Expand Down
4 changes: 2 additions & 2 deletions docs/zengin/textures/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Textures

Textures are pictures that get projected onto 3D models and on a 2D user interface in the game. ZenGin uses its own texture format `.TEX`, that in fact is a container for the texture in one of available formats. This section will discuss how to work with textures in ZenGin.
Textures are pictures that get projected onto 3D models and on a 2D user interface in the game. ZenGin uses its own texture format `.TEX`, that actually is a container for the texture in one of available formats. This section will discuss how to work with textures in ZenGin.

!!! Note
Technical documentaion of the `.TEX` texture format can be found in the [ZenKit documentaion](https://zk.gothickit.dev/engine/formats/texture/).
Technical documentation of the `.TEX` texture format can be found in the [ZenKit documentation](https://zk.gothickit.dev/engine/formats/texture/).

## Basics

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 166a97e

Please sign in to comment.