Galaxia has 2 types of rendering. One is GPU rendering and the other is Particle System Rendering.

GPU Rendering

GPU Rendering Galaxy In-Editor preview

GPU rendering is done mainly on the GPU by utilizing Geometry shaders (DirectX 11+) or in the case of OpenGL and DirectX 10 or lower, shader that construct the quads. If GPU rendering is chosen as the rendering method, Galaxia checks if the system supports Geometry shaders or if the system only supports OpenGL and chooses the appropriate shader for rendering.

GPU Rendering Option

What GPU rendering does behind the scenes is each frame the Galaxy uses Graphics.DrawMeshNow to send a basic mesh with the star info to the GPU. Then the GPU renders the given mesh using the special Galaxia shaders. These shaders handle the rotation and quad generation to offload the work that needs to be done by the GPU.

Particle System Rendering

If the GPU option is disabled then Galaxia uses a Particle System Rendering. All that means is that Galaxia utilizes Unity's own Particle System to render particles.

Particle System Rendering Galaxy In-Editor preview

A particle system is generated once the game starts and then it's populated with particles each time the galaxy prefab changes. That means that the Unity particle system is basically recreated each time the galaxy changes. The good things is that if the galaxy is static and does not change, the particles system does not change as well. All the rendering is handled internally by the Unity particle system itself.
This option is mainly used for compatibility reasons and if the target platform does not support advanced shaders. It also has the benefit that the particle system is part of the Unity engine and all is constantly updated by the Unity team.

Off-screen Rendering

Galaxia uses custom shaders for rendering, these shader as well as handling the preparation for rendering the particles, handle the rendering part as well. They use a modified version of the particle additive shading. That means that if the particles are big enough or close enough that they cover a significant part of the screen, overdraw issues can occur. This is evident in the Unity's particle system. That's why it has an option to limit the maximum screen size of the particles.

Galaxia has a special Off-screen renderer that renders the galaxy at a lower resolution. Then it adds that rendering on top of the Unity rendering pipeline. This allows for faster rendering of the galaxy even when the camera is near the particles.
That means that the off-screen renderer acts like an Image Effect and requires to be put on a camera.

To use the off-screen particle renderer just add the Off-screen Galaxy Renderer component to and existing camera and assign the galaxy to be rendered.

Off-screen Rendering Component

The Off-screen Renderer automatically disables the rendering of the Galaxy component and takes it over.
You can adjust by how much the galaxy is downsampled. This controls the resolution the galaxy is rendered at. The Higher the number the lower the resolution is.
In most cases the quality loss is barely visible and the fps gain is quite significant when near large particles.


As of version 0.4 Galaxia allows for saving generated meshes and particles. That means that the generated meshes and particles can be saved in the editor and used at runtime. That allows for faster loading, because the galaxy does not need to be generated at game start.
The mesh and particles are stored in the Object in scene that has the Galaxy component.

Galaxy Component

Frustum culling was also introduced in version 0.4 of Galaxia. It allows for a GPU rendered galaxy to be culled when the galaxy is off screen. This option does nothing if GPU rendering is not enabled. Frustum culling for Particle System rendering is handled by the particle system itself.