user471 Posted January 2, 2016 Share Posted January 2, 2016 I could try to understand it from the code, but maybe there is any summary about how renderer.render(stage) is working. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 2, 2016 Share Posted January 2, 2016 updateTransform is calculating matrices based on position, scale and rotation of elements. Its recursive. But some containers (like ParticleContainer) prevent that and have their own magic for it. To render DisplayObject you have to switch renderer to plugin corresponding to that element. If plugin that was active already, it can add element to the batch (like SpriteRenderer does it), or flush a previous batch. Batches are good for performance. There are different plugins: SpriteRenderer, MeshRenderer, GraphicsRenderer and my own SpineMeshRenderer. To render container with filters you have to determine its bounds, switch renderer target to some buffer, render childrens, then apply a filter and switch target back. Some containers (like ParticleContainer) has different logic for rendering: they are using special plugins to render their childrens more effectively. Of course they will work only with children types they know of, dont expect ParticleContainer work with meshes. 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.