Is it possible, in OpenGL (specifically in WebGL), to use a single value from buffer for multiple shader iterations? Like to put the same element from buffer into shader attribute multiple times? Like:
glVertexAttribPointer(*, 0.5, *, *, *, *)
Here what I have now:
//buffer 1
[
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
]
// buffer 2
[
-1, 1,
1, -1,
// ...
1, 1,
]
Here what I want to have:
//buffer 1
[
0,
4,
62,
41,
0,
0,
1,
]
// buffer 2
[
-1, 1,
1, -1,
// ...
1, 1,
]
I don't know how fit the second one with OpenGL API
I'm writing to my buffer1 a lot using CPU (glBufferSubData), that's why I need what I need.
I'll appreciate any C OpenGL
/ JS WebGL
code