I'm developing an Android app with OpenGL ES 2.0 and I'd like to use the GL_EXT_shader_framebuffer_fetch extension.
From what I understand, I need to enable it first with the #extension
directive at the top of my fragment shader, and then I can use the built-in variable gl_LastFragData
.
So here is my fragment shader:
#extension GL_EXT_shader_framebuffer_fetch : require
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <- Enable the extension
varying highp vec2 textureCoords;
uniform sampler2D currentTexture;
void main()
{
vec4 currentColor = texture2D(currentTexture, textureCoords);
gl_FragColor = currentColor;
}
However, when I compile the shader, I get the following compilation error:
Couldn't compile shader: Fragment shader compilation failed.
ERROR: 0:1: '' : GLSL error: extension 'GL_EXT_shader_framebuffer_fetch' is not supported
ERROR: 1 compilation errors. No code generated.
The error is pretty explicit: this extension is not supported.
My technical specs:
- Hardware: Samsung Galaxy S4
- Android version: 5.0.1
- Android API level: 21
- OpenGL version (
glGetString(GL_VERSION)
): OpenGL ES 3.0 V@84.0 AU@ (CL@)
I have a few questions:
- Is there anything I can do to install this extension on my device?
- If not, can I install it/use it on an emulator?
- Is it a software matter or really a hardware problem?