Hi all,
just got myself a new retina laptop and am keen to learn shaders. I was hoping I could use GLSL 1.5 as the machine should support it but the below code tells me I only have 1.2? Is there a way around this?
Cheers,
nay.
// Get GLSL version
string glslVersion = string((const char *)glGetString(GL_SHADING_LANGUAGE_VERSION));
uint32_t spaceIndex = glslVersion.find_first_of(" ");
if (spaceIndex > 0)
glslVersion = glslVersion.substr(0, spaceIndex);
trace("GLSL version: " + glslVersion);
Mac OS X supports GLSL 1.5 (according to the Open GL Extensions-app) but only for the core-profile (which means OpenGL 3.2). So you have to create your OpenGL context with the CoreProfile attribute
Open GL 3.0 changes a lot of things, the fixed function pipeline (glBegin glEnd) got removed, basically you’ll have to to all your renderings with shaders.
Thanks Stephan,
I’d be happy to change the way I code to use VBOs instead glBegin/End etc but I’m not that keen to move outside of vanilla OF if addons and things will break. Looks like I may just have to learn shaders with GLSL 1.2 instead then.
Cheers,
nay.
It is worth noting that with v0.8.0 and later, the ofGLProgrammableRenderer will use the core profile on OS X and in turn allows more recent versions of GLSL.
Has anyone managed to do this? Adding the code sth suggested, doesn’t seem to have any effect on the version of GLSL used. Is there anything else I need to add to my code to get it to work?
Oh well, apparently, I’m not using (and can’t use) version 0.8, so that I can’t use “ofGLProgrammableRenderer”. I’m using an older version of OF (0.7.03?), and it would be nice to able to use a shader newer than 2006, so I can use things like integer 1D textures or uniform buffers that can load data from CPU memory and then use it inside a fragment shader.
As I understand it, I can draw to an “ofTexture”, but cannot fill it by copying CPU data, although I’d be happy to stand corrected.