There is a canvas with a model that is drawn using WebGL. I need to display text on this canvas with the model. On the Internet, this method is common:
- Create an invisible canvas with the usual 2D context
- Print the text of the desired font and color using
fillText, setFont, setFillStyle
- Create a texture with an image of an invisible canvas.
- We display it on the main (visible) canvas (with WebGL context)
Here is a detailed description of this method: WebGL text using a Canvas Texture .
Is there a way to display characters without using an invisible canvas? Maybe somehow you can get an image of the characters of a given font or something else?