robojiannis

implementing pixi-v4 filters in phaser 2

Recommended Posts

Hi,

I'm trying to implement the pixi-v4 filters in phaser 2 (CE Version). 

I'm especially interested in this one: https://github.com/pixijs/pixi-filters/tree/master/filters/zoom-blur

I've noticed this example (http://phaser.io/examples/v2/filters/pixi-filter) in phaser 2 is outdated/not working (link to pixi filter is wrong). Even when i fix the link (e.g. https://github.com/photonstorm/phaser/blob/v2.6.2/filters/pixi/RGBSplitFilter.js) the filter gives an error because pixi is not included.

So I'm wondering what is the right method to do it. 

 

I guess the main questions here are:

Thanks!

 

Share this post


Link to post
Share on other sites

I actually made some progress. The filter is now running without throwing any errors, but nothing is visible below (although things are there; i tested by applying the filter to one sprite only instead of the game.world)

Here's the filter:

https://gist.github.com/robojiannis/bd31ab833aec776791f9bcae62e123b8

and i call it like that:
f = new Phaser.Filter.ZoomBlur(game);
f.strength = 0.1;
f.innerRadius = 80;
f.radius = 1;
f.center = [500,300];

game.world.filterArea = new Phaser.Rectangle();
game.world.filters = [f];

 

any clues?
 

Share this post


Link to post
Share on other sites

 

Added the filter to a sprite of the phaser logo. It did something alright. Changing the filter properties didn't seem to do anything whats so ever. I have little to no knowledge with shaders, so i have no idea whats going on.

image.png.6945c8cdc9d6335d7a21725516f4bc9b.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.