Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Super Simple GLSL multi comper/mover

Share your components here. First one to 100 wins!

Super Simple GLSL multi comper/mover

Postby archo-p » Wed Jan 08, 2014 5:03 pm

** 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.
Attachments
multiImageComp_examples.tox
Simple examples for version 2, Nov. 2015
(7.19 KiB) Downloaded 509 times
multiImageComp.tox
Version 2, Nov 2015, fixed input channels
(3.73 KiB) Downloaded 393 times
multiImageComp_v1_old.tox
Previous version 1, from Sept 2015, broken input channel functionality
(3.28 KiB) Downloaded 234 times
multiImageComp_v0_old.tox
This is the previous uploaded version
(2.2 KiB) Downloaded 304 times
Last edited by archo-p on Mon Nov 30, 2015 2:00 am, edited 6 times in total.
User avatar
archo-p
 
Posts: 463
Joined: Thu Nov 19, 2009 3:03 pm
Location: Los Angeles

Re: Super Simple GLSL multi comper/mover

Postby najrock » Mon Jan 20, 2014 5:32 pm

:shock: this is amazing
najrock
 
Posts: 59
Joined: Tue Apr 10, 2012 2:12 am

Re: Super Simple GLSL multi comper/mover

Postby emintzer » Mon Jan 20, 2014 7:06 pm

Slick! Thanks
emintzer
 
Posts: 160
Joined: Thu Aug 30, 2012 11:30 am

Re: Super Simple GLSL multi comper/mover

Postby cyberpatrolunit » Mon Jan 27, 2014 7:24 pm

Thanks for sharing this Peter !
cyberpatrolunit
 
Posts: 32
Joined: Sat Oct 03, 2009 2:30 pm
Location: San Francisco

Re: Super Simple GLSL multi comper/mover

Postby drazkers » Sun Feb 02, 2014 9:21 pm

wow! Using touch on LED walls suddenly looks a lot easier!
drazkers
 
Posts: 13
Joined: Wed Jan 23, 2013 2:55 am
Location: FOH

Re: Super Simple GLSL multi comper/mover

Postby archo-p » Mon Feb 03, 2014 12:36 pm

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.
User avatar
archo-p
 
Posts: 463
Joined: Thu Nov 19, 2009 3:03 pm
Location: Los Angeles

Re: Super Simple GLSL multi comper/mover

Postby cyberpatrolunit » Mon Feb 24, 2014 4:49 pm

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.
cyberpatrolunit
 
Posts: 32
Joined: Sat Oct 03, 2009 2:30 pm
Location: San Francisco

Re: Super Simple GLSL multi comper/mover

Postby keithlostracco » Mon Mar 10, 2014 11:12 pm

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
Code: Select all
outCol = inTex + ( outCol * (1.0 - inTex.a))

with
Code: Select all
outCol = inTex + ( outCol * (1.0 - inTex.a)) * float((i != 0));


cheers
Keith
keithlostracco
 
Posts: 835
Joined: Tue Dec 09, 2008 2:39 pm

Re: Super Simple GLSL multi comper/mover

Postby vinz99 » Thu Apr 17, 2014 6:07 pm

Thanks, great useful tool! This should be built-in ;) maybe with some additional options like opacity.
vinz99
 
Posts: 363
Joined: Wed Apr 15, 2009 10:34 am

Re: Super Simple GLSL multi comper/mover

Postby L05 » Tue Mar 03, 2015 10:10 pm

Wow, just seeing this for the first time. So, so helpful. Thank you for sharing!
User avatar
L05
 
Posts: 193
Joined: Thu Jan 05, 2012 2:36 pm
Location: Detroit, MI

Next

Return to Shared .tox Components

Who is online

Users browsing this forum: No registered users and 1 guest