I have a somewhat large chunk of data (that is too large to fit in a UBO) that I'd like to access in the vertex shader.
In OpenGL 4.3 I just use SSBOs and be done with it, however I now have to also support people down to version 3.2 or 3.3. I looked into how I can access a buffer in the vertex shader, and from what I could gather, it seems like I may be able to use TBO's (or any buffer really) without having to do something more involved like managing UBOs. Then I'd use some trickery with texelFetch()
and grab my data.
However this site claims that
GLSL also supports accessing texture maps in both vertex and fragment shaders. Implementations can choose to support texture mapping in vertex shaders (provided the underlying OpenGL implementation supports this functionality)
Now if I check GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
and it's zero, I'm toast. Or is there another more sane way for me to grab a larger amount of data than what a UBO supports in the vertex shader given a 3.2 - 3.3 GL version without messing around with texelFetch()
?
gl_Color
,gl_TexCoord
, etc. You should disregard any OpenGL site that talks about removed functionality, unless it makes it clear that the functionality was in fact removed. – Nicol Bolas