PixelBender Runtime Compilation

Tinic posted today his PixelBender assembler and disassembler. This makes me happy, because now I can post an experiment I could not show for a while.

If you know PixelBender, than you know that you can not create loops. What you could do is unroll all constant loops with a fixed length. If you know simple convolution filters like a blur, you know that you need an xy-loop and you know it should not be possible with PixelBender at all. Let me prove you wrong and have a look at dynamic loop unrolling with PixelBender (be careful with high values!).

I built a library to assemble and disassemble PixelBender kernels at runtime. I wrapped it also in a high level API so basically you can create a new Kernel by doing var kernel: Kernel = new Kernel();. Then when you need your shader as a ByteArray you simple call kernel.compile(). There are still some glitches here and there but I hope that I can release the source code pretty soon.

Related Posts

9 Responses to “PixelBender Runtime Compilation”


  1. 1 Matt Poole

    Wow, this sounds great! Really looking forward to the release.

    Matt

  2. 2 D

    You are really pushing flash forward … this stuff is absolutely awesome

  3. 3 Frank Reitberger

    nice joa,

    i also saw tinic“s blogpost and yeah, that rocks.

    just some quick thoughts to this filter… especially this shader seems to me as you could use it as pbj. several times ( this.image.filters = [ shader1 (x-axis), shader2 (y-axis), ...] a.s.o. ?

  4. 4 joa

    You could do this probably. Altough it is much cooler (and more performant) to have the real loop and unroll it at runtime :)

  5. 5 Frank Reitberger

    sure it is… =)

  6. 6 Rezmason

    I wonder why Adobe hasn’t included in Flash 10 the ability to compile or decompile a pbj file. It’s not the same as decompiling a SWF- they might as well include the functionality.

    Great going, though, figuring it out for yourself! :)

  7. 7 mud

    Wow! That’s great, can’t wait to see the results :)

    Any word on when you might be ready to release the source?

    Thank you so much for your contributions.

  8. 8 Janosch

    Hi Joa, cool idea!
    Are you planning to make the source-code available in the near future?
    Is the input for your compiler compatible with Tinic’s assembler code?

    Happy new year
    Janosch

  1. 1 localToGlobal » Blog Archive » news review -> 37th week of 2008

Leave a Reply






Close
E-mail It