jupyter-widgets-contrib / ipygany

3-D Scientific Visualization in the Jupyter Notebook
BSD 3-Clause "New" or "Revised" License
489 stars 52 forks source link

Triangle indices with dtype=uint16 #65

Open davidbrochart opened 4 years ago

davidbrochart commented 4 years ago

When I create triangle indices with a dtype='uint16', I get no output and this message in the browser console:

WebGL warning: drawElementsInstanced: Indexed vertex fetch requires 71173184 vertices, but attribs only supply 1088.

I checked that the triangle indices have no value greater than 65535. The issue also appears with dtype=uint8, but it works fine with dtype=uint32.

martinRenou commented 4 years ago

ThreeJS supports those types https://threejs.org/docs/index.html#api/en/core/bufferAttributeTypes/BufferAttributeTypes

So my first guess is that the deserialization (JS side) does not work properly in ipygany.

davidbrochart commented 4 years ago

When I set the vertices' dtype to int16 I get the same error. Maybe it is due to deserialization indeed.