Using a texture as an integer array (OpenGL 3.3, shader version 3.3)
Posted
by
Cubic
on Programmers
See other posts from Programmers
or by Cubic
Published on 2012-09-27T17:11:00Z
Indexed on
2012/09/27
21:50 UTC
Read the original article
Hit count: 153
opengl
I'm trying to have something like an integer array uniform for my fragment shader (I only need read access). Since it's a fairly large chunk of data (not so large that uploading it in every frame would be impossible, but enough to make me want to rather not do it). Essentially I want to just pass it a uniform telling the shader where this "array" is. I believe I can use a 1D texture for this, but I don't know how (actually, I don't know how to do many things because I just can't seem to find a reference for GLSL 3.3, I only ever find references for the C API).
This sounds like a rather basic question and I'm sure it's been answered already somewhere, but I keep searching and can't quite find what I'm looking for.
© Programmers or respective owner