-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post FX Blur With Mask on Graphics Loses Position/Scale on Resize #6794
Comments
I just attempted to write my own Blur PostFXPipeline and shader to try to hack around this and ended up with the same issue. |
This issue has been mentioned on Phaser. There might be relevant details there: https://phaser.discourse.group/t/possible-bug-blur-post-fx-moves-on-resize/14198/4 |
Update: I think I found the issue. I created my own postFX Blur pipeline and added this to it:
Now the issue is fixed, when I use my pipeline. I think something similar will need to be done in Phaser's blur postFX pipe. |
"Friend, do you have a complete and correct code example using masks? There is a bug in the default 3.80.1 version, but not in 3.552. How did you solve it?" |
I had to write my own BlurFXPostPipeline. I am not an expert on shaders and still very new, so it could be optimized better and more variables could be added. This is what I wrote:
You add it to your scene like so:
Finally I had to add this to my scene to ensure it updates properly on resize. Change
|
Edit: Sorry, did not mean to close it. (Accidental click!) |
That's great to hear! Even if you're not fully sure how to use it yet, it's always a good idea to give it a try yourself. After all, everyone starts as a beginner in new things. |
Just to say this issue was fixed in v3.85 Beta 2. Thank you for submitting this issue. We have fixed this and the fix has been pushed to the |
Version
Description
I am creating a mask and applying it to a black overlay. The mask is created from a polygon created via Graphics.
I have the scale mode set to RESIZE. I am noticing that the graphics itself (from which the mask is created) moves/resizes as expected when the window resizes, but the blur effect is not, when the window is resized.
Example Test Code
I was able to recreate with the following: https://jsfiddle.net/942yz5d1/1/
You can see that when you resize the window it warps the polygon.
Additional Information
Please let me know if I am misunderstanding how to use the PostFX! But it does seem like this is a bug, as I would expect the blur on masks to be included in the resize as well? I have tried a number of workarounds such as clearing the postFX on resize, recreating it, etc., and haven’t found one yet. Turning off the blur, the polygon stays the same as expected.
The text was updated successfully, but these errors were encountered: