Controls
Core Color
Outer Color
Color Mix
0.80Anim Speed
0.5Density
2.0Turbulence
1.2Flares
0.20Brightness
2.0Scattering
0.60Edge Softness
1.00Edge Noise
0.5Glow Strength
0.8Glow Radius
0.50Glow Threshold
0.20Halo Color
Halo Strength
0.5Halo Scale
1.5Aberration
0.005Description
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.