Pryme8 Posted October 19, 2017 Share Posted October 19, 2017 I am working on a tilemap shader for babylon and was wondering how does Pixi handle animated tiles? Does anyone have the link to the shaders used by Pixi? http://pryme8.github.io/tiles/ really rough demo, but will give you and idea of how I have it set up if anyone has any suggestions on how to add animation support. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 19, 2017 Share Posted October 19, 2017 PIXI doesn't have tilemaps out-of-the-box. You have to be more specific. There are animations on shader side for RpgMaker MV, at https://github.com/pixijs/pixi-tilemap , but its made only for RMMV and you have to actually modify that plugin if you want to make better animations. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted October 19, 2017 Author Share Posted October 19, 2017 hmm, Im mainly just looking for ideas on how to handle tiles with animations. I am thinking of using the last two open channels I have in the texture that I am sampling (blue and alpha are still unused) could control the animations somehow but I am not sure, and honestly think I would need to keep those channels for collisions and event triggers for the management side not the shader. I was hoping just to see how different 2d engines handle their shaders. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 20, 2017 Share Posted October 20, 2017 You can use custom shaders with pixi-v4 but its not that easy. You need your own renderer plugin: https://github.com/pixijs/pixi-plugin-example . If you name something "myPlugin" , you can specify "sprite.pluginName = 'muPlugin'" and shader will be set. One more example of custom plugins: pixi vanilla TilingSprite https://github.com/pixijs/pixi.js/tree/dev/src/extras/webgl If you need batched multi-texture renderer like vanilla pixi SpriteRenderer, that's worse. you need hacks like these: https://github.com/gameofbombs/pixi-heaven/tree/master/src/base/webgl https://github.com/gameofbombs/pixi-heaven/blob/master/src/twotint/sprites/SpriteHeavenRenderer.ts That plugin adds two-color tint to sprites. If you need a filter, that will render whole container in temporary buffer and applies something to it, better read https://github.com/pixijs/pixi.js/wiki/v4-Creating-Filters All those difficulties exist because pixi-v4 is over-optimized and some things weren't pushed to public API Yes, its fast, but you have to learn of pixi architecture before you use custom shaders. 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.