Is it possible to render an Android View to an OpenGL FBO or texture?

前端 未结 3 1277
醉话见心
醉话见心 2020-12-14 23:16

Is it possible to render a View (say, a WebView) to an FBO so it can be used as a texture in an OpenGL composition?

3条回答
  •  庸人自扰
    2020-12-14 23:56

    At least someone managed to render text this way:

    Rendering Text in OpenGL on Android

    It describes the method I used for rendering high-quality dynamic text efficiently using OpenGL ES 1.0, with TrueType/OpenType font files.

    [...]

    The whole process is actually quite easy. We generate the bitmap (as a texture), calculate and store the size of each character, as well as it's location on the texture (UV coordinates). There are some other finer details, but we'll get to that.

    OpenGL ES 2.0 Version: https://github.com/d3kod/Texample2

提交回复
热议问题