The Cycles_Texture_Cache branch uses a rather sophisticated method for texture caching just like the commercial renderers I’ve been using so far. They convert the textures from all sorts of formats (8-bit, 16-bit, JPEGs, PNGs, TGAs, TIFFs, EXRs, … you name it) to an image format that supports mip-mapping and tiling.
One of the readily available open source tools for this is e.g. maketx from the OIIO library.
Mip-mapping means that after the conversion the image file contains a sequence of scaled down versions of itself. In case of a 2k square texture this means that it also contains these mip-map levels:
2048x2048 1024x1024 512x512 256x256 128x128 64x64 32x32 16x16 8x8 4x4 2x2 1x1
These are accessible without having to load the whole image file. The smaller the texture is in the rendered result (e.g. because it’s farther away from the camera) the smaller the mip-map level that’s actually loaded can be. This way an 8k texture might only weigh in like a 512px texture and consume a lot less memory.
Tiled images have another advantage: During conversion they’re split into square “tiles” that can also be separately accessed by the loader. In the default case of maketx these tiles are 64x64 pixels in size.
If e.g. only a part of a texture is visible in the rendered image, only these tiles need to be loaded and stored in memory.
Mip-mapping and tiling in combination can allow you to render scenes with terabytes of textures on a machine with a lot less RAM. Depending on the implementation of the texture cache, the parts of the textures that are currently in use can be swapped in and out of memory dynamically.
I’m not a software developer myself but all of this doesn’t only sound complicated, it for sure is not a trivial task to build into a renderer properly.
Luxcore or rather its Blender integration BlendLuxCore have added a very clever and neat method for texture scaling that’s not quite as elaborate as the one just described: It’s also pre-converting the textures to mip-mapped versions and only loads the needed sizes. It doesn’t support tiling or dynamic swapping as far as I know, but it can help a lot in scenes with many and/or big textures.
Here’s a thread in their forums about this Scene texture maps resize policy - LuxCoreRender Forums
It’s already ready to test in the latest Alpha builds and works quite well, without the need for the renderer to support all that complex mip-map / tiling stuff.
If I get it right no special changes had to be made to LuxCore (the renderer itself) to support this. Maybe this could be a (preliminary?) solution for Cycles as well.