What it is
A 3D block of Harrow Basin, a fictional sedimentary basin: 6 × 4 km and 3 km deep, with one corner cut away. Seven rock units from Quaternary sands down to the basement are drawn in petroleum-chart fills. An anticline in the middle is broken by three normal faults (two form a crestal graben), a salt diapir rises on the east side and pierces the deeper layers, and the reservoir sandstone holds a gas cap and an oil leg above the oil/water contact. Three views share the model: Geology, a synthetic Seismic section and the interpreted Horizons. Five wells (two producers, one of them a geosteered horizontal, an appraisal well, a dry hole and one being drilled) carry surface equipment and composite logs. Everything is synthetic and seeded; the point is the technique.
Engineering decisions
- The model is pure TypeScript (
core/model.ts, unit-tested): six horizon fields on a 241 × 161 grid (25 m), each a sum of a regional dip, the anticline, drape over the diapir and seeded fBm relief. The salt top is its own field that rises through the horizons above it, so piercing needs no special case: anything deeper than the salt top is salt, anything deeper than the basement top is basement. - Faults are planes with strike, dip, side and a throw that tapers to zero at the tips. A point is restored by lifting it by the local throw of each fault whose hanging wall it sits in; the restored depth is then compared with the horizon fields. Changing the throw only changes a uniform.
- The block is a handful of plain quads (an L-shaped solid around the cut). A WebGL 2 fragment shader runs the same restore-and-classify for every pixel: horizons come from two RGBA float textures read with
texelFetch and a manual bilinear blend (no dependency on float-linear filtering), faults are uniforms. Sections stay sharp at any zoom and always match the readout, which runs the same code in TypeScript on the picked point. - Fills are procedural chart patterns (sand dots, chalk bricks, shale dashes, coal seams, salt crosses, basement v's) anti-aliased with
fwidth. They are laid out in restored depth, so the faults visibly offset them. Contacts, fault traces and dashed fluid contacts are drawn the same way. - The ground shows structure contours of the top reservoir (every 50 m, bold every 250 m), coloured by the fluid at that depth, over a 1 km survey grid.
- Gross rock volume of the gas cap and the oil leg is integrated on a 60 × 40 column grid every 10 m from the same classifier and refreshes as the contacts and throw change.
- Seismic is computed per pixel too: reflection coefficients from the acoustic impedance contrast at each interface (with gas and oil lowering the impedance of the sand) are convolved with a Ricker wavelet, in restored depth so the faults offset the reflectors. The fluid contacts add a flat spot, the beds a weak thin-bed layering, the salt a chaotic texture, and the image smears right at the fault planes. It is shown in an interpretation-style red–white–blue ramp.
- Horizons are built in TypeScript (
core/surfaces.ts): each horizon is a 151 × 101 grid moved forward by the faults, and every triangle whose corners sit in different fault blocks, or inside the salt, is left out, so faults appear as gaps (fault polygons) and the diapir as a hole, as on interpreted horizons. They are coloured by depth with 25 m and 100 m contours and lit from the screen-space normal; Top Reservoir shows the gas cap and oil leg and the oil/water contact as a white line. A uniform pulls them apart. - Wells (
core/wells.ts): vertical holes, Bézier build sections from a kick-off point and a geosteered lateral that follows the top of the reservoir into the oil leg with a limited turn rate. Logs are sampled every 10 m from the same classifier: gamma ray per unit with shaly streaks and coal seams, resistivity that jumps in gas and oil. The tubes are coloured along their length by a data texture (fluids in the reservoir) and drawn twice, once normally and once as a faint ghost with an inverted depth test, so a hole can be followed through the rock. The composite log panel is SVG. - Surface equipment is built from code at map-symbol scale: a land rig (substructure, braced lattice mast, crown and travelling blocks, monkey board, doghouse, catwalk, pipe rack, mud tanks, pumps), beam pumpjacks whose cranks, pitman arms and walking beam move together, a wellhead tree and an abandonment marker. Each is merged into a few meshes per material.
- The opening is driven by uniforms only: the block's group scales up out of the floor, the fault throw goes from 0 to its value so the layers visibly slip, then the gas/oil and oil/water contacts sink from the crest to fill the trap while the camera settles. Any input ends it at once.
- HB-5 is drilled live: the tube's draw range grows segment by segment, a hot bit with an additive glow sits at its end (drawn over the rock), and the composite log is cut at the bit's measured depth with the planned hole shaded below.
- Drill your own well: in planning mode the pointer is ray-cast onto the top face and the readout gives a prognosis from the same model (depth to the top of the reservoir, or salt first over the diapir). A tap adds HB-6 to the well list; the scene gives it a rig, a tube and its own bit, and drills it once (each drilling well keeps its own state, so HB-5 carries on). At TD the log panel shows the verdict computed from the log's pay. Three named prospects do the same from the keyboard.
- Hover focus: one uniform names a unit; every other unit desaturates and darkens in the same shader pass, so the reservoir or the seal can be followed through the faults and around the salt.
- The ground is a shader landscape: rotated patchwork fields with crop rows and hedgerows, gravel roads (distance to segments) and well pads. The reservoir's gas cap and oil leg shimmer slowly.
Performance and accessibility
- One draw call for the block, one for the edges, one for the ruler, a few per well and prop. The scene renders when something changes, and every frame only while the pumpjacks run; it stops when the page is hidden or scrolled away and handles a lost WebGL context.
- All text is HTML: title, legend, readout, controls and a description of the block next to the canvas, which is hidden from assistive technology. Keyboard: arrow keys turn, + and − zoom, 0 resets the view, 1 to 3 switch the view, W toggles the wells, Escape closes a log; the view switch is a radio group with arrow keys; every model control is a native range input.
- Reduced motion: no opening, the block does not turn by itself, the pumpjacks and the rig light stand still and HB-5 is shown at total depth.