Galactic background: more eye candy...

Published on
Last changed on

The usual chain of one thing leading to another happened; but I'm happy to show one of the main outcomes of the migration from WebGL/WebGL2 to WebGPU.

A brief timeline:

  1. Working on procedural surfaces
  2. That led to volumetric clouds
  3. Raymarching is expensive
  4. Compute shaders look nice and could certainly help
  5. Compute shaders and WebGL = big nono
  6. Need WebGPU, which BabylonJS happily supports
  7. Go back to the 3d explorer and start migrating to WebGPU
  8. A few hurdles
  9. But this…

This is the "Galactic background" as you can see it now on the 3d explorer:

  • Old galactic background

This had been built using a PointCloudSystem; it was working well but I had never been fully satisfied with its visual appearance. It's fair to say… yeah, I can understand why.

As it turns out, PointCloudSystem does not seem to work too well with WebGPU when you want variable-size particles. So I had to find another solution.
This solution came in the form of billboarded thin instances, so in more ways than one, extremely similar to a PCS. However, this enabled:

  • more direct control over particle size, falloff, colour, opacity and distance behaviour, rather than relying on the more constrained PCS path
  • custom shaders

Judge for yourselves :)

  • New galactic background

That version still isn't behaving a way that 100% satisfies me, notably at the performance level -- even though it is already faster and lighter than the PCS one. But first of all it is immensely better looking!

This took me a few extra evenings but is currently worth it! And no, this is not a skybox, this is dynamically generated from a low-resolution galactic density map.

Please signin to add your comment.