开发者

Android: apply OpenGL effects to camera

Is there any way in Android to use a GLSurfaceView to display the camera preview, while using 开发者_StackOverflow中文版OpenGL effects on that surface? Specifically additive blending effects. I know OpenGL can use the effects, and I know the camera can be placed on a SurfaceView, but can a camera be placed in a GLSurfaceView and have OpenGL blending effects applied to that camera preview?


You can use camera preview to get the raw pixels of camera frames, then upload it to a texture, and then you can do any effects you want. Try looking at this: Android Camera OpenGL ES Tutorial (android camera support is quite buggy though, it almost never works when used this way).


This is untested so far, but Camera.setPreviewTexture looks like it was designed for just this kind of job. It directly uses an OpenGL ES texture as the target of preview images, so you can do anything a shader can do with such a texture.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