From this, we can see each GlyphRun uses a drawcall and it harms performance badly when rendering a string containing many characters.
I think we should apply the offset when we fill the vertex buffer. I mean, bake the offset into vertex instead of offset every glyph in vertex shader, just like what I have done before in my original OpenGLES demo.
Update:
No, my soultion is incorrect partially. The mesh should only be moved after it is built. Otherwise we can not re-use the old mesh when the position of text is changed but its content and style remains the same. But I think the offset of each glyph should be applied to built vertices.
@prepare's note:
From this, we can see each
GlyphRunuses a drawcall and it harms performance badly when rendering a string containing many characters.I think we should apply the offset when we fill the vertex buffer. I mean, bake the offset into vertex instead of offset every glyph in vertex shader,
just like what I have done before in my original OpenGLES demo.Update:
No, my soultion is incorrect partially. The mesh should only be moved after it is built. Otherwise we can not re-use the old mesh when the position of text is changed but its content and style remains the same. But I think the offset of each glyph should be applied to built vertices.
@prepare's note: