Skip to main content

Scattering

The Scattering class implements atmospheric light scattering effects for realistic rendering of planetary atmospheres. It supports Rayleigh and Mie scattering with configurable parameters such as height, density, color, and phase functions. Preset configurations are available for Earth and Mars atmospheres, and developers can fine-tune texture resolution and sampling quality to balance performance and visual fidelity.

info

This plugin internally creates a SceneRenderer instance to inject scattering dispatches into the rendering pipeline. It produces a transparent texture for the RenderFrame that applies the scattering effect to the final rendered image, including transparent objects.

info

This plugin is integrated into Tellusim Explorer.

#include <objects/scattering/include/TellusimScattering.h>

Example

// Create scattering with Earth preset
Scattering scattering(Scattering::TypeEarth);
if(!scattering.create(device, graph)) return false;

// Configure scattering parameters from UI sliders
scattering.setInnerRadius(inner_radius_slider.getValuef32());
scattering.setOuterRadius(outer_radius_slider.getValuef32());
scattering.setRayHeight(ray_height_slider.getValuef32());
scattering.setMieHeight(mie_height_slider.getValuef32());
scattering.setMieTurbidity(mie_turbidity_slider.getValuef32());