I am rendering a point cloud using vertex buffers in a mesh.
Mesh m = new Mesh();
m.setMode(Mode.Points);
m.setBuffer(VertexBuffer.Type.Position, 3, pointCoordinates3d);
m.setBuffer(VertexBuffer.Type.Color, 4, colorsRGBA);
m.setBuffer(VertexBuffer.Type.Size, 1, sizes);
pointCoordinate3d contains the coordinates of the points, colorsRGBA the colors of points, and sizes the sizes of the points. I would expect that higher values in sizes would lead to the points being rendered larger, which isn’t the case.
Now a few questions:
Is what I described what the size vertex buffer is supposed to do?
If no, what is it supposed to do?
If yes, what could be the cause of the size buffer apparently being ignored?
Each vertex buffer simply links the data, so that it is available to the shader.
It’s up to the shader to use the data in the way you’d like. As far as I know, the jME default Unshaded material’s vertex shader does not read and use attribute inSize.
Eg.: your vertex shader could contain the following to receive the input from vertex buffer size and set it to gl_PointSize.
Depending on your requirements, gl_PointSize is limited on some hardware. An alternative to draw points or varying sizes is to use quads - billboards with instancing.