I’m fairly new to TouchDesigner and I’m facing a challenge.
I want to populate 500,000 grids with 500,000 different images. Currently, I’m using a ReplicatorCOMP to generate the textures. The images are loaded via a FolderDAT and a Master-MoviefileIN TOP, which distributes them accordingly. However, TouchDesigner crashes at around 50,000 instances.
My questions:
• Is there an efficient workaround to avoid exceeding hardware limitations?
• Is it unrealistic to manage so many instances, or is there a more efficient way to handle this?
My current hardware:
• CPU: AMD Threadripper 7960X
• GPU: Nvidia 4090 FE
• RAM: 128GB
I assume a GPU-based instancing approach would be the best solution, but I’m unsure how to efficiently manage 500,000 textures.
Ehm 500,000 images?? do you need to see them all ?? how is possible your pc is not ding with 500,000 movie file in ?? anyway you may be good storing all in 3d texture even if , you may run out of mem kind of fast… with 500,000 images. i would fin another smarth way to deal with such big amount of picutures
in the past I’ve used imagemagick to create a mosaic of large sets of input files as a background OS task and then sampled the larger texture into projects.
it might be useful to know more about how you plan to present and operate on these images to make constructive suggestions for how to approach this. Also resolution of the images. Just doing some quick math but I think 500,000 HD images at HD1080 res would require roughly 3 terabytes to store uncompressed.
As previously mentioned, 500K images poses a challenge in more than one aspect. Assuming you’ve got storage sorted out, it’s likely that you won’t be able to load all the data at once due to RAM limitations, both CPU and GPU RAM (unless your images are tiny). You’ll have to figure out a way to dinamically load the images that are visible at any given time and unload the ones that are not. One way to minimize hiccups when loading via a Movie File In TOP is to make use of the python interface’s unload and preload methods. You can investigate how to use 3D textures or Texture Arrays to buffer a bunch of images into a single source that you can sample from in a fragment shader.
This uses a replicator with a fixed number of replicants, but it could be used to scroll through 500,000 images smoothly because it uses preloading. infinite_scroll.toe (7.7 KB)
Thank you for your reply. This is how I approached it: I combine the images into large textures. Each individual image has a resolution of 512x512px. I then merged them into a 30x30 mosaic, so I can fit 900 images in one mosaic. The mosaic ends up with pixel dimensions of 15,360x15,360px.
My idea is to use 2D texture arrays to split the mosaic back into individual images. I then want to project these individual images onto rectangles and distribute them in space using x, y, z coordinates. At the moment, I’m testing this with a single mosaic of 30x30 images. Unfortunately, I’m currently facing the challenge of projecting the UV coordinates of the 2D texture arrays onto the geometry instances.
I would consider looking into assigning a single image with your mosaic to instanced geo and then using per-instance UV adjustments in a glslMAT to isolate the individual cells rather than slicing it up outside the material.
edit:
sorry, I don’t have TD open at the moment, but I’m pretty sure there is a instance UV field in the instancing pars. supplying this with per instance offset and scaling sources by way of some CHOPs would let you do this without having to dig into the glslMAT.
edit2:
I recently discovered that my GPU (RTX5000 Ada Gen) doesn’t seem to have a 16,384^2 texture size limitation in TouchDesigner. Your GPU is also Ada Generation, and technically more powerful. So unless the texture size limit is exclusively removed by the Enterprise tier driver, you might be able to work with larger textures. Something worth testing