Creating a volumetric galaxy, procedurally generated based on a bitmap, is relatively easy in Unity. The key idea is to use the Particle System, not employing the generator, but rather placing particles programmatically. This is demonstrated in the file GalaxyCloudForge.cs.
Some parameters have to be set correctly, like “Local” simulation space and the settings of the “[X] Render” component of the Particle System. In addition, the template bitmap must be set to “Read/write enabled“.
The source code of the Unity project can be found here: https://github.com/imifos/unity3d-workspace. It uses only standard assets, so I can share it without restriction.
In order to make the code more readable, GalaxyCloudForge.cs uses 2 separate loops. This can be merged into one single loop with a little bit of additional logic. Performance can be improved further by replacing GetPixel() by GetPixels32(), adding a bit of logic. Again, for education purpose, I did not use this in this example project.
Note: Low frame rate in video due to hardware limitation on laptop while recording.