Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

animated tiles.


Pryme8
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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