jimy-byerley / pymadcad

Simple yet powerful CAD (Computer Aided Design) library, written with Python.
https://madcad.netlify.app/
GNU Lesser General Public License v3.0
215 stars 17 forks source link

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

Closed jimy-byerley closed 6 months ago

jimy-byerley commented 7 months ago

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.

jimy-byerley commented 6 months ago

fixed on branch kinematic using an openGL uniform block buffer