Context
- 在相机预览上叠加蒙层。
- 相机预览:SurfaceView的Surface
- 预览在OpenGL上对应samplerExternalOES纹理。
- 蒙层:一个sampler2D纹理
shader
private val box_vert = ("uniform mat4 trans;\n"
+ "uniform mat4 proj;\n"
+ "attribute vec4 coord;\n"
+ "attribute vec2 aTexture;\n"
+ "varying vec2 vtexture;\n"
+ "\n"
+ "void main()\n"
+ "{\n"
+ " vtexture = aTexture;\n"
+ " gl_Position = proj*trans*coord;\n"
+ "}\n"
+ "\n")
private val box_frag = (
"#extension GL_OES_EGL_image_external : require\n"
+ "precision mediump fl