I’m using gl 3.3 core.
I have been using UBOs to access some float data in my shaders, indexing it with vertex attributes. but I’d like to try doing the same thing with a texture. And i have 2 questions:
- I initially tried creating a VBO filling it with the data and then using
GL_PIXEL_UNPACK_BUFFER to transfer the data to a 1d texture, which did seem to get the data across, though i think i confused my formats as sending (1.0, 0, 0, 0) came out as blue.
I have also just read that it’s possible to do this using Texture Buffers, which seems better as it doesn’t require the transfer step.
Which would be the better option? Or is there a better way that i am unaware of.
- regarding texture formats, I use glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA32F, width, 0, GL_RGBA, GL_FLOAT, NULL); to create the texture and glTexSubImage1D(GL_TEXTURE_1D, 0, 0, width, GL_RGBA, GL_FLOAT, NULL); with the PBO to transfer my data across, is this correct? I’m not too sure on the definitions between internal format and type here.
thank you for any help.