Henyey-Greenstein Phase Function
A one-parameter model of the angular distribution of scattered light in a medium; the asymmetry g runs from strongly backward (negative) to strongly forward (positive) scattering.
Also known as HG phase, Cornette-Shanks (variant)
In the family Atmosphere, water & volumes, scattering
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | Official add-on | @babylonjs/addons atmosphereFunctions.fx miePhase (Henyey-Greenstein Mie scattering phase) docs |
| Godot 4.7 | Built in | Environment.volumetric_fog_anisotropy drives henyey_greenstein(cos_theta, g) in volumetric_fog_process.glsl docs |
| Unity | Built in | HDRP Fog > Anisotropy; Local Volumetric Fog > Anisotropy docs HDRP volumetric fog and clouds use the HG phase function. |
| Unreal 5.7 | Built in | SkyAtmosphereComponent Mie Anisotropy and VolumetricCloud MaterialExpressionVolumetricAdvancedMaterialOutput dual-lobe Phase controls docs |
| Blender 5.2 | Built in | Shader Editor > Add > Shader > Volume Scatter > Phase = Henyey-Greenstein docs |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
A phase function gives the probability density of light scattering from one direction into another, and depends only on the cosine of the angle between them. The HG form is (1 - g^2) divided by 4 pi times (1 + g^2 - 2 g cos theta) to the power 1.5. With g = 0 it is isotropic; g near 0.7 to 0.9 gives the strong forward lobe seen on clouds and aerosol haze near the sun; negative g gives backscatter. It integrates to one over the sphere and has an exact importance-sampling inverse, so it is cheap in both ray marchers and path tracers. Real media often need two lobes: a forward and a backward HG lobe blended, which also approximates the silver lining and dark core of clouds. Rayleigh scattering uses its own dipole phase and should not be replaced by HG.
When to choose it
Reach for it when
- fog and clouds need forward scattering glow
- volume scattering direction needs one tunable parameter
- light halo around sun seen through haze
- cheap anisotropic scattering for participating media
Choose it whenever you need anisotropic scattering for fog, clouds, atmospheric Mie scattering or skin-like media at the cost of one pow per evaluation.
Prefer the Rayleigh phase inside Ray-marched Rayleigh/Mie Single Scattering for molecular scattering, and use a two-lobe HG mix in Nubis-style Ray-marched Volumetric Clouds or Multiple-Scattering Approximation by Octaves when a single lobe cannot capture both the sun glare and the backscattered brightness. For exact droplet behaviour use tabulated Mie phase functions offline.
Field marks
- Single lobe cannot reproduce the real Mie peak: glory and fogbow are missing
- Using g close to 1 gives a very narrow lobe that aliases in ray marching with few samples
- Forgetting the 4 pi normalization makes fog energy scale wrongly with g
- Applying HG to Rayleigh scattering gives wrong sky polarisation-free brightness and color
- Mismatch of sign convention for the angle (view vs light direction) flips forward and backward scattering
Presets
Henyey-Greenstein anisotropy g = -0.6, 0, 0.8 on a backlit medium
{
"SIGMA": 3.5,
"RAD": 0.72,
"LIGHT": 14
}Show GLSL (32 lines)
// A uniform-density sphere of scattering medium, lit from behind, single scattering only.
// Three panels differ ONLY in the Henyey-Greenstein anisotropy g: -0.6 (back), 0 (isotropic), +0.8 (forward).
const float SIGMA = 3.5;
const float RAD = 0.72;
const float LIGHT = 14.0;
float hg(float c, float g) { float g2 = g * g; return (1.0 - g2) / (12.566371 * pow(1.0 + g2 - 2.0 * g * c, 1.5)); }
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
float pw = iResolution.x / 3.0;
int panel = int(floor(fragCoord.x / pw));
float g = panel == 0 ? -0.6 : (panel == 1 ? 0.0 : 0.8);
vec2 uv = (fragCoord - vec2((float(panel) + 0.5) * pw, 0.5 * iResolution.y)) / (0.5 * pw);
vec3 col = vec3(0.015, 0.02, 0.03) + 0.02 * (uv.y * 0.5 + 0.5);
vec3 ro = vec3(uv, 3.0), rd = vec3(0.0, 0.0, -1.0);
vec3 L = normalize(vec3(0.25, 0.15, -1.0));
float b = dot(ro, rd); float h = b * b - dot(ro, ro) + RAD * RAD;
if (h > 0.0) {
float t0 = -b - sqrt(h), t1 = -b + sqrt(h);
float ds = (t1 - t0) / 24.0; vec3 acc = vec3(0.0);
for (int i = 0; i < 24; i++) {
float s = (float(i) + 0.5) * ds; vec3 p = ro + rd * (t0 + s);
float bl = dot(p, L); float tl = -bl + sqrt(max(bl * bl - dot(p, p) + RAD * RAD, 0.0));
acc += vec3(1.0, 0.95, 0.85) * SIGMA * ds * exp(-SIGMA * s) * exp(-SIGMA * tl) * hg(dot(L, rd), g) * LIGHT;
}
col += acc;
}
float edge = fract(fragCoord.x / pw);
if (edge < 0.004 || edge > 0.996) col = vec3(0.3);
col = 1.0 - exp(-col * 1.5);
fragColor = vec4(pow(col, vec3(1.0 / 2.2)), 1.0);
}
Attribution: written for this index
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| henyey-greenstein-phase-function-specimen | Tesla T4 1920x1080 | 3.19× baseline (light) · 0.105 ms / 0.107 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| henyey-greenstein-phase-function-specimen | NVIDIA L4 1920x1080 | 3.08× baseline (light) · 0.049 ms / 0.049 ms · 2.1× faster on L4 | opengl-timer-query · Cross-architecture validation |
| henyey-greenstein-phase-function-specimen | NVIDIA A100-SXM4-40GB 1920x1080 | 2.26× baseline (light) · 0.065 ms / 0.065 ms · 1.6× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): cited by Delta (Woodcock) Tracking, Multiple-Scattering Approximation by Octaves, Ray-marched Participating Media.
Crosses
- Ray-marched Participating Media: Gives the per-sample phase weight applied to in-scattered light.
- Froxel Volumetric Fog: Used when injecting light into each froxel to produce a forward-scattering halo around lights.
Sources
- primaryL. C. Henyey, J. L. Greenstein (1941). Diffuse radiation in the Galaxy. The Astrophysical Journal.Verified via crossref · 2026-11-29doi:10.1086/144246
- tutorialMatt Pharr, Wenzel Jakob, Greg Humphreys. Phase Functions (Physically Based Rendering, 4th ed.). pbr-book.org.Verified via live page · 2026-11-29