Skip to content

Commit

Permalink
[Textures] Mention GRM Blogpost and engine texture compilation option…
Browse files Browse the repository at this point in the history
…s in index
  • Loading branch information
muczc1wek committed Jul 23, 2024
1 parent 8a8ee2e commit 76e31fb
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions docs/zengin/textures/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ Textures are pictures that get projected onto 3D models and on a 2D user interfa
!!! Note
Technical documentaion of the `.TEX` texture format can be found in the [ZenKit documentaion](https://zk.gothickit.dev/engine/formats/texture/).

## Basics

All created textures have to be located in the `_WORK\DATA\TEXTURES\` directory. The compiled `.TEX` files are saved in the `_COMPILED\` subdirectory.

Here are some tips for working with Gothic textures:

- Textures must have dimensions that are multiples of 4.
- Square textures (with some exceptions, like faces or some interface elements) are preferred for easier mipmap generation.
- The maximum resolution for textures is 4096x4096.
- It is recommended not to use textures bigger than 4096x4096.
- Avoid things like `_V0`, `_A1` etc. in the texture name endings, as suffixes like this are used for [multitextures](multitextures.md).

## Formats

Expand All @@ -19,25 +23,43 @@ When working with textures in ZenGin, it is recommended to use the default textu
!!! Tip
Formats like `RGBA8888`, `BGRA8888`, `ARGB8888` and `ABGR8888` are properly supported with the zSurface32 patch. Learn more about it in the [32 Bit texture support](./32bit_texture.md) article.

## Mipmaps

[Mipmaps](https://en.wikipedia.org/wiki/Mipmap) are pre-generated versions of textures at different levels of detail. They are used, to improve rendering performance and reduce aliasing artifacts. When engine converts the texture it automatically generates mipmaps. Other tools may handle it differently, so it's better to check it before conversion.

!!! Example "How it works?"
If you want to learn more about mipmaps in ZenGin there is a [great article](https://www.gothic-reloaded-mod.org/en/blog/more-than-a-texture-patch-2) by Gothic Reloaded Mod Team.

## Engine compilation

By default, `.tga` files with a proper resolution are converted to `.TEX` files by the engine, when they appear in the game or a game is started with `-convertall` parameter. Also, you can convert textures to `.TEX` manually using one of the [available tools](#tools).

## Mipmaps
The engine compilation may be affected by keywords in the texture name or directory.

**Color depth**

Textures are compiled by default with a color depth of 16 bits per pixel and needs 4 bits of memory per pixel. To force the engine to convert textures with a different color depth, you need to add an ending to the name of the texture or directory `_16BIT` or `_32BIT`. Using 16/32 bit images makes sense when there are visual problems or noise after compression, but they take up more memory.

Example: `_WORK\DATA\TEXTURES\SKY\NOMIP_16BIT\CLOUDS.TGA`.

**nomip**

[Mipmaps](https://en.wikipedia.org/wiki/Mipmap) are pre-generated versions of textures at different levels of detail. They are used to improve rendering performance and reduce aliasing artifacts. When engine converts the texture it automatically generates mipmaps. Other tools may handle it differently, so it's better to check it before conversion.
By default, [Mipmaps](#mipmaps) are generated for all textures. However, if the texture path contains the directory `nomip`, then a Mipmap will not be created for such a texture. It makes sense to use if you experience visual problems or interference associated with the use of Mipmaps, and also to save memory if the texture is rarely used in the game, or the texture is too small.

Example: `_WORK\DATA\TEXTURES\EFFECTS\NOMIP\LIGHTNING.TGA`

## Tools
There are some tools created by the Gothic community, that simplify working with ZenGin textures.

### GoMan
Oldest texture tool, created by PyroX. Has a good viewer, but there are already better alternatives.

[Download](https://www.worldofgothic.de/dl/download_97.htm)
[:octicons-download-16: Download](https://www.worldofgothic.de/dl/download_97.htm)

### GoTex
Simple converter, written by [ThielHater](https://forum.worldofplayers.de/forum/members/52111-ThielHater?). Implements features like custom mipmaps and popular image formats support.

[Thread on WoG](https://forum.worldofplayers.de/forum/threads/1601349-Tool-GoTex)
[:material-forum: Thread on WoG](https://forum.worldofplayers.de/forum/threads/1601349-Tool-GoTex)

[:fontawesome-brands-github: GitHub](https://github.com/ThielHater/GoTex)

Expand Down

0 comments on commit 76e31fb

Please sign in to comment.