Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Simple vertex shader
- private static final String VERTEX_SHADER =
- "uniform mat4 uMVPMatrix;\n" +
- "uniform mat4 uTexMatrix;\n" +
- "attribute vec4 aPosition;\n" +
- "attribute vec4 aTextureCoord;\n" +
- "varying vec2 vTextureCoord;\n" +
- "void main() {\n" +
- " gl_Position = uMVPMatrix * aPosition;\n" +
- " vTextureCoord = (uTexMatrix * aTextureCoord).xy;\n" +
- "}\n";
- // Fragment shader for use with external 2D textures + an lut texture
- private static final String FRAGMENT_SHADER_EXT =
- "" +
- "#extension GL_OES_EGL_image_external : require\n" +
- "precision mediump float;\n" +
- "varying vec2 vTextureCoord;\n" +
- "uniform samplerExternalOES sTexture;\n" +
- "uniform sampler2D lutTexture;\n" +
- "void main() {\n" +
- " float lum = texture2D(sTexture, vTextureCoord).r;" +
- " lum = clamp(lum, 0.0, 1.0);" +
- " gl_FragColor = texture2D(lutTexture, vec2(lum, 0.5));\n" +
- "}\n";
Add Comment
Please, Sign In to add comment