Page MenuHome

Add support for tiled images and the UDIM naming scheme
Needs ReviewPublic

Authored by Lukas Stockner (lukasstockner97) on Jun 28 2018, 12:43 AM.
"Love" token, awarded by andruxa696."Mountain of Wealth" token, awarded by philstopford."Love" token, awarded by GageChristopherRenn."Love" token, awarded by Frozen_Death_Knight."Love" token, awarded by Shimoon."Love" token, awarded by rboxman."Love" token, awarded by bnzs."Love" token, awarded by juantxo."Love" token, awarded by Treki26."Love" token, awarded by Vidu."Love" token, awarded by juang3d.



This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender.

With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser.
Therefore, code that is not yet aware of tiles will just access the default tile as usual.

The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9.
Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator.

The following features are supported so far:

  • Automatic detection of tiled images when selecting a 1001 tile in the Image Open operator
  • Saving all tiles
  • Reloading all tiles
  • Adding and removing tiles
  • Filling tiles with generated images
  • Drawing all tiles in the Image Editor
  • Viewing a tiled grid even if no image is selected
  • Rendering tiled images in Cycles (in SVM mode)
  • Automatically skipping loading of unused tiles in Cycles
  • Rendering tiled images in Eevee
  • 2D texture painting (also across tiles)
  • 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders)
  • Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID)
  • Per-tile resolutions and aspect ratios

The current state of this patch is that tiled images are usable, but there probably still are quite a few bugs.

The most important ToDo is support for tiled textures in the regular viewport. Also, OSL mode in Cycles doesn't work yet.

Of course, there also are many remaining areas that still need to be changed to support tiled textures (for example: UV editing tools, baking, dynamic paint...), but this could be added later.

Diff Detail

rB Blender
udim-update (branched from master)
Build Status
Buildable 4276
Build 4276: arc lint + arc unit

Event Timeline

UDIMs are now supported in the workbench engine and texture painting mode.

Also, I've merged in the latest blender2.8 changes.

Rebase (actually more of a rewrite) to the current master.

Workbench engine support is gone again, I haven't yet figured out how to integrate it into the new mesh draw cache.

Did a quick test and found the following issues:

  • Can't seem add tiles after initial image creation
  • No way select a tile aside from the first?
  • Changing the image extension mode can sometimes cause a crash (extensions also look incorrect when not crashing)
  • Changing source from tiled to single image and back loses all but first tile, no way to recover?
  • Incorrect filtering at tile boundaries (all render engines)
  • Crash during texture paint
  • Incorrect filtering at tile boundaries (all render engines)

It's not supposed to filter across UDIM tiles actually. Each tile is meant to contain separate UV islands that do not affect each other (it works the same in other renderers).