4 Replies Latest reply on Apr 17, 2015 11:45 PM by flexmotion

    Shaders work fine on desktop+android+playbook, but not on iOS

    exodark

      Hi, I'm attempting to apply shaders to images with my app. It works great on the desktop, on android devices, and on my blackberry playbook. But on my iPad, it will not work at all.

       

      sample:

      [Embed(source="filter.pbj", mimeType="application/octet-stream")]

      private var filterKernel:Class;

       

       

       

      private var shader1:Shader = new Shader( new filterKernel);

      private var sFilter1:ShaderFilter = new ShaderFilter( shader1 );

      image1.filters = [ sFilter1 ];

       

      At first, I thought maybe iOS had some problem embedding the filter.pbj, so I tried a built-in filter (ColorMatrix). This didn't work, either. No effect on the image at all.

       

      So then I thought maybe the problem was applying these filters at run-time, so I set the embedded (custom) filter from the mxml - Didn't work.

       

      HOWEVER: I tried this same method with the colormatrix (built-in filter), and it was applied to my image at start-up! But if I took away the filter and tried to re-apply it at runtime, it does nothing at all.

       

      My question is this: Has anyone else had this type of problem with Shaders or ShaderFilters from flex on iOS before?

       

      The fact that the built-in filters don't cooperate at runtime either leads me to believe this isn't an Embed problem OR a pbj-related issue, btw.

       

      Other things I have tried:

      Redrawing the image once the filter has been applied

      Creating a new project and trying out a filter (in case the settings got messed up)

      Any help on this would be greatly appreciated.

       

      Message was edited by: exodark