Tag Archives: open source

Faster Array Sort in Javascript

Introduction :

Based on Eugene(inspirit) post about Faster Array Sort function in Flash, I ported his test code into javascript.
First of all, I’m mainly using JS for scripting into Adobe After Effects, Photoshop, … but not so much for web anyway. That being said I’m not a javascript guru, so bare with me if I did mistake, I took his code and just changed it a little bit so it would work in JS.

I still can’t make the “Flash Sort” (which seems to be the fastest one on AS) to work w/ JS. I don’t know what I’m doing wrong, if anyone has an idea ?

[UPDATE] Thx to MrDoob, “Flash Sort” works now !! I also add the check function and it seems some sorting still not working quite well.


Download Source Code :



Stats


Firefox

*******************************************
*******************************************
INFO
10 000 elements
User-agent header: Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729; .NET4.0E)
——————————————————————–

JS BUILD IN SORT
Time : 18 ms
Sorting is OK
——————————————————————–

QUICK SORT + INSERTION SORT
Time : 9 ms
Sorting is wrong
——————————————————————–

3 WAY QUICK SORT
Time : 11 ms
Sorting is wrong
——————————————————————–

NON RECURSIVE QUICK SORT
Time : 15 ms
Sorting is OK
——————————————————————–

OPTIMIZED NON RECURSIVE QUICK SORT
Time : 16 ms
Sorting is OK
——————————————————————–

NON RECURSIVE QUICK SORT 2
Time : 13 ms
Sorting is OK
——————————————————————–

FLASH SORT
Time : 6 ms
Sorting is OK
——————————————————————–

IE 8

*******************************************
*******************************************
INFO
10 000 elements
User-agent header: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Tablet PC 2.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
——————————————————————–

JS BUILD IN SORT
Time : 88 ms
Sorting is OK
——————————————————————–

QUICK SORT + INSERTION SORT
Time : 34 ms
Sorting is wrong
——————————————————————–

3 WAY QUICK SORT
Time : 47 ms
Sorting is wrong
——————————————————————–

NON RECURSIVE QUICK SORT
Time : 49 ms
Sorting is OK
——————————————————————–

OPTIMIZED NON RECURSIVE QUICK SORT
Time : 42 ms
Sorting is OK
——————————————————————–

NON RECURSIVE QUICK SORT 2
Time : 49 ms
Sorting is OK
——————————————————————–

FLASH SORT
Time : 30 ms
Sorting is OK
——————————————————————–

Chrome

*******************************************
*******************************************
INFO
10 000 elements
User-agent header: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3
——————————————————————–

JS BUILD IN SORT
Time : 13 ms
Sorting is OK
——————————————————————–

QUICK SORT + INSERTION SORT
Time : 4 ms
Sorting is wrong
——————————————————————–

3 WAY QUICK SORT
Time : 3 ms
Sorting is wrong
——————————————————————–

NON RECURSIVE QUICK SORT
Time : 3 ms
Sorting is OK
——————————————————————–

OPTIMIZED NON RECURSIVE QUICK SORT
Time : 3 ms
Sorting is OK
——————————————————————–

NON RECURSIVE QUICK SORT 2
Time : 3 ms
Sorting is OK
——————————————————————–

FLASH SORT
Time : 3 ms
Sorting is OK
——————————————————————–

Adobe After Effects

*******************************************
*******************************************
INFO
10 000 elements
OS : Windows Vista 6.0 Service Pack 2
——————————————————————–
JS BUILD IN SORT
Time : 291 ms
Sorting is OK
——————————————————————–
QUICK SORT + INSERTION SORT
Time : 237 ms
Sorting is wrong
——————————————————————–
3 WAY QUICK SORT
Time : 251 ms
Sorting is wrong
——————————————————————–
NON RECURSIVE QUICK SORT
Time : 287 ms
Sorting is wrong
——————————————————————–
OPTIMIZED NON RECURSIVE QUICK SORT
Time : 250 ms
Sorting is wrong
——————————————————————–
NON RECURSIVE QUICK SORT 2
Time : 298 ms
Sorting is OK
——————————————————————–
FLASH SORT
Time : 281 ms
Sorting is wrong
——————————————————————–

