This completes support for tiled texture packing on the Blender / Cycles
side of things.
Most of these changes fall into one of three categories:
- Updating image handling code to pack/unpack tiled and multi-view images[1]
- Updating Cycles to handle tiled textures through BlenderImageLoader
- Updating OSL to properly handle textures with multiple slots
For OSL, the texture slot to tile mapping strategy is lifted directly from the already
existing Cycles CPU implementation[2].
Beyond the unit tests, a good way to test this is to use the
"Monster - UDIM" demo from https://www.blender.org/download/demo-files/
Open the file, pack every texture, re-save the file elsewhere and
then re-open that new file. Everything should work when rendering with
Eevee and Cycles CPU / OSL / GPU. Additionally, try unpacking the files
to re-save them locally.
[1] This fixes the unreported bug that multi-view images are not
packable since 2.79.
[2] The existing implementation can be found in the following 2 locations:
https://developer.blender.org/diffusion/B/browse/master/intern/cycles/scene/shader_nodes.cpp$405
https://developer.blender.org/diffusion/B/browse/master/intern/cycles/kernel/svm/image.h$66