-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-texture feature request #260
Comments
Hi, Yes i know this feature from PixiJS and StageXL had this feature too :) StageXL was smart enough to batch draw calls for different textures together in one draw call, the same way as PixiJS does. It looks like a great feature but it is not! The problem is the code of the fragment shader and the way how you can access texture memory in WebGL1. The fragment shader needs to look something like this:
This is an anti pattern for shader code and makes rendering slow! Granted, it is faster than multiple draw calls, but still slower than correct texture management by the developer (combine all your images on a common texture). So i decided that it is a nice feature to write an article about (like PixiJS did) but not a good feature in reality. Let's talk about WebGL2 - as you may have heard the latest versions of Chrome and Firefox added support for WebGL2. As soon as Dart provides the necessary APIs i will add a render path to StageXL for WebGL2, which supports reading from different textures much more nicely than WebGL1 does. To make a long story short, your requested feature will come once we have WebGL2 in StageXL. |
Yes, I was aware it could complicate the shader code, but it seems it would be nice to have as an option perhaps? In some scenarios it may be worth it? A WebGL2 renderer does indeed look promising, but of course there's some mobile devices that will never get it, :(. iPad 2 and 3 for instance |
Maybe i will build a small prototype you could use, but no promises :) |
GPU draw calls can be a bottleneck, especially on older mobile devices. Other engines support "GPU multi-texturing". To improve performance, StageXL should support this feature. For reference, see:
http://www.goodboydigital.com/pixi-js-v4-batching/
https://phaser.io/tutorials/advanced-rendering-tutorial/part2
The text was updated successfully, but these errors were encountered: