A 3D solar system simulation built with C++ and OpenGL. Explore randomly generated star systems with planets, moons, asteroid belts, and planetary rings.
git clone https://github.com/code-alchemist01/Astralis-Engine.git
cd Astralis-Engine
mkdir build && cd build
cmake .. && cmake --build . --config Release
./Release/procedural_universe.exe # Windows
./procedural_universe # Linux/macOS- Dynamic Solar Systems: Each system is procedurally generated with unique characteristics
- Realistic Sun: Animated surface with solar flares and temperature-based coloring
- Diverse Planets: Various planet types with different sizes, colors, and compositions
- Moon Systems: Planets can have multiple moons orbiting around them
- Asteroid Belts: Scattered asteroid fields between planetary orbits
- Planetary Rings: Some planets feature beautiful ring systems
- Free Camera: Navigate through space with smooth camera controls
- Particle Systems: Dynamic particle effects for enhanced visual appeal
- Procedural Generation: Seed-based generation ensures reproducible yet varied results
- ImGui Interface: Real-time parameter adjustment and system information
- Configurable Starfield: Adjustable star density and brightness
- WASD: Move camera forward/backward/left/right
- Mouse: Look around
- Scroll: Zoom in/out
- ESC: Exit application
- CMake 3.21+ (updated requirement)
- C++20 compatible compiler (MSVC 2019+, GCC 10+, or Clang 12+)
- OpenGL 3.3+ support
- Git (for dependency fetching)
The project automatically downloads and builds the following dependencies via CMake FetchContent:
- GLFW 3.4 - Window management and input handling
- GLM 1.0.1 - Mathematics library for graphics
- ImGui 1.90.1 - Immediate mode GUI
- spdlog 1.12.0 - Fast logging library
- FastNoiseLite 1.1.1 - Procedural noise generation
# Clone the repository
git clone <repository-url>
cd Astralis-Engine
# Create build directory
mkdir build
cd build
# Configure with CMake
cmake ..
# Build the project
cmake --build . --config Release# Windows
./build/Release/procedural_universe.exe
# Linux/macOS
./build/procedural_universe--seed <number>- Set the random seed for system generation--planets <number>- Set the number of planets (default: 8)
The engine is built using modern C++20 with a modular architecture:
Core Components:
- App: Main application class managing the game loop
- Window: GLFW-based window management
- Camera: Free-flying camera with smooth controls
- Shader: OpenGL shader management and compilation
- Texture: Texture loading and management
Rendering System:
- Geometry: Mesh generation and management
- ParticleSystem: GPU-based particle rendering
- Multiple specialized shaders for different object types
Solar System Simulation:
- SolarSystemManager: Manages multiple solar systems
- PlanetManager: Handles planet generation and rendering
- Planet, Moon, Sun: Individual celestial body classes
- AsteroidBelt, PlanetaryRings: Special effect systems
- OpenGL 3.3+ for rendering
- GLFW for window management and input
- GLM for mathematics operations
- ImGui for real-time interface elements
- FastNoiseLite for procedural noise generation
- spdlog for efficient logging
- STB Image for texture loading
Each solar system is generated using seed-based algorithms, ensuring reproducible yet varied results. The generation includes:
- Planet positions, sizes, and orbital parameters
- Surface textures and atmospheric effects
- Moon systems with realistic orbital mechanics
- Asteroid belt distributions
- Planetary ring systems
Astralis-Engine/
├── src/
│ ├── core/ # Core engine components
│ │ ├── App.* # Main application
│ │ ├── Camera.* # Camera system
│ │ ├── Shader.* # Shader management
│ │ └── ... # Other core systems
│ └── main.cpp # Entry point
├── assets/
│ ├── shaders/ # GLSL shader files
│ └── textures/ # Texture assets
├── extern/ # External dependencies
└── CMakeLists.txt # Build configuration
We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines.
- Follow the existing code style and conventions
- Add comments for complex algorithms
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Physics Simulation: Realistic orbital mechanics and gravitational effects
- Multiple Star Systems: Binary and trinary star configurations
- Enhanced Lighting: Volumetric lighting and atmospheric scattering
- Sound System: Ambient space sounds and music
- Save/Load System: Ability to save and revisit interesting systems
- VR Support: Virtual reality exploration capabilities