Coloring individual shapes in instance texture

I am creating a grid of tiles each of which contains a texture with some distinct shapes and I’m wondering is there a way to randomly add color to each individual shape for each instance? For example, in the below .toe how can I add a different color for the background as well as the arc for each instance?

coloringInstanceTexture.2.toe (4.6 KB)

Hi @leafava

So I see you’re using the texture instancing for your arc. What you need to look into is the texture index part of this functionality if you want to have that same shape/texture, but apply different colors. The texture instance is explained here as:

Texture Index instancetexindex - Select what data to select which texture to use for the instances, use the drop-down menu on the right to easily select from the available options. 

You should be able to just copy and tweak the example from the OP Snippets page in TD if you want a starting point. But as of right now, you’re just using that single texture for all of your instances.

Hey @luxnaut thanks for the response!

Maybe I’m misunderstanding your solution, but what I’m asking is if there’s a way to do this that doesn’t involve manually creating different textures that have the same shapes but with different colors and indexing through them.

I know there’s a way to apply a single color to the whole texture via the Color Mode but is there a way to single out the arc from the background in the texture for each instance and apply a different, random color to each one?

Also, can you specify which OP Snippet you’re referring to?

Thanks!

Yes, this is what I meant by using the indices with texture instancing. So texture instancing is just using a texture, and applying it to instances; but, if you are wanting to apply a different texture to each instance in some way, you can do so with the “Texture Index” on the Geo COMP’s “Instance 2” page. Look at the Geo COMP’s OP snippet for texture instancing, and you’ll see a Base COMP that has a replicator inside of it that is pulling different movie files to use for texture instancing. You would just need to reformat this idea to work with what you’re doing.

Essentially, the train of thought is:

OPs/Code That Effect Color or Other Paramters → Textures (via replicators) → Texture Instancing (using the replicators)

Hope this helps/clarifies! :blush:

Thank you for the clarification @luxnaut :slight_smile:

This is the way I was able to use the example to achieve what I want. I’d love to know if you think this is the best method.

coloringInstanceTexture.toe (5.8 KB)

I created the different circles using the method you described but had to manually subtract the second circle from each iteration, resulting in the rings that you see.

I want to add more combinations of shapes and even more color combos but I feel like that will be a lot of manual work given my current approach. Can you give me any tips on how to automate this process better?

One method would be to use the border parameters in the circle TOP, that way you could just create the texture all in one OP. Another would be to save the texture out as an image and use movie file in TOPs. If you’re wanting to do multiple shapes, then I could suggest the images route, simply because it’s much easier and graphically less intense (if that’s something you need to worry about. You could even have white shapes that you color with compositing, so you don’t have to render out so many images.

Awesome design by the way!