2 Replies Latest reply on Nov 25, 2008 12:11 PM by mgazzo

    PB kit and FP10 produce different results

      I tried out Ryan Taylor's HSL filter:


      using PBK 1.0.350192, build 35, Flex SDK and Flash Player 10,0,12,36 debug version on a MacBook Pro 4,1 with 2.5 GHz Intel Core 2 Duo and GeForce 8600M GT.

      I don't get the same result in PBK and FP10 when passing an image through the filter. In PBK output and input are as expected equal when no transformations are applied (all parameters are set to zero) but not when running it in FP10!

      Is anyone able to reproduce this? Does anyone have an idea what could cause this? In my case it seems that green color values systematically are mapped to the red channel.
        • 1. PB kit and FP10 produce different results
          BrianRonan Level 1
          You're not crazy. I'm seeing it too.

          In the Flash runtime, it looks like the min/max functions are changing the parameters passed into them. This is causing all sorts of havoc since that value is being used later on in some more color calculations.

          In other words, try replacing:
          samp = sampleNearest(source, outCoord());
          sampMin = min(samp.r, samp.g);
          sampMin = min(sampMin, samp.b);
          sampMax = max(samp.r, samp.g);
          sampMax = max(sampMax, samp.b);


          samp = sampleNearest(source, outCoord());
          float4 newSample = samp;
          sampMin = min( newSample.r, newSample.g);
          sampMin = min(sampMin, newSample.b);
          sampMax = max( newSample.r, newSample.g);
          sampMax = max(sampMax, newSample.b);

          In the .pbk file, and give it another go. Good catch by the way!

          I'll make sure we get this issue filed and looked at.
          • 2. Re: PB kit and FP10 produce different results
            mgazzo Level 1
            Thanks for the quick response. It seems that you are right about the min/max functions but I had to replace the functions entirely with my own conditional statements before it worked. Copying the sample value into a new temporary variable was not enough in my case.