Skip to content
forked from Prograda/Skybolt

Planetary rendering engine and aerospace simulation tools

License

Notifications You must be signed in to change notification settings

timpatt/Skybolt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skybolt Engine

Skybolt is a real-time planetary environment rendering engine, designed for flight simulators, aerospace R&D, and geospatial applications. Skybolt is written in C++, based on OpenSceneGraph, and supports CIGI for communicating with host applications. Skybolt also features a Python API for easy integration with science and engineering research tools.

The Skybolt repository includes Sprocket, a GUI application providing a sandbox for interactive scenario execution and testing.

alt text alt text alt text alt text

Features

  • Realistic environment rendering at a range of levels of detail, from ground level through to outer space
  • Tile streaming from geospatial data sources
  • Atmospheric scattering
  • Volumetric clouds
  • 3D Vegetation based on tree coverage data
  • FFT-based ocean wave simulation and rendering
  • Extensible entity component framework
  • CIGI support
  • JSBSim flight dynamics model integration
  • Bullet physics integration
  • Python API
  • Sprocket GUI application, a sandbox for interactive scenario execution and testing

Contact

Skybolt created and maintained by Matthew Reid. To submit a bug report, please raise an issue on the GitHub repository. For other queries, please use the contact form on the Piraxus website.

License

This project is licensed under the Mozilla Public License Version 2.0 - see the License.txt file for details.

Example Usage (C++)

// Create engine
auto params = EngineCommandLineParser::parse(argc, argv);
std::unique_ptr<EngineRoot> root = EngineRootFactory::create(params);

// Create camera
EntityFactory& entityFactory = *root->entityFactory;
World& world = *root->simWorld;
EntityPtr simCamera = entityFactory.createEntity("Camera");
world.addEntity(simCamera);

// Attach camera to window
auto window = std::make_unique<StandaloneWindow>(RectI(0, 0, 1080, 720));
osg::ref_ptr<vis::RenderTarget> viewport = createAndAddViewportToWindowWithEngine(*window, *root);
viewport->setCamera(getVisCamera(*simCamera));

// Create input
auto inputPlatform = std::make_shared<InputPlatformOsg>(window->getViewerPtr());
std::vector<LogicalAxisPtr> axes = CameraInputSystem::createDefaultAxes(*inputPlatform);
root->systemRegistry->push_back(std::make_shared<InputSystem>(inputPlatform, window.get(), axes));
root->systemRegistry->push_back(std::make_shared<CameraInputSystem>(window.get(), simCamera, inputPlatform, axes));

// Create entities
world.addEntity(entityFactory.createEntity("SunBillboard"));
world.addEntity(entityFactory.createEntity("MoonBillboard"));
world.addEntity(entityFactory.createEntity("Stars"));

EntityPtr planet = entityFactory.createEntity("PlanetEarth");
world.addEntity(planet);

// Point camera at planet
auto cameraController = simCamera->getFirstComponentRequired<CameraControllerComponent>()->cameraController;
cameraController->setTarget(planet.get());

// Run loop
runMainLoop(*window, *root, UpdateLoop::neverExit);

Example Usage (Python)

import skybolt as sb

window = sb.StandaloneWindow(sb.RectI(0,0,800,600))
engine = sb.createEngineRootWithDefaults()

camera = engine.entityFactory.createEntity("Camera")
engine.world.addEntity(camera);

sb.attachCameraToWindowWithEngine(camera, window, engine)

engine.world.addEntity(engine.entityFactory.createEntity("SunBillboard"))
engine.world.addEntity(engine.entityFactory.createEntity("MoonBillboard"))
engine.world.addEntity(engine.entityFactory.createEntity("Stars"))

earth = engine.entityFactory.createEntity("PlanetEarth")
engine.world.addEntity(earth);

controller = camera.getFirstComponentOfType("CameraControllerComponent").cameraController
controller.setTarget(earth)
controller.selectController("Globe")

sb.render(engine, window)

Projects and Dependencies

This repository contains multiple projects, described below, which can be enabled/disabled in CMake. Each project has a different set of dependencies. You only need to obtain dependencies for projects you wish to build. Header-only dependencies can be obtained from the SkyboltDependenciesHeaderOnly repository for convenience.

Skybolt Engine (Required)

The core engine libraries. Requires:

Skybolt Python Bindings

Python bindings for Skybolt. Requires:

Bullet Physics Engine Plugin

Skybolt plugin providing a rigid body dynamics component for entities by integrating the Bullet physics engine. Requires:

CIGI Plugin

Skybolt plugin providing a means for host applications to drive the simulation via the Common Image Generator Interface (CIGI). Requires:

FFT Ocean Plugin

Skybolt plugin simulating ocean waves with FFT. Requires:

JSBSim Plugin

Skybolt plugin providing an aircraft dynamics component for entities by integrating the JSBSim dynamics engine. Requires:

Sprocket

GUI application for creating, editing and running simulation scenarios, and performing analysis. Requires:

SequenceEditor Plugin (Experimental)

Experimental plugin providing a GUI for editing animated sequences. Requires:

MapFeaturesConverter Tool

Application for converting Open Street Map data to Skybolt feature tile format.

Building

Use CMake to configure and generate a build. Optional projects within the repository can be enabled/disabled with CMake BUILD_xxx properties as desired.

Installing Asset Packages

At runtime, Skybolt uses assets such as meshes, textures, and shaders. These assets are organized into packages. Each package is a folder containing a hierarchy of asset files on disk.

Skybolt searches for asset packages in these locations:

  1. /Assets
  2. Paths in the SKYBOLT_ASSETS_PATH environment variable

To run Skybolt, you must ensure the required packages are avilable to Skybolt using either of the above mechanisms.

Core Package (Required)

Skybolt cannot run without the Core package. It is located under /Assets in this repository.

SkyboltAssets Packages (Required for Example Applications)

Additional packages for running the example applications are located in the SkyboltAssets repository. SkyboltAssets uses DVC for remote storage and retrieval of large files which are not stored in the git repository itself.

To checkout the SktboltAssets repository:

  1. If you do not already have DVC installed, run pip install dvc[s3] to install with pip
  2. Clone SkyboltAssets and checkout desired git branch/tag
  3. Run dvc pull command in the SkyboltAssets root directory to fetch the remote files

NLCD Land Cover (Optional)

Land cover tiles for USA. Used by Skybolt to place trees on terrain in forest areas. This package can be downloaded here.

Seattle Map Features (Optional)

Map features (buildings, roads, lakes etc) for the city of Seattle. These features were generated from OpenStreetMap data using the MapFeaturesConverter tool. This package can be downloaded here.

Running

Settings

Engine settings are stored in a json file, which may be manually edited with a text editor, or edited in Sprocket with the Tools->Settings dialog. An example settings file template is available in this repository under src/SkyboltExamples/ExamplesCommon/ExampleSettings.json.

The settings file can be loaded by example applications with the --settingsFile commandline option. If the option is not specified, a default Settings.json in the Operating System user's home directory will be used. On windows, this is located at C:/Users//AppData/Local/Skybolt/Settings.json.

Using third party Map APIs

By default, the PlanetEarth entity uses mapbox for albedo and elevation data. To use mapbox, you must acquire an API key from https://mapbox.com Without an API key, the tiles will not download, the the planet will not render correctly. If desired, PlanetEarth can be edited to use Bing maps for albedo instead. A bing key can be obtained from https://docs.microsoft.com/en-us/bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key Keys are stored in the engine json settings file (see above).

About

Planetary rendering engine and aerospace simulation tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 87.0%
  • GLSL 4.8%
  • CMake 3.2%
  • C 3.2%
  • Python 1.8%