I'm working on a webgl cloth simulation project, trying to use transform feedback. The simulation will be done in the vertex shader. I need to access the vertex's neighbor vertices to calculate forces. I'm thinking using uniform buffer object to store all vertices' positions.
I defined a uniform block something like below:
layout(std140) uniform u_testBlock
{
vec4 v0;
vec4 v1;
...
};
However, I'm having 'layout: syntax error'. Is that the right way to use UBO in webGL2? The webGL2 specification says that only std140 layout is supported for uniform blocks, why there's such syntax error?
Thanks very much!
#version? - derhass