Pixel Bender : “ft-Filmic Contrast” for After Effects

Introduction

A one slider plugin that gives a very compelling filmic contrast “look” to your footage.  Partially based on Ken’s Perlin Gain function & Roy Stelzer’s presentation



Download & Sources


How to install it ?


Just copy the .pbk file into your “Support Files” folder in your AE install directory

Donate

How to convert a Lightprobe into the 9 spherical harmonics coefficients

Here is a tutorial on how to convert your own Light Probe into the 9 coefficients needed into my ft-SSIBL plug-in (Screen Space Image Base Lighting).





Links :




I’m sorry for the poor sound, I hope you will still be able to understand !

Pixel Bender : ft-ColorGray shader for After Effects



Introduction

This shader will color an image based on a second input. I did it because I wanted to change grayscale into a variety of colors with a gradiant.



Download & Sources



How to install it ?


Just copy the .pbk file into your “Support Files” folder in your AE install directory



Donate


Pixel Bender : ft-CombineRGBA for After Effects


Introduction

This really simple shader let you combine 2 inputs channel into a new one. There is already something like that in AE, but I believe it is only working in 8 or 16 bits. This one is working in 32 bits (thx pixel bender). I just did it because sometimes I do need to combine map datas (as normal map & height map) for my shaders, since Pixel Bender is limited to 2 inputs.



Download & Sources



How to install it ?


Just copy the .pbk file into your “Support Files” folder in your AE install directory



Donate


Pixel Bender : ft-SSIBL (Screen Space Image Base Lighting) shader for After Effects


Introduction

ft-SSIBL for “Screen Space Image Base Lighting” is based on a topic I covered in a previous post about Roy Stelzer’s “2.5D Relighting inside of Nuke”.  In this shader I tried to reproduced a few approach found in his Nuke script. So with a Normal pass (object or world), you will be able to do some relighting with a HDR map. The shader won’t compute the 9 coefficients (spherical harmonics) needed for you as describe in this paper : http://graphics.stanford.edu/papers/envmap.

The default value are from the Grace Cathedral, San Francisco Lightprobe http://www.debevec.org/Probes/


Download & Sources

I will for sure add more feature to this one in the future, so come back check it out


How to install it ?


Just copy the .pbk file into your “Support Files” folder in your AE install directory


How to use it ?


How to convert a Light probe into the 9 spherical harmonics coefficients ?



Here is the tutorial


Donate


Pixel Bender : ft-UVPass shader for After Effects


Introduction

This shader let you re-texture your rendering directly in After Effects. It use a UV pass as default input and a texture as second input. UV pass could be render from pretty much any 3d package.


Download & Sources



How to install it ?


Just copy the .pbk file into your “Support Files” folder in your AE install directory


How to use it ?




Donate


Pixel Bender : ft-2-strip technicolor & ft-3-strip technicolor shader for After Effects


Introduction

Those two shaders try to mimic Martin Scorsese’s The Aviator movie effects. The codes are based on snippet found on VFXTalk.com, Blender source code & Aviator VFX behind the scene website.

UPDATE : Now ft-2-strip technicolor & ft-3-strip technicolor as merged to a one filter called “ft-Technicolor”

Download & Sources


How to install it ?


Just copy the .pbk file into your “Support Files” folder in your AE install directory


Donate


Rotating Normals from a Normal pass

RotateNormal is a  group node inspired from Roy Stelzer (2D TD at Double Negative) “2.5D Relighting inside of Nuke” presentation.

This node setup allow you to offset your normal pass on the X,Y,Z axis. It could be use for several cases (relighting is one of them for sure, so I thought I would share this node. All you have to do, is to “Append” this node in your blend file and your are done. It use a normal pass as input, and would output the new normal pass.

Feel free to use it as much as you want :)

Download RotateNormal Blend File