The project presents the development of an educational and interactive simulator of the Solar System, built in Unity3D and designed to combine scientific accuracy with an immersive experience.
The system enables the exploration of celestial bodies through two operational modes: a static mode for observing planetary configurations, and a dynamic mode for simulating orbital mechanics, featuring time management and adjustable speeds.
Users can explore space via a spacecraft equipped with a Heads-Up Display (HUD), accessing astronomical data and navigating among 11 celestial bodies: Sun, Mercury, Venus, Earth, Moon, Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto. To address the complexity of representing cosmic scales, the simulator integrates advanced navigation systems and utilizes high-precision astronomical data provided by NASA/JPL Horizons.
- Course: Fundamentals of Computer Graphics, University of Brescia
- Author: Jennifer Piangatelli
- Objective: Astronomical simulation of the Solar System in Unity3D
For further technical and scientific details, please refer to the dedicated documents:
- Technical Documentation: Architecture, Physics, Rendering, and Scientific Validation.
- Script Documentation: C# code reference guide.
- Development Notes: Logbook of design choices (brief
notes.txtfiles located within the project directories).
- Orbital Physics: Leapfrog numerical integration, with N-Body and Central-Body support.
- Real-World Data: Ephemeris importation from NASA/JPL Horizons.
- URP Rendering: Optimized graphics pipeline featuring post-processing and dedicated cameras.
- Immersive Experience: Spacecraft with HUD, time control and teleportation mechanics, soundtracks, and Sci-Fi styled user interfaces.
- Unity Editor:
2022.3.32f1 - Render Pipeline: Universal Render Pipeline (URP)
14.0.11 - IDE: VSCode
- Language: C#
- Horizons Web Application: https://ssd.jpl.nasa.gov/horizons/app.html#/
The project was developed and tested on the following hardware configuration, ensuring stable performance with default graphical settings:
- Laptop: Victus by HP Gaming Laptop 15-fa0xxx
- CPU: Intel Core i7-12700H (14 cores, 20 threads)
- Dedicated GPU: NVIDIA GeForce RTX 3050 (4 GB GDDR6)
- Integrated GPU: Intel Iris Xe Graphics
- RAM: 16 GB DDR4-3200 MHz
- OS: Windows 11 Home, 64-bit
- Open the project using Unity
2022.3.32f1; - Wait for the restoration of the
URP,TextMeshPro, andTimelinepackages, along with standard dependencies; - Ensure that files within the
Resourcesfolder remain accessible, as the loader utilizesResources.Load; - Open
Assets/Scenes/SplashScreen.unityorAssets/Scenes/GameScene.unity.
- Astronomical data must be located in
Assets/Resources/ephemerides.json; - Planet icons must be located in
Assets/Resources/Icons; - Prefabs assigned to the
PlanetPresetLoadermust remain correctly referenced; - Scenes must be included in the Build Settings if a standalone build is desired.
- The initial scene is
SplashScreen; - The splash button loads
MainMenu; - The
Playbutton in the menu loadsGameScene; - Within
GameScene, the loader initializes the celestial bodies and the UI.
- The immersive player experience is ensured through the adaptation of the spacecraft flight logic found in
Spaceflight Controls; - Commands for space exploration and cursor utilization are available in
MainMenu-->Controls; Play: Restores simulated time and re-enables physics;Pause: Freezes simulated time while preserving the previous speed state;- Time slider: Adjusts
timeScaleon a logarithmic scale; - Planet buttons: Select the celestial body, update the HUD, and teleport the spacecraft via
Teleport; - Overview button: Displays a comprehensive view of the solar system and teleports the user to the overview area.
SpaceOriginManagerresets the player to a safe position upon exceeding a specific threshold, necessitated by the vastness of the simulated space;PlanetLabeldisplays the name and distance from the Sun in screen-space;- The
SecondaryCameraprovides an additional viewport onCameraTexture.
The following are all references utilized during development: ranging from official documentation to tutorials, forums, and external assets.
The information listed below is detailed within the notes.txt files located in the project directories and within every summary provided at the top of each script created or adapted for the simulation.
- Universal Render Pipeline for advanced Unity creators
- Unity User Manual
- NASA/JPL Horizons Sources
- https://ssd.jpl.nasa.gov/orbits.html
- https://ssd.jpl.nasa.gov/horizons/app.html#/
- https://ssd.jpl.nasa.gov/horizons/manual.html#intr
- https://science.nasa.gov/solar-system/solar-system-facts/
- Sun Customization
- Sun tutorial: https://youtu.be/qJEBAPRt8AA?si=-Qg2Ag2cQiVAjYdE
- Improved Sun texture: https://www.solarsystemscope.com/textures/
- Sun texture loop: https://youtu.be/pHEK_-ggjf0?si=MFkp1riXSFm_nQ6H
- Emissive Material in Unity URP
- Bounciness Materials
- Splash Screen Tutorial
- Music Player Tutorial: Creating a Splash Screen & Music between Scenes
- Main Menu Turorial: Make Your MAIN MENU Quickly! | Unity UI Tutorial For Beginners
- Output Secondary Camera --> Render Texture
- SunLight
- Base code for light rotation targeting the player: https://discussions.unity.com/t/rotate-light-to-follow-player/556849/4
- EphemeridesLoader, Ephemeris, HorizonsDataImporter
- Serialization: https://docs.unity3d.com/6000.0/Documentation/Manual/script-serialization.html
- Best practices: https://docs.unity3d.com/6000.0/Documentation/Manual/script-serialization-best-practices.html
- Deserialization: https://docs.unity3d.com/6000.0/Documentation/Manual/json-serialization.html
- PlanetPresetLoader
- NASA: Real-world mass and radius data: https://solarsystem.nasa.gov/planet-compare/
- JPL (Planetary Physical Parameters): https://ssd.jpl.nasa.gov/planets/
- Local/World space: https://m-ansley.medium.com/local-space-and-world-space-in-unity-970e0bfb7694
- SpaceOriginManager
- Adapted base code: https://gist.github.com/brihernandez/9ebbaf35070181fa1ee56f9e702cc7a5
- Theoretical source "Working with large distances (Floating Origin)": https://netherlands3d.eu/docs/developers/features/floating-origin/
- GeneratePlanetOrbits
- Adapted base code "Simulating Planetary Orbits with Kepler's Laws": https://dev.to/programmingcentral/astrophysics-ai-with-python-simulating-planetary-orbits-with-keplers-laws-15ho
- NASA theoretical source on numerical integration: https://nasa.github.io/trick/documentation/simulation_capabilities/Integrator
- RenderUtils
- LineRenderer: https://docs.unity3d.com/2023.2/Documentation/Manual/class-LineRenderer.html
- TrailRenderer: https://docs.unity3d.com/2023.2/Documentation/Manual/class-TrailRenderer.html
- Teleport
- Unity Documentation: https://docs.unity3d.com/ScriptReference/Transform-position.html
- SolarSystemPhysics
- Time: https://docs.unity3d.com/2023.1/Documentation/Manual/TimeFrameManagement.html
- "Leapfrog Integration" method: https://en.wikipedia.org/wiki/Leapfrog_integration
- Theoretical source and adapted C code for the N-Body Problem: https://doku.lrz.de/files/10333650/10333662/8/1745835392310/1_3_NBodyCode.pdf
- Fixed Timestep Substepping: https://docs.unity3d.com/6000.3/Documentation/Manual/physics-optimization-cpu-frequency.html
- TimeController
- Time: https://docs.unity3d.com/2023.1/Documentation/Manual/TimeFrameManagement.html
- Forum: https://discussions.unity.com/t/slider-that-adjusts-how-fast-the-time-runs/790697/2
- Slider: https://medium.com/@Brian_David/ui-slider-in-unity-using-coroutines-and-mathf-lerp-a93fae02f07f
- PlanetHUD
- Headup-display: https://unity.com/glossary/headup-display
- PlanetLabel
- Planets of the Solar System 3D
- https://assetstore.unity.com/packages/3d/environments/planets-of-the-solar-system-3d-90219
- Primary asset package utilized in the project: Solar System planets, including prefabs, materials, textures, rendering settings, MainCamera scripts, etc.
- The planets were adapted and slightly modified, particularly the Sun (refer to "notes.txt" in Assets/Materials/NewSunMaterials and Assets/Textures/NewSunTexture).
- 30 Sci-fi Space Tracks Music Pack
- https://assetstore.unity.com/packages/audio/music/free-30-sci-fi-space-tracks-music-pack-354566
- Usage: Soundtrack loops.
- Simple Space starter kit
- https://assetstore.unity.com/packages/3d/vehicles/space/simple-space-starter-kit-305055#content
- Primary usage: Enhanced realistic spacecraft and prop assets, such as the space station in the overview area.
- Planet Icons
- https://assetstore.unity.com/publishers/21782
- Usage: Planet icons for the user interface, relocated to "Resources" for code-driven button generation utilizing custom PlanetButtonPrefabs.
- Spaceflight Controls
- https://assetstore.unity.com/packages/tools/input-management/spaceflight-controls-24532
- Primary usage: Flight logic, camera systems, and the initial spacecraft test prefab.
- Scripts were utilized and modified to ensure editor compatibility and to suit the specific requirements of the simulation.
- Unity Asset Store, Sci-Fi GUI Skin
- https://assetstore.unity.com/packages/2d/gui/sci-fi-gui-skin-15606
- Usage: Sci-Fi styled user interface customization.
- Replace static datasets with dynamic access via the JPL Horizons API to retrieve real-time astronomical data, thereby reducing reliance on local files and improving simulation efficiency and accuracy;
- Extend the scientific validation of the simulation by incorporating a greater number of celestial bodies and conducting analyses over extended temporal arcs;
- Enhance numerical precision management by introducing supplementary strategies alongside selective rebasing for simulations conducted on broader spatial scales;
- Implement more comprehensive models of celestial bodies, including axial rotations with authentic periods and inclinations;
- Introduce novel visualizable scientific parameters, such as orbital energy, eccentricity, and further dynamic information;
- Improve the integration of spatial control systems and the modified
Spaceflight Controlsscripts, encompassing a potential evolution towards a first-person cockpit view and a more accurate secondary camera; - Increase the level of visual realism through advancements in graphics, materials, lighting, and the rendering of celestial bodies.
The project delivers a simulation of the Solar System that coherently integrates three distinct layers: numerical physics, software architecture, and URP graphical rendering. The codebase exhibits a modular architecture wherein astronomical data is imported from HORIZONS, converted into dynamic presets, utilized to instantiate GameObjects, and ultimately updated by a Leapfrog engine featuring time control decoupled from the frame rate. The outcome is an educationally robust system, wherein the most significant aspect is not merely the visualization of the Solar System, but rather the technical justification of the design choices: double precision, sub-stepping, dedicated Lunar management, URP post-processing, rapid-selection UI, and experimental validation grounded in real-world datasets.

