Setting custom vertex data - stride

Can someone clarify the difference between these two calls?

  • mesh.setVerticesData(KIND, DATA, UPDATEABLE, STRIDE);
  • vertexData.set(DATA, KIND);

I’d like to specify a stride of one so I can have a custom float for each fragment, but without constructing the mesh first. Is the stride on the vertexdata method defaulting to 3 or something?

Any info would be appreciated.

Hello!

The stride will be computed based on the Kind (unless you specify it using the setVerticesData). So 3 for position or normal, 2 for uv, etc…

2 Likes

Gotcha, thanks!