Jump to content

Problem with BulgePinchFilter and off screen graphics


Agen0
 Share

Recommended Posts

Hi!

I have been working on a particle simulator with gravity and a grid. Currently it looks like this:

without.png


I was thinking of adding a gravitational space-time like bending effect. It seemed like the BulgePinchFilter filter, that comes with the pixi-filters package could be a good solution for this. So I made it such that this pinch effect is applied on the grid at every particles position. The more mass the particle has the more it should bend as well.

The result looks more or less what I expected:

with.png


It does get blurry when there is a lot of gravity, but I suppose its because the pixels are just getting stretched out, fair enough.

The real problem, though, starts when this effect happens near the edge of the screen, like this:

withproblem.png

 

As you can see it is not actually bending things into view from outside of the viewport, but instead stretching the pixels at the edge of the screen.

To emphasize this effect even more this is what happens when a line happens to be right at the edge:

withproblemfilled.png

 

Could this be related to the autoFit property on each filter? When I turn that off for each of the pinch points everything gets very slow and the effect seems messed up - bending positions and strengths are wrong and the grid disappears when I zoom in. In other words I have no idea what I am doing with that, but it might be related.

Does anyone know of any efficient and simple solution though? Is there some way to add some sort of padding to the edges of the view so that the bending filter would "know about" graphics outside the view so it could bend it into view?

Any help would be welcome. This one has been bugging be for a while.

Link to comment
Share on other sites

  • Agen0 changed the title to Problem with BulgePinchFilter and off screen graphics

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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...