Skip to content
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

Re-use the same texture for all text instances to reduce draw calls #7

Open
endel opened this issue May 12, 2016 · 2 comments
Open

Comments

@endel
Copy link
Member

endel commented May 12, 2016

As reported by @gpolyn here http://stackoverflow.com/questions/37194082/consolidate-three-js-sprite-draw-calls-into-one

@gpolyn
Copy link

gpolyn commented May 12, 2016

Thanks @endel.

To confirm, the following three.js example has as many draw calls as sprites, even though texture is reused: threejs.org/examples/#webgl_sprites

(A similar motivation, I think, prompted development at github.com/Leeft/three-sprite-texture-atlas-manager.)

@gpolyn
Copy link

gpolyn commented May 12, 2016

For other interested readers, here are some (of Endel's) thoughts on approaches for the fix:

1. Have a single texture in the GPU for all text instances
2. Re-position all texts every time a new instance is created/removed
3. Have a "destroy" method, to remove the text from the texture
4. Re-use coordinates when the same text input is given

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants