Jitter / Perf issue
I am new to this community and a beginner with Jitter.
I have a very straightforward issue which I am sure someone can help me with.
I need to display in a CPU-effective way a 3D object which is just a cloud of numerous (possibly > 500k) points. I don’t care about building volumes, surfaces, textures.
Just the plain cloud of points.
By display, I mean, obviously, zoom into, rotate, translate. The kind of stuff jit.gl.render can do.
Well you already said it, the stuff jit.gl.render can do. Use jit.gl.mesh and send it a matrix containing the positions of your points.
How many points you’ll be able to visualize at a decent framerate depends on your hardware.
There’s 1 caveat that might or might not affect you. Points have no volume. They get drawn according to the point_size attribute you set on the jit.gl.mesh. This means that a point close by and far away have the same size. If you need them to look larger/smaller depending on how far they are you have to give them a volume. You might wanna use jit.gl.multiple then. Maybe there other tricks for that, not sure.
it works perfectly ! thx !!
Now I have another performance issue. I would like my cloud of 1 million points (X,Y,Z) to be colored according to a very simple formula R=G=f(X^2+Y^2,a), B=255
where the parameter "a" changes at each frame but has a limited number N of values.
Basically the closer a point is to the Z-axis, the bluer ; the further, the whiter. But with the parameter "a", I can introduce a pulse in the colur of the cloud.
Calculating at each frame a matrix of coulors and giving it to my jit.gl.mesh object takes too long.
Any idea of how to make this more efficient ? Use the capabilities of my GPU in this regard too ?
I could precalculate N 3D-images that are Z-cylinders of color going from blue to white, but then what ? How can I "mix" the images to render the cloud of points with the right color ?
Thx for your help