I thought I have solved problem but still the color rendered in GPUImageView is weird - it doesn’t look that much nature. I re-examine the change and find there is some sample code called GLCameraRipple from Apple which pretty much does same thing - color conversion from YUV to RGB.
After I download and check the code in GLCameraRipple, I find that actually the shader is pretty much the same. I changed the shader string to what I mentioned in GPUImage Movie Writer Exposure Problem, tried it out but the rendered image still isn’t right.
Then I trace from shader string down to the configurations/settings of the OpenGL ES, more specifically the texture uploading.
Here are the code in GPUImageVideoCamera.m:
You would probably wonder why those two code in both branches is the same.As you see, the only difference is that GL_RED_EXT vs GL_LUMINANCE. Then I’m curious about which value is used in apple’s sample code.