Super Simple GLSL multi comper/mover

** EDIT ** November 29 2015
Made fix to issue found by Ben. Input channels now only need to be ordered correctly and do
not need to be a complete set ( ie, you can just input Tx/Ty and not worry about scale). Examples updated to reflect also.
** EDIT **

** EDIT ** Sept 5 2015
Just put an update up on this thread, see my more recent post for an update.
I’ve also added the new tox to this first post, and renamed the older version in case anyone wants the old one still.
** EDIT **

I made this a while ago, inspired by Kieth’s 8 image comper. This one is way more simple (no blending modes), but it was my exercise in getting to know the new Touch GLSL 3.3 features and uniforms. So the cool thing is that it is incredibly easy to add images to the mix without setting up and possibly using up all of your uniform entries in the GLSL TOP parameters.

To use it, just pipe in your main “canvas” as the first input and then everything else you want to move around in that canvas as successive inputs. Then go in and adjust the green chops for transform and scale. If you want to add another input, just wire something else into the GLSL TOP, and then copy paste one of the green constant CHOPs and wire it to the merge. This will add to the vec4 array that is being used to transform and scale each input. No exporting, no annoying adding of uniforms! Yay! The array is maxed at 32 inputs, but could probably go up more depending on the GPU allowances.

I use this all the time for last minute pixel mapping situations, its great to avoid the torrent of Over TOPS that inevitably occur when you start needing to move little pieces around in a frame.

Everything is being “over-ed” in order right now, but the shader could be given more functionality or just switched to add.

Hope it’s of use, at least as a demonstration of those new GLSL texture uniforms that are built in now.
multiImageComp_examples.tox (7.19 KB)
multiImageComp.tox (3.73 KB)
multiImageComp_v1_old.tox (3.28 KB)
multiImageComp_v0_old.tox (2.2 KB)

1 Like

:open_mouth: this is amazing

Slick! Thanks

Thanks for sharing this Peter !

wow! Using touch on LED walls suddenly looks a lot easier!

Glad you like it, that’s one of the main uses I made it for!

CPU just pointed out to me that this tox/shader may not function correctly with pre-kepler GPUs. I still need to investigate, but I do recall running into issues regarding the new GLSL touch uniforms and my 485M when I was first playing with this (I’ve since upgraded so forgot about it).

Will report back later, but if your on a 500 series Nvidia or earlier you may have issues, so let me know.

Any updates with this Archo-P ?

I can get it to work with the primary background and two inputs; however, any additional inputs will cause all of the input TOPs to disappear. This is on a 580.

Thanks for the comp Peter works great!

I just made a simple change so you can set a custom resolution independent from the first inputs resolution and then be able to adjust the first input’s position and scale.

Instead of doing an over on the first iteration with the first input with itself I just inserted a conditional statement to null the over operation on the first loop.

Just replace outCol = inTex + ( outCol * (1.0 - inTex.a))
with

outCol = inTex + ( outCol * (1.0 - inTex.a)) * float((i != 0));

cheers
Keith

Thanks, great useful tool! This should be built-in :wink: maybe with some additional options like opacity.

Wow, just seeing this for the first time. So, so helpful. Thank you for sharing!

Hey everyone!

I needed a bit more out of my MultiComper recently so just decided to give it a little love and figured I’d button it up and get an update up here. The download is on the first post of this thread.

This is using all the fancy new Custom Parameter features that are in the experimental builds now. So this is only compatible out of the box with new builds. If you need the functionality for a build lower than 40000 you can certainly pull out the insides and control without custom parameters.

The component gives you direct control over 8 inputs as well as the ability to set an independent output resolution ( thanks Keith for the idea there!) and background color. Inputs have transform, scale and opacity controls. Everything is still just in over mode as my main purpose for this is laying out lots of TOPs in one frame, not blending them.

If you want to expand it to more inputs (32 is the current max in the actual shader), you simply need to add more inputs and replace the multisample channels ( transforms and levels). The labels for the transform channels should be in this order ( Tx, Ty, Sx, Sy) and be named such, or at least start with T and S.

In the interest of making it a little more geared to LED pixel mapping I’ve added a “Top Left Mode” which swaps the units so that typical LED processor coordinates can be inputted exactly. A useful setup for this is to put your “pixelmap” in the first input and then drive the level parameters of the rest of the layers with a single channel for pixel mapping.

As a bit of an afterthought I added an option for Fractional Translation, which just allows you to put a 0 - 1 translation value as a percentage across the output frame to move each input. Not sure if that’s all that useful, but its there.

Hope this is useful, please let me know if any glaring bugs are in there, I’ve only looked through it myself. Would love to see any adjustments people make as well!

Cheers
P

Peter, I still wanted to thank you for this, in the last half year I use this component almost every week in my projects somewhere and it saves me so much time. Your latest version is super useful to drop in a project for mapping multiple projectors and combining the image afterwards, or quickly dimming&testing one of the screens, or combining&positioning multiple layers of video very fast. I have it now standard on my usb on my keyring with all my other softwaretools to solve stuff on site if there is no internet.
It should be in palette.

Dank je wel !

@nettoyeur super glad to hear this comp is so useful to you! Thanks for the kind words!

I can’t get the Transforms CHOP channels working. Tried various channels named Tx and Ty but the first layer does not appear in the composite as soon as there is an input connected to the first CHOP input. I am using the multiImageComp.tox which is the 3rd of the 3 posted (It’s desciption seemed liked the most recent?)

Ben,

Thanks for looking at this.

I’ve made some fixes and posted a small update. What was happening is that once you put an input chop for the transforms that does not include the scale channels the scales go to zero I believe. I’ve fixed this so you can just send in a 2 channel chop for Tx/Ty. Also I’ve made it so that the order of the channels is what matters, not the names.

I updated the examples as well to show this usage.

Let me know if you think this is better!

Cheers
P