Max 128 Tops for instancing on applie silicon

Heya fam,

I have followed this tutorial which involves instancing a given folder of images and analysing their color to then remap them as pixels for an input and have reached the 128 top limit error for instance textures on my M2 macbookb air 15.

https://www.youtube.com/watch?v=0lP3WCIKVnU&ab_channel=percolated

I am looking to load n images (100s to thousands) which have been deresd and optimised to remap colors of a given top input.

I understand this is likely a job for a purely GLSL solution, but I am very green and was hoping for some pointers or a workaround to look into that is perhaps less robust but more achievable a direction for a beginner.

For my purposes i am looking to create the large palette of average color indexed images and then use them, so a realtime solution is not needed for that aspect and as such the 128 top instancing limit shouldnt hold me back?

Thanks for reading :slight_smile:

Hi @TomCarroll97,

as you are working with static images, you should be able to get around this limitation by using a 2DTexture Array instead of Texture Instancing.

For an example how this can work, have a look at the OP Snippet for the Texture 3D TOP. A change in your case would be to not use a Switch TOP as the input to the Texture 3D TOP but instead a Select TOP which loops through all your loaded images using an expression for the TOP parameter similar to:

'item{}'.format(int((me.time.frame-1)%6)+1)

with 6 being the number of images used in your case.

cheers
Markus

1 Like

Thanks Markus!

After creating each of my instances (0 to 389) each with their own “out_image” and "out_color) the select top works with “item0/out_image” but i cannot seem to get it working for the batch of images.

Im not so sure what is happening in the code you provided, is this just regular python stuff?

You’ll need to put the ‘TOP’ parameter into Python Expression mode for it to work like that. As it is it thinks the expression you entered is the path to the TOP.

Expand the parameter, click the blue ‘expressions mode’ square, then paste in your python expression.

1 Like

HAH makes sense. Thanks Ben