Using instances with OpenGl 3.3

I started using the instances to make a grid with horizontal and vertical lines that correspond to rectangles. So when rendering the mesh of the rectangle corresponding to the horizontal lines is displayed at different coordinates (managed by the instances) as many times as necessary and an identical operation is done to render the vertical lines.
It works great with glDrawElementsInstanced but since I can’t go beyond OpenGl 3.3, I can’t use glDrawElementsInstancedBaseVertexBaseInstance and try to optimize. Indeed, I use two VAOs, one for horizontal lines and one for vertical lines.
I can’t understand what glVertexAttribDivisor can do when the second parameter is different from 1 and it’s a bit the same for glDrawElementsInstancedBaseVertex.

So my question is: Is it possible to bring together in the same VAO (without using glDrawElementsInstancedBaseVertexBaseInstance which would be the solution), a VBO which contains the two meshes of the horizontal and vertical lines and a VBO which contains the information for the calculation positions of the instances of the horizontal and vertical lines, to invoke the rendering from this VAO once to display the horizontal lines then to invoke the rendering from this same VAO (without modifying the VBOs) a second time to display the vertical lines ( but probably with different uniform variables per rendering so that the shader knows if it is horizontal or vertical)?

since I can’t go beyond OpenGl 3.3

Define “beyond OpenGl 3.3”?

Much of the ergonomic elements of 4.x are available on 3.3 hardware; you just have to access them through extensions. For example, glDrawElementsInstancedBaseVertexBaseInstance is available through the ARB_base_instance extension. Any reasonably up-to-date OpenGL 3.3 implementation ought to expose that extension.

And no, there’s no way to magic this functionality into existence if your implementation doesn’t provide it. That’s why the extension was made in the first place.

As I develop under Macos (and I would like the program to also be available under Macos) the maximum OpenGL version is limited to 3.3.

I tried to use the ARB_base_instance extension but at runtime an error message tells me that this extension is not supported. I deduced that I would never be able to use it but in view of your remark I will investigate to see if there is ultimately a possibility of activating this extension.

Cruel reality that leaves no room for a little magic :slightly_smiling_face:. Thank you for your feedback which, once again, will help me a lot.

I thought MacOS had (deprecated) support for GL 4.1. Or is this being developed under a Metal-wrapper?

That’s right, version 4.1 is supported. I was convinced it was 3.3.
Besides, I use GLFW for windowing and even when explicitly setting the OpenGl version to 3.3, version 4.1 is used.
I noticed this while researching why the ARB_base_instance extension was not supported in my environment.