THREE.JS / FOUNDATIONS 279

Give a planet two faces.

A generated Earth texture set drives a day/night MeshStandardNodeMaterial, world-space sun response, procedural roughness and bump detail, and a separate Fresnel atmosphere. The forced WebGL2 route is a direct GLSL reference with the same visual contract.

Initializing-

Generating deterministic day, night, and detail maps.

backend
-
material
-
surface
-
atmosphere
-
Shape the planetmaps -> sun -> pbr -> shell
Texture + lighting graphwaiting
maps
-
normal
-
roughness
-
sun
-
emissive
-
range
-

The day/night maps and detail map stay local; the sun direction is uniform-driven, while the surface reads world-space normals and position.

Material contractswaiting
color
day/night
clouds
-
bump
-
roughness
-
output
-
rebuilds
-

A standard node material owns surface response; a basic node material owns the transparent back-side atmospheric shell.

Backend boundarywaiting
WebGPU
-
WebGL2
-
fallback
-
longitude
-
latitude
-
draw calls
-
resources
-

The fallback is intentionally direct GLSL; it proves the visual idea without claiming that WebGL2 executed the TSL graph.

Sampletexture()

Day, night, and detail maps enter the node graph as explicit texture nodes.

LightnormalWorldGeometry

A world-space dot product determines the moving terminator.

ReliefbumpMap()

Detail height perturbs the standard material normal without new geometry.

ShelloutputNode

A separate back-side basic material turns Fresnel into atmospheric alpha.

CompareGLSL fallback

The direct route keeps the backend ownership boundary visible.

Planet timingwaiting
rebuild ms
-
CPU avg
-
CPU p95
-
frames
-
updates
-
draw calls
-

Adjust the sun or surface policy, then measure thirty frames of the active material path.

mapsworld normalday/nightpbratmosphere

Generated maps pending.

This is a deterministic adaptation of the official TSL Earth example: local maps replace the external 4096 assets, while day/night compositing, world-space sun orientation, Fresnel atmosphere, procedural bump/roughness, and a separate shell remain executable. Texture fidelity, cloud volume, HDR asset quality, and device-wide performance remain open.

Sources: official Earth example · MeshStandardNodeMaterial · MeshBasicNodeMaterial · TSL