Questions about PointCloud Systems and SpriteManager

  1. For PointClouds, is there a way to make the points round, rather than square? Something in the fragment shader like this example:
  1. For Sprites is there a way to do a callback function similar to what you do in PointClouds? Something similar to the following, but for individual Sprites.

pcs.updateParticle = function(particle) {
// something
}

scene.registerBeforeRender(() => {
pcs.setParticles();
});

I’d like to adjust the size and animation index of sprits at great distances from the camera.

  1. Pinging @JohnK for point cloud.
  2. Sprites are independent entities so why not just going through your list of sprites once per scene?

The point cloud system “squares” are drawn by setting pointsCloud = true on the material Material - Babylon.js Documentation. As far as I know this only allows squares.

it draws pixels which are squares :slight_smile:

I tried just looping through SpriteManager children - very performant, in fact much better than an SPS for large numbers (e.g. 100k). Pretty awesome! However, it does seem that it wouldn’t be hard to extend the SPS to draw circles (at a fragment shader level) rather than squares. If you try to use anything other than a quad, it suffers with large numbers - I tried a Disc, poor performance. Sphere, ground to halt. Same 100k in sprites - full speed on my admittedly fast hardware.

Maybe just use a billboarded SPS with a planar quad model (4 vertices) on which you stick a transparent texture holding a painted disc ?
[EDIT] Sorry, I didn’t read that you needed to iterate over 100K elements… what is a huge loop whatever the pool (points, solid particles or sprites) that you want to update each frame.

I found that the Sprite Manager actually works better than SPS for this, also you can easily set up multiple images for individual sprites. At 119k sprites, I am getting updates at 60fps in my system (GTX1080) even when I adjust sizes and color alphas.