ShaderFilter on Sprites

Hi,

I’ve been experimenter with the new ShaderFilter, to see if it could be used for post-processing frames. What I was thinking was, after having added all children to the top level DisplayObjectContainer, then using shaders to add effects to the resulting frame. But it looks like those effects will affect only the graphics of that Sprite. Is there any way to do this using a Sprint or will I always have to skip the flash API, and create frames as a BitmapData object, or use an OpenGLView?

Thanks,
Marco Lopes

We have support for only individual objects at the moment – we will need to use cacheAsBitmap in the future as a flag for rendering to an intermediate OpenGL framebuffer in order to perform a post-process on more than object at once (effectively “flattening” it)

1 Like

Do you already have idea on when this cacheAsBitmap flag would be implemented? Just to know if it is a question of days, weeks, months… :wink:

Sure, it was added more than a year ago by me. For some reason the support was removed with the release of OpenFL 4. The last version it works is OpenFL 3.6.1 and Lime 2.9

OK Thanks. Did OpenFL 3.6.1 already supported custom shaders? Because I would like to use a custom shader (with shaderfilter) on a group of sprites and cacheAsBitmap seems the way to go

Yes, here are some samples https://github.com/openfl/openfl-samples/pull/33

2 Likes