d13 Posted November 20, 2019 Share Posted November 20, 2019 Hi Everyone! I have a general question about displacement maps in v5. I've noticed that when the displacementSprite is added to the container, the effect scales to the entire container size, rather than just being constrained to the size of the sprite. Just checking whether is the the actual current behaviour or if I might be implementing it incorrectly? I did notice this post on using bounds to constraining the size of the effect, which works, but it also masks the rest of the sprites in the container: Cheers! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 20, 2019 Share Posted November 20, 2019 (edited) I dont actually remember whether scale is in normalized coords or pixel coords. https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters There are two ways we can solve that: 1. You wait for me to solve it 2. You learn about filter coordinate spaces, and why DisplacementFilter needs extra sprite and not just a texture. There's also the matter of "pixi-picture" plugin, i still didnt port it to v5, but it basically gives you ability to apply filter to background! DisplacementFilter is one of strongest selling points, we have to make it better! Edited November 20, 2019 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
d13 Posted November 20, 2019 Author Share Posted November 20, 2019 Ah, thanks Ivan!! I love the "Wait for you to solve it" solution So, is a demo like this not currently possible in Pixi v5 out-of-the-box? https://pixijs.io/examples/#/filters-basic/displacement-map-crawlies.js Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 20, 2019 Share Posted November 20, 2019 (edited) It is out-of-the-box Whats the problem? I just didnt understand what you want to do and assumed we have problem with scaling > Ah, thanks Ivan!! I love the "Wait for you to solve it" solution I write it to encourage people to solve everything themselves. Its a bitter option. Edited November 20, 2019 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
d13 Posted November 21, 2019 Author Share Posted November 21, 2019 My problem has been that the displamentFilter effect hasn't been scaling to the size of the displacementSprite, it's been scaling to the size of the entire container that the filter is added to. I'm probably doing something wrong! I will check my code and report back Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.