Experience-Monks / three-bmfont-text

renders BMFont files in ThreeJS with word-wrapping
http://jam3.github.io/three-bmfont-text/test/
MIT License
789 stars 171 forks source link

Why vec2 position instead of vec3 at the cost of rewrite computeBounding functions ? #36

Open lateek35 opened 4 years ago

lateek35 commented 4 years ago

I saw that THREE couldn't manage computeBounding's functions with vec2 position attributes.

However, you have made the choice to stay with vec2, which implies having to rewrite the computeBounding functions yourself.


Is it because vec2 add a significant performance boost over using vec3 ? Or something else ?

Thanks

mattdesl commented 4 years ago

Mainly because it requires less data storage and buffer transfer bandwidth. Using vec2, you are transferring 1 less float per vertex, i.e. 4 less floats per text glyph or 16 less bytes.