wonlab Posted July 10, 2018 Share Posted July 10, 2018 I just want to calculate shader once and use texture that applied shader. is there any way to solve it? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 10, 2018 Share Posted July 10, 2018 https://pixijs.io/examples/#/basics/render-texture.js https://pixijs.io/examples/#/filters/filter-mouse.js This question is asked too often and people dont like to search it, so my comment is very small : renderTexture+filters. There's no complete guide on it, you have to experiment with this thing and stumble across bugs There's big article on how to avoid problems with filters: https://github.com/pixijs/pixi.js/wiki/v4-Creating-Filters Yes, its not a newbie material, prepare to suffer. Quote Link to comment Share on other sites More sharing options...
wonlab Posted July 10, 2018 Author Share Posted July 10, 2018 I am worrying about that when render method call, the texture will calculate on shader every time. I just want to make static texture that calculated texture. should I use canvas api? thanks. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 10, 2018 Share Posted July 10, 2018 you should call render with your supposed container with filter as first parameter and renderTexture as second. Call it one time when you construct the texture. Yeah, if you know how to do something in canvas 2d context, you can do that and use "Texture.fromCanvas()". If you need webgl api, its betetr to use pixi filters, or you'll have problems with wrong states of renderers. 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.