SolarGrav
A downloadable simulation for Windows
I needed a project to learn compute shaders in OpenGL 4.3, so I decided to build a solar system gravity simulation. It turned out rather cool, and I hope it scratches your itch for a universe sandbox!
The simulation creates particles with a relative element ratio identical to our actual solar system before letting gravity take over. Because hydrogen is our most abundant element, you'll notice most of the larger bodies tend to form into stars. But, check out the settings to create interesting solar systems!
🎮 Controls
- Right-Click: Add more particles (each click injects a different element).
- Left-Click + Drag: Tilt the camera.
- Middle-Mouse + Drag: Pan the camera.
- Tab: Open the settings menu to tweak the simulation.
⚙️ Command Line Arguments
The first time you run the program, I highly suggest running it with the --autotune argument to calibrate the simulation to your GPU to maximize the number of particles!
☁️ Fog & Initial Conditions
-n,--n(Default:auto): The total particle count. Sizes the fog to your specific GPU (measured once, then cached).--autotune: Measures the full particle-count capabilities of your graphics card and caches the result for future runs.--retune: Ignores any previously cached particle counts and forces a new measurement.--target-fps(Default:30.0): The frame rate budget that the auto and autotune settings aim to maintain.--mix(Default:solar): Elemental composition.solaris true solar system abundances.refractorydrops H/He/noble gases.metallicis metals only (what a differentiated core is made of).--equal-mass: Gives every particle the exact same mass instead of scaling proportionally to its atomic mass.--shape(Default:cube): Boundary shape of the starting fog (sphere,cube,icosahedron,dodecahedron,tetrahedron). Non-spheres demonstrate that roundness is emergent.--radius(Default:1000.0): Initial size of the cloud in AU.--beta(Default:0.025): Rotational energy / binding energy. Sets total angular momentum.--turb(Default:0.045): Turbulent energy / binding energy. Breaks the symmetry.--seed(Default:20260810): Integer seed for the random number generator.
⚛️ Physics & Simulation
--levels(Default:0): Octree depth.0automatically scales based on particle count. Positive values bias toward finer resolution.--racc(Default:0.055): Collision radius of a mean particle. Refines dynamically as particles merge.--restitution(Default:0.3): Bounce elasticity for impacts too fast to merge.--merge-factor(Default:1.0): Merge if relative speed is less than this multiplier times mutual escape speed.--soften(Default:0.5): Gravitational softening, in units of summed body radii.--eta(Default:0.15): Timestep accuracy factor.--no-cull: Keeps unbound particles instead of deleting them.--cull-radius: Deletes unbound particles beyond this radius in AU (defaults to 8x cloud radius).--max-neigh(Default:4096): Safety cap on particles read per neighbor cell.
🖥️ Display & Output
--width/--height(Default:1920/1080): Window resolution.--fullscreen: Starts the simulation in fullscreen mode.--hide-hud: Starts with the HUD hidden.--exposure(Default:0.40): Starting camera exposure; auto-exposure adapts from here.--fixed-exposure: Disables auto-exposure and holds exposure constant.--exposure-key(Default:0.030): Target mean frame brightness for auto-exposure.--bloom(Default:0.5): Intensity of the visual bloom.--point-scale(Default:0.15): Drawn size of a single fog particle relative to its collision radius.--size-exp(Default:0.20): How fast drawn size grows with mass. Keeps the visual hierarchy readable.--substeps(Default:1): Physics steps per rendered frame.--census-every(Default:2.0): Seconds between body censuses (0disables).--frames(Default:0): Exit after N frames (0= run forever).--shot: Write a single PNG screenshot before exiting.--shot-every(Default:0): Write a sequentially numbered screenshot every N frames.--shot-prefix(Default:shot): Custom prefix for screenshots.--benchmark: Print step timings to the console and exit.
| Published | 25 days ago |
| Status | Released |
| Platforms | Windows |
| Author | 27K Interactive |
| Genre | Simulation |
| Tags | Gravity, Idle, Physics, Sandbox |
| Content | No generative AI was used |
Download
Click download now to get access to the following files:






Leave a comment
Log in with itch.io to leave a comment.