6 Replies Latest reply on Jan 5, 2009 6:41 PM by Daniel Rinehart

    Can't export to flash

    the chuck
      I am trying to export a pixelBender program into the flash-compiled format and it is unable to do this. here is the code: Yes, it compiles. Even weirder, when I import two images and press "run", it says "this kernel is too complex for your graphics card", and I'm on a MacBook Pro 2.33ghz 3gb ram, with an ATI radeon X1600
        • 1. Re: Can't export to flash
          AIF Bob Level 3
          This looks like you are hitting a bug in the compiler - the filter shouldn't compile at all. All of the lines involving modifier[ 0 ] and wave[ 0 ] are incorrect, instead use:

          sampleNearest( modifier, outCoord() )[ 0 ]

          or

          sampleNearest( wave, outCoord() )[ 0 ]

          The compiler shouldn't allow you to index into an image like that. Thank you for letting us know about this - I'll file a bug.
          • 2. Re: Can't export to flash
            the chuck Level 1
            Are there any tutorials that explain how to use PixelBender for purely number crunching? Tinic's blog offers little to no insight, though replete with incomplete examples..

            particularly passing variable values to parameters from AS3 to the filter. I'm certain a lot more people would use the tool for AS3 if they were shown how to use it properly.
            • 3. Re: Can't export to flash
              Daniel Rinehart Level 1
              What is an example of the type of generic number crunching you are looking to do?
              • 4. Can't export to flash
                the chuck Level 1
                I have built a very basic synth in AS3, and I want to put the 4-pole lowpass filter into a pixelBender filter to offload some of the processing.

                Here's what it looks like in AS3. this is the function that's called when the audio buffer comes looking for samples:

                http://matkat.tringali.org/misc/VisualFUN/Sawtooth/Sawtooth.html
                • 5. Re: Can't export to flash
                  the chuck Level 1
                  I'm wondering if things like counters are possible in PixelBender. This function ramps from 0 to 1, and cycles back to 0. it creates a sawtooth wave:

                  private var counter2 = 0;
                  private function sawTooth(c:Number, f:Number):Number
                  {
                  if ( (c + f) > 1) {c = c - 1;}
                  c = c + f;
                  counter2 = c
                  return 2 * (c - Math.floor(c + 0.5))
                  }

                  private function looper()
                  {
                  for (var i:int = 0; i < 1000; i++)
                  {
                  sawTooth(counter2, 220/44100);
                  }
                  }

                  As you can see, it increments from 0 to 1 in steps of 0.0049886, so it's basically going to loop around about 5 times.

                  Is it possible to do the sawTooth() in PixelBender? it updates a counter on every call to the function. There are maybe one or two tutorials out there about using pixelBender for number crunching, and none of them are very specific on the subject.
                  • 6. Re: Can't export to flash
                    Daniel Rinehart Level 1
                    I can't help but think that this type of generic number crunching would be better suited for Alchemy.