OpenGL ES - Reserved keyword: sampler2DRect

I’m trying to upgrade OF code from a couple months old project. Before entering my main.cpp code, I get the following:

02-26 14:59:57.780: I/OF(10578): onSurfaceCreated
02-26 14:59:57.840: E/ofShader(10578): setupShaderFromSource(): GL_FRAGMENT_SHADER shader failed to compile
02-26 14:59:57.840: E/(10578): ofShader: GL_FRAGMENT_SHADER shader reports:
02-26 14:59:57.840: E/(10578): (7:0) : error : reserved keyword : ‘sampler2DRect’
02-26 14:59:57.840: E/(10578): (7:0) : error : syntax error
02-26 14:59:57.840: E/(10578): ofShader: GL_FRAGMENT_SHADER, offending line 0 :
02-26 14:59:57.840: E/(10578): 1 precision mediump float;
02-26 14:59:57.840: E/(10578): 2 #define IN varying
02-26 14:59:57.890: E/ofShader(10578): checkProgramLinkStatus(): program failed to link
02-26 14:59:57.890: E/(10578): ofShader: program reports:
02-26 14:59:57.890: E/(10578): No fragment shader attached.

What could be the cause? Something related to ARB textures? How can I disable them before entering my main code?


Not sure about android, but I noticed on Raspberry Pi (also an OpenGL ES platform) that I was getting the reserved keyword error with a shader that used sampler2DRect… OpenGL ES 2 doesn’t support sampler2DRect and texture, you have to use sampler2D and texture2D… which means you’ll want to use ofDisableArbTex(); in your setup routine before compiling your shaders. Hope that helps!

1 Like