Proposal (work-in-progress): extended filter system features
See original GitHub issueOur team has uses a modified version of pixi.js’s FilterSystem
. We are adding new features that might be useful to other users, and we were looking to know if this would be accepted into the main codebase or as a plugin.
pixi-extended-filter-system
package repo is here: https://github.com/phase-software/pixi-extended-filter-system/tree/master/src
Currently, we have added these feature(s):
-
measure
pass: pixi.js has two options for the input frame given to a filter - the “object + padding” or its intersection with the screen. There is no intermediate. This can cause performance problems, sinceautoFit=false
filters needlessly apply on the whole object. By allowing the filters to measure their required input, we eliminate this issue. (Note: the input is never outside the object being rendered, and this is enforced in our repo). -
returning a texture other than output: In multi-pass filters like the kawase-blur, passes are done in a flip-flop basis. If the number of passes are even, then we cannot use the input & output textures to do the passes (since we would end on the input texture). If we allow filters to return output textures (other than the given output texture), we could eliminate extra texture allocations in filters like the drop-shadow & blurs. Of course, sometimes we cannot change the output texture (like in the case of the very last filter, which applies to the screen). We can specify whether returning an alternative output texture Is allowed with a filter-manager property.
-
providing a custom geometry to
FilterSystem#applyFilter
. -
pipeline support: in order to simplify building multi-pass filters, we should create an API that allows filters to change the input/output for each pass.
Sidenote: I would like to reference this issue from pixi-filters
, and ask that pixi devs consider allowing that feature into the pixi-filters
codebase: https://github.com/pixijs/pixi-filters/issues/231
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
You are on a right path. I have custom FilterSystem that has second feature.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.