jimy-byerley/pymadcad

`Scheme` number of spaces fixed in the shader is too limiting (32), make it adaptative

Closed this issue · 1 comments

In the python display and in the [shader][https://github.com/jimy-byerley/pymadcad/blob/fdad0a0735339be090553a5bd5c2b7ddee08c6b6/madcad/shaders/scheme.vert#L12) the number of spaces is fixed to 32, if the scheme has defined less, others are left uninitialized.

This is a limitation to large schemes, like for instance big kinematic schemes. But we should not increase the fixed size because it is transfered as a whole to the GPU every frame even for small schemes (it would be suboptimal). A better approach might be to use different shaders instances with powers of 8 factors of the base size. Or to change the vertex shader for sending a vertexbuffer of spaces instead of a uniform.

fixed on branch kinematic using an openGL uniform block buffer