java - Using ByteBuffer as a Texture in OpenGL -


iḿ working on application should stream video data opengl (es2). each frame of video, can bytebuffer contain data. guess 1 way go convert opengl texture, , use sampler2d in opengl. however, feels got bytebuffer, more efficient send data opengl, width , height, , somehow read pixel data in shader. application show video in 2d, should use fragment shader operations on data.

my question if opengl has built in simplify (i.e. using bytebuffer array texture)? , possible use sampler2d or equivalent on bytebuffer array?

"however, feels got bytebuffer" - got it, opengl doesn't. have put data texture somehow. opengl not able use arbitrary cpu data texturing.

you may stream putting video frame directly mapped pbo (if es supports them) instead of bytebuffer (if possible within framework) , copying pbo texture, might buy something. no matter what, have call gltexsubimage2d (and sure not forget sub in there, otherwise reallocate whole texture storage each frame).


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -