Skip to content
Davor Bokun edited this page Oct 1, 2019 · 15 revisions

Planetesimal Documentation

Planetesimal Plugin - comprehensive, highly efficient and highly flexible atmospheric scattering render system for Unreal Engine 4

Planetesimal is essentially a system of material functions, actor components, and supporting C++/Blueprint functions library, which enables physically correct atmospheric scattering render in your games and projects.

Available on Unreal Engine Marketplace.

About

Planetesimal plugin is a collection of material functions and actor components which make rendering complex atmospheric scattering effects super easy. It is entirely physically based and customizable from the light scattering properties of atmospheric constituents to the physical characteristics of atmosphere bounding celestial bodies from which properties such as atmosphere extent or surface density are calculated automatically. In essence it allows you to make your own protoplanets from the ground up, hence the name Planetesimal.

All properties of the underlying system are exposed to blueprint scripting so atmospheric properties like visibility, partial pressures of atmospheric constituents, or aerosol content at certain location can be sampled and easily incorporated into your game play design.

Default atmospheric constituent database comes in form of simple data table assets so it can be modified or extended to achieve any physically correct or surreal and artistic visual style.

The whole system is highly optimized for performance. Render fidelity is the highest possible which still meets the VR frame rate requirements. However, the material function library is made modular with scalability in mind so it is possible to achieve even higher fidelity with the same framework if needed. Precalculated atmospheric scattering data is cached in memory for in-editor performance, but can also optionally be saved as project data assets to speed up the game startup time.

Features

  • Real-time high performance atmospheric scattering
  • Realistic render of atmospheric gases, aerosols and ionized (emissive) gases
  • Full support for in-editor preview and design
  • Fully customizable and extensible atmospheric constituents database
  • Four atmospheric layers
  • Scalable set of material functions
  • Easily integrates with existing materials and material functions
  • Precalculated maps stored as assets for fast run-time loading
  • Precalculated maps in-memory cache
  • Blueprint API for sampling atmospheric properties in run-time

See the full Features list.

Getting Started

Plugin Installation

1. Get the Plugin From the Marketplace

TODO Getting the plugin from the Marketplace

2. Add the Plugin to Your Poject

Using Epic Games Launcher

TODO Add the plugin using Launcher

Manually add the Plugin to the Project

TODO Copy the plugin into a project

Minimal Example

1) Provide a Star Map

First we need a light source we can track. In essence this is just any actor implementing the Star Map Interface so the system can obtain info about Sun's location and color.

In the Planetesimal plugin Content directory there is a template for the Star Map actor named *BP_StarMap_Template *(/Planetesimal/Blueprint_Templates/BP_StarMap_Template) which you can just place in your level right away.

(NOTE: You might need to enable *Show Plugin Content *in Content Browser's View Options.)

Alternatively, you can implement the interface yourself by folowing the steps in Implementing Star Map Interface.

2) Add Planetesimal Component to actor class

Then we add the core of the system to an actor, i.e. the Planetesimal Component.

Set up the geometric, physical and atmospheric properties to match the desired effect, but most importantly set up the correct scaling in the World section of the Planetesimal Component properties.

Once the actor is instanced in the level, set the Star Map reference to the correct actor in the level (i.e. the actor implementing the Star Map Interface, can be the same actor).

3) Add Material Mixin to materials

All objects within the atmospheric cloud effect need to have a material which implements the atmospheric scattering effect. The easiest way to implement this is by adding a single material function mixin node into the material. For opaque objects inside of the atmospheric cloud MF_PlanetesimalSurfaceMixin should be used, and the MF_PlanetesimalSkyMixin for rendering the effect on the translucent sky mesh. Here are some examples:

4) Link the Planetesimal Component with dynamic materials (using Planetesimal Material Component)

Everything is set up by now. The only thing left is to propagate material parameters from the core Planetesimal Component to the materials using them. There are several approaches available for that but the easiest one is via the Planetesimal Material Component which is in essence an utility for dispatching material parameters to dynamic material instances which need them.

Just add the Planetesimal Material Component to an actor with meshes, instantiate it in your level, select the actor containg the core Planetesimal Component, and switch the Material Registration Method to "Register All".