0

In Android, in order to pass YUV420sp into a fragment shader I pass the information spliting the data into Y-U-V, and passing each sugin glTexImage2D with GL_LUMINANCE format

But now I need to do Offscren-Rendering for which I require FBOs, the problem is that FBOs do not support GL_LUMINANCE.

So what would be the best way to pass the YUV data without using GL_LUMINANCE?

By the way, I cannot process the YUV in the CPU and convert it to RGB or something else, as the whole point is to pass the YUV as it is into the GPU.

EDIT: As this is for android, the single channel GL_RED will not work as such has not been implemented.

4

1 回答 1

1

GL_LUMINANCE在可编程流水线中是完全没有必要的。

在最基本的层面上,它是一种允许在固定功能管道时代进行纹理混搭的 hack。这些天来,您使用GL_RED单通道纹理,并且可以在片段着色器中以任何方式调整它。

您要复制GL_LUMINANCE的是:vec4 (texture (...).rrr, 1.0). 您甚至可以在最近的 OpenGL 实现中使用ARB_texture_swizzle.

于 2013-09-08T01:42:49.037 回答