Geo Instance, individual numbers

Hi every one,
I am looking for a way to get t[xyz] positions on each of my intanced points in a SOP Text in my Geo :

Is it possible or do I need to use texture instance to show numbers?

Thanks !
test_instances.toe (4.43 KB)

There’s a couple ways to tackle it - if you want something highly performant you’d need to make some sprite sheets and think about a robust look up approach.

If you have a GPU that supports texture instancing - (I think this is NVIDIA and after the 800 series) you can work around this a little bit. It’s more memory intensive, but is certainly a method that would work. Take a look here to see how it’s set-up:
base_texture_instances.tox (2.36 KB)

Capture.PNG

Thanks a lot Matthew,
This way seems great!

I am still wondering if I can “Store” and “Fetch” this values in Python, in real time, to put them into my text Sop? And if I move my points values will give the exact points positions

I don’t know if this solution is possible and if it use a lot of ressources but I’m looking for that just for knowledge ^^

I remember a Tox i founded on the forum that allows to modify the number of lines in a circle and grows up each instances like that :

Yes, that’s very possible just very slow.

Using the copy sop you can stamp your copies with their copyindex, which in turn can be used to look up a sample position in CHOPs.

'x {tx}\ny {ty}\nz {tz}'.format(  tx = round(op('null1')['tx'][fetchStamp('index', 0)], 3),   ty = round(op('null1')['ty'][fetchStamp('index', 0)], 3),  tz = round(op('null1')['tz'][fetchStamp('index', 0)], 3))

That’s pretty messy to look at, but the principle is that you do your string formatting with:

"some_string {name}".format(name="Hello") 

The results of this would be:

some_string Hello

This business:

round(op('null1')['tx'][fetchStamp('index', 0)], 3)

Is looking for the value from null1’s ‘tx’ channel, in the sample position of the copyindex, then rounding this down to only three digits.

docs.derivative.ca/Copy_SOP

Here’s a look at that:

base_texture_instance_copysop.tox (3.12 KB)
The catch is that these are no longer instances, but new geometry. They’re also all bound together in the copy SOP, so there’s not too much room for efficiency (changing the position of one sample still cooks all of the entries). Animating 20 copies knocks me down to 30 fps, so you’re likely to see performance issues quickly. But, if the positions don’t change (or change infrequently you might be able to get away with this just fine.

I’m pretty sure I saw copy sop examples in op snippets, so you can also look there to see how that operator works.

If you need something performant and easier to understand I’d stick with the first example. If you really wanted to go for a proper chase, I’m sure you could figure out a way to do some of this in a vertex shader to create wireframe style lines. I don’t know that I would chase this unless it’s valuable research for you, or if the project REALLY needs that approach.

Thanks a lot Matthew, this is really helpful!

yes I will choose the first way you showed me. And yes next step will be vertex shaders ! I just need more knowledge to deal with it.

Thank you Matt, copy sop stamp was getting slow and couldn’t solve instance. This was very helpful!

I found when altering incoming geometry changing number of points and changing the text parameters, that current TouchDesigner crashes using this method of ‘replicator for instances’. Will dig more to see why to log.