How to modify an instance of gpu.types.GPUVertBuf?

I just made some more tests and glVertexAttribPointer only works when passing none. When using Buffer() it does not.

This code does not work:

col_attr_buf = Buffer(GL_INT, 1)
col_attr_buf[0] = 12
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 24, col_attr_buf)

After applying this patch (https://developer.blender.org/D2404), the following code does work as expected:

glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 24, 12)

@brecht how can we translate the following line to BGL?
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)(3* sizeof(float))

1 Like