OpenGL - draw pixels to screen?

前端 未结 4 1552
南笙
南笙 2021-01-01 00:06

I want to draw a 2D array of pixel data (RGB / grayscale values) on the screen as fast as possible, using OpenGL. The pixel data changes frequently.

I had hoped that

4条回答
  •  独厮守ぢ
    2021-01-01 00:23

    I would think the fastest way would be to draw a screen sized quad with ortho projection and use a pixel shader and Texture Buffer Object to draw directly to the texture in the pixel shader. Due to latency transferring to/from the TBO you may want to see if double buffering would help.

    If speed isn't much of a concern (you just need fairly interactive framerates) glDrawPixels is easy to use and works well enough for many purposes.

提交回复
热议问题