Pixel Bender and aeUIControls
Posted on 05. Sep, 2009 by Jerzy Drozda Jr in Blog
After publishing Introduction to Pixel Bender tutorial where I showed you guys how to build a simple cropping plugin I got a lot of emails and comments asking specifically how to create certain types of parameters in Pixel Bender code that show up in After Effects as Angle Control, Checkbox and other UI elements, so I’ve decided to create this small list for you to help you out with this. If you don’t want to read the entire post just download the provided zip for some examples.
Download: UI Controls Demo (After Effects CS4)
Basic controls
Here’s a list of basic user interface controls that look pretty much the same as expression controls.
- Angle Control
You don’t need to set upminValueandmaxValueattributes, because they are ignored in this case. Besides it wouldn’t make much sense, would it?parameter float myAngle
<
defaultValue: 0.0;
aeDisplayName: "My Angle";
aeUIControl:"aeAngle";
>; - Checkbox Control
Checkbox only returnstrueorfalsevalues (on and off), so it also does not needminValueandmaxValueattributes.parameter bool myCheckbox
<
defaultValue: false;
aeUIControl: "aeCheckbox";
aeDisplayName: "My Checkbox";
>; - Color Control
This is valid as afloat3andfloat4variable type, however After Effects usesfloat4data type (RGBA). Even though the color picker dialog does not allow you to define the alpha value of the color you’re defining it makes much sense to use thefloat4instead offloat3. DefiningminValueandmaxValuealso makes no sense in here.parameter float4 myColor
<
defaultValue: float4(1.0, 0.0, 0.0, 1.0);
aeUIControl: "aeColor";
aeDisplayName: "My Color";
>; - Point Control
This is one out of two very specific controls. As you see in the code below it does not haveminValueandmaxValueattributes just like the examples above, but it’s also missing thedefaultValueattribute. Instead theresaePointRelativeDefaultValueattribute. The key word here is “relative” because the the values are not pixel coordinates. They represent a point that is relative to the image size. For instance, value offloat2(0.5, 0.5)would set the default position at the middle of the layer. However – this relative position is converted to pixel coordinates in After Effects and then those values are being used by your Pixel Bender code.parameter float2 myPoint
<
aePointRelativeDefaultValue: float2(0.0, 0.0);
aeUIControl: "aePoint";
aeDisplayName: "My Point";
>; - Slider Control
This is the most basic control you can have. No need to explain how it works. Just look at the code below. Explains itself.parameter float mySlider
<
minValue: 0.0;
maxValue: 100.0;
defaultValue: 0.0;
aeDisplayName: "My Slider";
>;
Additional controls
There are also some things that you can’t do with expression controls.
- Percent Slider Control
It works exactly the same as the regular slider, but the display format of the value is in percentage.parameter float myPercent
<
minValue: 0.0;
maxValue: 300.0;
defaultValue: 0.0;
aeUIControl:"aePercentSlider";
aeDisplayName: "My Percent";
>; - Popup Control
This you won’t find in the Expression Controls group. It creates a dropdown menu with the predefined values. String values are held in theaePopupStringattribute, but if you want to create anifstatement in your Pixel Bender code than treat it as a regular array and check against index values. In this example Red is 0, Green is 1, and Blue is 2. Remember to defineminValueandmaxValue.parameter int myPopup
<
defaultValue: 0;
minValue:0;
maxValue:2;
aeUIControl: "aePopup";
aePopupString: "Red|Green|Blue";
aeDisplayName: "My Popup";
>; - One Channel Color Color
I guess this one could be handy in some cases, but so far I had no use for it. This works and looks just like a slider with one difference: if you do not provideminValueandmaxValueattributes then they will be based on the bit depth of your project. I guess it could be used as a threshold parameter, but if you ask me it makes no sense. For 8bpc theminValuewould be 0, andmaxValuewould be 255. Ok. But in 32bpc I’d expect to be able to go beyond 1.0 on the slider (unlimitedmaxValue), however in order to do that I’d have to define theminValueandmaxValueon my own, and this defeats the purpose.parameter float mySingleColor
<
defaultValue: 0.0;
aeUIControl:"aeOneChannelColor";
aeDisplayName: "My Simgle Color";
>;
What about Layer Control?
Basically there isn’t one. In order to be able to pick another layer you need to create an additional source in the kernel. After Effects will allow you to use as many additional sources as you like, however Pixel Bender Toolkit only allows two sources, so you will only be able to test your code in After Effects. The big downside is that you can’t add any metadata for this additional source, so it will always show up in the user interface as “Input 2″, “Input 3″ and so on.
input image4 src1;
input image4 src2; // layer control - sort of...
output pixel4 dst;
How does it translate to graphs?
It’s all very similar, although it takes some time to figure out. Instead of listing all the parameters again in this post I’ve decided to give you two Pixel Bender files to look at. One is a simple kernel, and the other is a simple graph. Both of the files to exactly the same thing… nothing.










Tom Hauville
05. Sep, 2009
again, very awesome and useful info! I’m going to bet that the AE community sees a sudden flood of PB plugins, due to your efforts!
blankman
05. Sep, 2009
cool stuff, thanks a lot!
Dextrmania
05. Sep, 2009
Hey maltaannon to be honest with u i didnt like u the first time i checked out ur tutorials here but when i purchased MILG5….man,what r u?beleive it or not man,u r the best in after effects i wonder how good results u were scoring in maths in ur high school!!!
Keep it up man pls,keep it up….
AndrewYY
05. Sep, 2009
it’d be awesome if we could customize input2 with metadata (like aeDisplayName).
Jerzy Drozda Jr
05. Sep, 2009
Yeah. I know. Maybe in the next version.
Dextrmania
06. Sep, 2009
i have one question out of this topic maltaannon…its coz i think ur head is on this post that im asking u in this comment area.
can u wiggle the opacity of a layer so that it is opaque at some parts of the and transparent at the others?for example lets say we have many boxes lined up and arranged so they all fit in the composition size exactly(5*5).
can i randomly make their opacity change,but only from 0 to 100 so that they r not half opaque or so?and then use that as a mask.pls help me with this.
Jerzy Drozda Jr
06. Sep, 2009
Fractal noise + threshold
cheap handbags
09. Jul, 2010
notice me!
maximumrfan
01. Sep, 2010
Is it possible to bunch some controls into groups like say one group being angle controls, another group being some slider controls?
Chris Forrester
16. Feb, 2011
Great stuff just what I have been looking for. Some of the examples from the Pixel Blender manual have not been working for me or giving errors when I have copied and pasted them. Great to know there is this source of information that I know works.
Hope to be making my own small utility plugins soon!!
Just a shame I am behind the times on such a great tool.
Many Thanks!
-C
air max 2011
23. Jun, 2011
very good,look http://www.airmaxdiscount.net may get you a surprise.
air max 2011
09. Jul, 2011
perfect,more and more people like you post.
air max 2011
21. Jul, 2011
PERFECT,www.nikeairmaxdiscount.net
lar
23. Jul, 2011
I can’t believe how much I don’t know. Thank you give me more information on this topic you. I am really grateful and touched.
Name (required)
09. Aug, 2011
Thanks for your great post.I gonna be back definitely to check the new.
It is great that something interesting here could be found.Excellent work!
sac à main
27. Aug, 2011
Your essay is good, I like it very much. Here I would like to share with you some things
Replica Handbags: http://www.replicabagsell.com
dfvdrfe
03. Sep, 2011
From 1968,since the establishment of The North Face,the high quality feather winter jackets in The outdoor sports lovers enjoy great popularity,especially SIERRA PARKA by the love of the climbers down.SIERRA PARKA of winter coats series products originate in the 1970 s,so far SIERRA PARKA series winter clothes products are still in down and sales.
dsadaewed
03. Sep, 2011
Celine bags and the new arrivals of celine handbags are always designed by its creative director Phoebe Philo who wishes to express a contemporary minimalist style through these celine luggage series.Here is the celine 2011 bags for you.
green laser pen
05. Sep, 2011
Thanks for posting! I really enjoyed the report. I’ve already bookmark this article.http://www.elaserpen.com
マジコン
07. Sep, 2011
Thanks for great sharing with us,i will tell more of my friends about it
belstaff leather jacket
10. Sep, 2011
Thanks for great sharing with us,i will tell more of my friends about it http://www.belstaffleatheroutlet.com
moncler uomo
13. Sep, 2011
I bought a discount moncler uomo yesterday.
moncler men
13. Sep, 2011
Thanks for great sharing with us,i will tell more of my friends about it
moncler jassen
29. Sep, 2011
Come on. look at the moncler dames. Go to buy some.
sito moncler
30. Sep, 2011
I bought a discount moncler stivali yesterday.
Marius
01. Oct, 2011
Hi!
Very useful info, really helped me.
I would like to ask, like maximumrfan asked before, is it possible to create groups of controls? It would be really nice if you answer. Thank you.
Ken Griffey Shoes
08. Oct, 2011
Strong support from the pillars of the bridge would not fall a hundred years, tenacious support from the roar Benz rail train. Because they have benefited from the support structure of the triangle.
canada goose
15. Oct, 2011
Fashional canada goose just show yourself now.
cheap Canada Goose
18. Oct, 2011
your blog!
So shocking and great! Just one suggestionrvb fd
shuijin
18. Oct, 2011
http://shuijin0024.blog.163.com
ugg-schoenen
20. Oct, 2011
http://www.ugg-schoenen-nl.com Nieuwe uggs schoenen amsterdam
Moncler Jassen
20. Oct, 2011
http://www.jassenmoncleronline.com shop in Belgium. Kopen Moncler Jassen,jas,Polo,muts,laarzen,tassen,vest,truien online. tot 85% korting, gratis verzending! Modieus Heren|Dames|kinderen kleding jassen moncler online
2011 Hot Verkoop Stijl laarzen
26. Oct, 2011
http://www.outletuggsaustralia4z.com/2011-hot-verkoop-stijl-c-59.html 2011 Hot Verkoop Stijl laarzen
Moncler Online
27. Oct, 2011
Amsterdam jassen moncler dames online,
2011 Nieuwe moncler jassen online kopen,
Goedkope Moncler Dames Jassen,
Fashion kleding Winter moncler online winkel,
2011 Moncler Amsterdam verkoop,
Modieus jassen moncler online,
Fashion kinderen kleding Winter moncler kinderen,
Goedkope Moncler Heren Jassen,
http://www.jassenmoncleronline.com
Kopen Moncler Dames Heren Kinderen Jassen online! Kleding om te dragen Warm en comfortabel !tot 85% korting in winkel!
Fashion Moncler Jackets sale
01. Nov, 2011
Although the prom dress to change much with the tide of the time, that continues being one of the prm gown more popular in the world, that also the fashion between us.
tods on sale
04. Nov, 2011
prm gown more popular in the world, that also the fashion between us.
Red bottom shoes discout
04. Nov, 2011
During long distance jogging, in which sufficient shock absorption is important, the chances of personal injury with a inflexible feet plus athletic shoes with minor cushioning are wonderful.
Moncler down Jackets discount
09. Nov, 2011
After a while, my wife suggested to buy a silicone case for new cell phone. But my son refused to do so at once.
Mukluks Boots Sale
10. Nov, 2011
Thanks for great sharing with us!
Moncler Quincy
10. Nov, 2011
NICE FOR YOUR SHARING!
leopard uggs
10. Nov, 2011
I can’t believe how much I don’t know.
nike heels dunk
11. Nov, 2011
Today you wear high heels.
As for Women and jordan high heels, this is the inseparable relations, Tom Ford master evidence: “don’t wear the high-heeled shoes woman how talk up sexy?” High heels and sex appeal is relevant? The answer is: “of course!” The temptation of high-heeled shoes Wear women nike heels online in a split second sexy, charm and confident outbreak, twisting the waist is born swaying pose. High heels as if the women winning weapons, a pair of high-heeled heels, the increase absolutely is not only highly, but from the heart of the confidence and poise. Jordan heels in the fashion circle constantly with different fancy beauty attracts the eye, Cheap nike heels for women with protean, or sexy, or restore ancient ways, or luxury…… High-heeled shoes so attractive, how to choose a pair of suitable for your high-heeled shoes need to consider. The beauty of high-heeled shoes is, and can immediately figure, spin crus line, is from the vision think proportion more slender, make body curve has the ups and downs. Wearing high heels is really not comfortable shoes, but want to choose to the shoe, is no imagination in so uncomfortable, besides the point little pain, rather than it can bring the benefits of it, again calculate what? 4 to 6 cm high-heeled for you Somen famous Health experts found that wear the high-heeled shoes of 4 to 6 cm the most help to reduce weight, this highly heels can effectively consumption waist abdomen is adipose metabolic rate, let you of the lower abdomen flat, sexy! But often wear the high-heeled shoes of 4 to 6 cm, the biggest problem is that it will make your back pressure, produce acerbity keenly feel, suggest you are sleeping in a soft mattress, reduce back pressure. In addition, when the back muscles when stiff, which is easier to hit in the back of the bladder throughout the so that you will be feeling cold hands, reduced immunity. Suggest you don’t wear low back pack, lest back cold!!!!!
マジコン
18. Nov, 2011
great job!, good to read and agree with your words.thanks for great sharing with us,i will tell more of my friends about it .Very good article it was helped me to check once again.
moncler jassen
19. Dec, 2011
I am gonna to bookmark this page in order for future reference,Thank you for taking time and effort in researching and providing these blogs that are accepting guest posts and moncler jassen dames.
Rolex Watches Replicas
13. Feb, 2012
http://www.rolexwatchesreplicaae.com
rolex mens watches,rolex womens watches,rolex used watches,replica rolex watches
GHD IV Salon Style
15. Feb, 2012
But certainly, we understand the school has its reasons for having certain policies in place.”
ghd hair straightener sale
15. Feb, 2012
Hem cinch-cord save and lock all the heat your body produce! Shop now!
fendi pumps
20. Feb, 2012
cngg
pandora bracelets
23. Feb, 2012
Thank you for taking the time to publish this information very useful!I’m still waiting for some interesting thoughts from your side in your next post thanks These articles written too great,they rich contents http://www.uspandorabracelets.com
ferrari puma
29. Feb, 2012
Thanks very much, I have learned a lot from your post. Well done, really! also have a good train at http://www.ferraripumasale.com/.
puma canada
29. Feb, 2012
Blogger wrote this article is the embodiment of the contemporary trend, I benefited, also pls visit my website: http://www.pumashoescanada.com/, thx
mbt sale uk
29. Feb, 2012
The author is worth our respect, his articles make inspired me, my articles is http://www.mbtsaleuk.org.uk/, pls feedback
christian louboutin cheap
29. Feb, 2012
Through this article, I deeply understand the author’s soul, I think this article is beneficial, can inspire people,my links is http://www.christianlouboutincheap2012.com/ thx
puma cheap
29. Feb, 2012
Very good article, from which we can learn a lot of things, here also can be learned more from http://www.4pumashoes.com/.
abercrombie milano
13. Mar, 2012
I agree with most of your points, but a few need to be discussed further, I will hold a small talk with my partners and maybe I will look for you some suggestion soon..
replica sungasses cheap
04. Apr, 2012
http://www.replicasunglassescheap.com have a nice day
louis vuitton
26. Apr, 2012
a small talk with my partners and maybe I will look for you some suggestio
Adidas jeremy scott
26. Apr, 2012
Adidas jeremy scott is more influential world sports brand, unique style, high-quality products and a dynamic style has won the praise of customers. Thousands of varieties have more than one hundred kinds of brand sports apparel, adidas js wings all the best quality.jeremy in the scott continue their great fashion and art to bring us the most stylish design. There is no doubt that these sunglasses bring you more mysterious. And think this is your focus will be in the crowd.In recent years, sports shoes have been out of the dramatic performance, adidas wings and consumers hope that they look low-key. From the aesthetic look forward to these brands in China, an anonymous, jeremy scott wings,looks like everyone is the same. In addition, consumers want to say yes, they are citizens of the world, rather than athletes. Has a rich history, jeremy scott adidas these stories behind the traditional brand sports shoes, to meet customer demand in Europe and the United States. Adidas the originals hardland shoes with a low profile design, but they are the same fashion. Js Wings Shoes has a strong sense of personal style, and the mystery of the elusive, it shows the kind of spirit. Subtle design to production, Adidas jeremy scott is never outdated museum.Whether you’re out for a walk, buy jeremy scott adidas,or movement, you need a comfortable and appropriate shoes. There are all kinds of brand fashion shoes, shoes and all kinds of footwear for people of different ages.As well as a surprise, buy jeremy scott was to re-examine a web site. There is one final brand.
casque dr dre ferrari
13. May, 2012
men always like casque France Fournitures étudiants beats by dre.
dr dre beats lamborghini
13. May, 2012
if anybody like music power better visit casque beats by dre france.
beats cheap
13. May, 2012
ha ha a nine beautiful .