for those who don’t know (despite of my numerous beginner posts here), I’m coming from (and still in) Max and discovering TD, thinking about Max techniques and trying to elaborate on them and to extend them and make them in TD now.
I’m looking for a way for using small sampler agents that could travel (randomly or not) over a texture coming from a Movie File In TOP.
I could have something like n agents like this, each one of them would sample a part of the initial texture, playing with interpolation or not, and giving the result as a new texture.
I’d have a resulting texture that would be the combination of all my sampling agents.
I’d like to use GPU the most possible, of course, so I was thinking about GLSL Multi TOP.
Maybe I could use some Texture for "storing“ parameters like agent positions over the texture, zoom level (each agent could sample ony vew pixels, or wider area) etc.
Would someone point me in the right way in TD for this ?
If I had some concepts, nodes, I could do it by myself but I’d need some pointers.
sampling a texture can be done using the Remap TOP where the first input is your texture coming from the MovieFileIn TOP while the second input is the uv lookup texture. The Remap TOP in the 2020.40k builds allows you to specify the resolution source so that the resulting texture has the same resolution as the texture containing the positions (in uv coordinates).
If your uv texture has the pixel format RG 32 float, make also sure to set the Remap TOP’s pixel format to match the source image’s format.
This is essentially what happens in “physarum” simulations with a minor difference. In physarum, the agents leave a trail to help other agents follow the same trail. In non-physarum, that’s not a requirement. In both cases, the agents can look at an image to decide where to travel. You could try my physarum example: TouchDesigner_Shared/Starters/Physarum at master · DBraun/TouchDesigner_Shared · GitHub
PS: the techniques section is for sharing working techniques, so your question better belongs in general discussion.
In physarum the agents are following a trail of other physarum agents. I think in your idea you’ll replace this trail image with a movie file in or other.
Many places would be ok. In my example look for “add_influence_matte” towards in the end. You could add a new movie file in there. Note that this doesn’t affect the “beauty” render which is “post_fx”->“out1”.
Markus, I’m confused with Remap TOP (I miss something for sure)
A square picture (or whatever picture actually) incoming at the input of my network process…
I want my output to be always a specific resolution and aspect (16:9 for instance)
Of course, I can decide to have incoming pictures ALWAYS the same aspect/res, as it will help…
But How to use Remap TOP with an incoming square pic 3200 x 3200 (for instance) if I want an output like 1920 x 1080 ? I don’t want any stretch or distorsion, but I want my 1920 x 1080 rectangle as a moving window sampling my incoming 3200 x3200 initial picture ??
so this is the Resolution Source parameter only introduced in the 2020.40k experimental builds. With that, the lookup texture (UV Image / second input) can be used as the resolution source.
Ok Markus, I got it.
If I wanted to keep on the not experimental build, and considering I’d have all my pictures resolution (at input) the same and static and a final resolution always the same too, how could I do ?
Maybe, Crop TOP could do it.
Currently experimenting.
By using expressions for cropright and cropbottom, depending on the others and resolutionw and resolutionh manually changed, maybe I could easily move my sampling rectangle… not sure if I’m correct here (I don’t want stretching the texture)
I think there’s a simple way to do Resolution Source in the non-experimental. Just set resolution on the remap TOP to custom resolution and make it the resolution of the remap’s second input.
I just assembled a small network.
I just have to put the resolution of my picture source, and the output resolution (I mean, both res are constant, in my system) and to move x,y and my “small sampler” rectangle move and crop and show the part of the picture I need.
I didn’t do zoom/unzoom but it wouldn’t be that hard.
Actually, I’m SURE I miss a very simpler way.
I’d like to share this part of my network.
It is interesting for me (while learning), because it forces me to make it reusable and more global for matchin a lot of cases.
Actually, about the resolution thing, I just used imagemagick to dump all my resolutions in a csv, I load it into a File In DAT and select the file and get the resolution etc.
Actually bis, it won’t be useful as I’ll put everything in a movie file, which means I have to get same resolution for everything… this post is irrelevant