Juda texture/ru

From KlayGE
Jump to: navigation, search

Juda Texture это технология виртуальных текстур в KlayGE. Имя "juda" по китайски означает "большой".

Спецификации

  • Максимальный размер: 1Mx1M
  • Формат текстур: ARGB8, ABGR8, GR8, R8

Применения

Визуализация ландшафта

Данный ландшафта могут быть сохранены непосредственно в Juda-текстуре. В реальном времени, данные поступают в GPU по запросу. Редактирование и визуализация ландшафтов могут получить все преимущества Juda-текстур.

Упаковка текстур

Все текстуры в игре могут быть упакованы в Juda-текстуру. Это обеспечивает прозрачный процесс загрузки текстур.

Реализация

Juda-текстуры представлены квадродеревом. Каждый узел хранит блок данных. Когда изображение поступает в Juda-текстуру, оно делится на множество блоков одного размера. Во первых, эти блоки хранятся в конечных узлах. Затем узлы верхнего уровня обновляются уменьшенными данными. And the leaf nodes just maintain the residuals between the raw data and upper level's. If the residual sum of a sub-tree is lower than some threshold, the sub-tree is cut. This process keeps going on until the whole tree is updated. Finally, the data block of each node is compressed by LZMA algorithm, which is a loss-less compression. At runtime, when a block is required, Juda Texture locates the path between root and that node. The data is decompress and accumulate into a texture cache. In shader, there is a indirect index table for accessing the texture cache and fetching the image data.

Toolset

JudaTexPacker

JudaTexPacker packs several textures into a Juda Texture file. The layout of the original textures inside the Juda Texture is described by a JTML script.

JudaTexViewer

You can use JudaTexViewer to open a Juda Texture.

Future works

  • More compression rate
  • Visual editing tool
  • Support HDR format