5 Replies Latest reply on May 4, 2010 4:18 PM by roger.gonzalez

    Nested If...Else blocks in PixelBender Kernel Don't Work in Flash Player?

    gloam

      I'm writing a kernel which has a several conditional steps.  It contains a structure like the following:

       

      if(condition)

      {

      dst = outputA;

      }

       

      else

      {

       

         if(anotherCondition)

         {

            dst = outputB;

         }

       

         else

         {

       

            if(yetAnotherCondition)

             {

                dst = outputC;

             }

       

            else

            {

               dst = outputD

            }

       

         }

       

      }     

       

       

       

      I realize that this is a bit ugly, and that conditionals are already less than ideal for a kernel (and nested conditionals even less ideal), however, it does seem to work in the PixelBender Toolkit environment itself when I run the filter.  It will also export as a pbj for Flash without any objections from the Toolkit.  However, when I run the filter in Flash it seems to do... nothing.  When I strip out the nested conditionals, I will at least see the first if / else level working, but with nested conditionals, everything seems to be ignored and the kernel doesn't run at all within Flash Player. 

       

      Is this a bug?  Has anyone else successfully used nested conditional blocks in a PixelBender kernel running inside Flash Player?