Controls

Core Color

Outer Color

Color Mix

0.80

Anim Speed

0.5

Density

2.0

Turbulence

1.2

Flares

0.20

Brightness

2.0

Scattering

0.60

Edge Softness

1.00

Edge Noise

0.5

Glow Strength

0.8

Glow Radius

0.50

Glow Threshold

0.20

Halo Color

Halo Strength

0.5

Halo Scale

1.5

Aberration

0.005

Description

This experiment simulates a star using Volumetric Raymarching. Unlike standard 3D rendering where we draw a surface mesh, here we mathematically "march" rays through a 3D volume to calculate density and light accumulation.

The core visual is generated by Fractal Brownian Motion (FBM). We layer multiple octaves of Simplex Noise to create the chaotic, "boiling" surface of the sun. To simulate convection currents, we actully warp the coordinate space of one noise layer with another:

// Domain Warping for turbulence
vec3 q = p + vec3(uTime * 0.1);
float n1 = noise(q);
vec3 r = p + vec3(n1 * 2.0); // Warp
float density = noise(r * 3.0);

To simulate the glowing atmosphere, we calculate Ray-Sphere Intersection. We verify if a camera ray hits our star's bounding volume. If it does, we step through the volume, accumulating density values. We apply a Henyey-Greenstein phase function to simulate how light scatters through plasma towards the camera:

float hg = (1.0 - g*g) / pow(1.0 + g*g - 2.0*g*dotJA, 1.5);
diffuse += uColorA * hg * scattering;

Finally, the image goes through a Post-Processing Pipeline. We use an Unreal Bloom pass to threshold bright areas and blur them, creating the blinding glow. A custom shader pass adds the Lens Flares and spectral breakdown (chromatic aberration) at the edges.