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.

10 Responses to “PixelBender Runtime Compilation”


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

    Matt

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

  • 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. ?

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

  • 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! :)

  • 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.

  • 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

  • Hi Joa,

    This is awesome! I was just thinking about writing this same thing for a project I’m working on. What is the status on releasing the source code? Any way you can send me what you have? Thanks!

    -James

  • Hey,

    Nicolas has released a much better version of the PBJ compilation in haXe already.

Leave a Reply