.hexshader Format Reference

Format 1 package, shader.json, plain GLSL, provenance and how a host admits a .hexshader

Last updated: 2026-11-24

A .hexshader file is a zip of one Shader package. "hexshader": 1 is the first key of shader.json and versions the whole package. The 360 Hextile Shader Workshop is Alpha. This page is the human-readable copy of that package. A version number alone does not prove that any installed app or another renderer supports every feature. For the format overview, the Workshop guide, or a first shader and animation tutorial, follow those separate paths.

The three downloadable example zips on this site are format-1 packages. reader.mjs read, check, inspect and render-data admit those published zips. See Wave-1 reference profile and downloads.

Permission and scope

Build .hexshader support into your own apps, including commercial products. No Hextile purchase, format fee or attribution is required. This specification and its original tutorial examples are dedicated to the public domain under CC0 1.0. Shader packages and their resources may carry their own licenses. Publishing this format does not open-source the 360 Hextile desktop application or license imported shader content. A package's provenance is descriptive metadata, not proof of redistribution rights.

The package

A package is a folder. A saved revision, the agent's workspace and a .hexshader bundle are the same files.

File What it holds
shader.json All authored data. One unit at a time.
source.glsl Entry GLSL. No header. It defines hxMain.
modules/**/*.glsl GLSL modules. The directory is the list.
provenance.json Credits, licenses and lineage. Reviewed. An agent proposes; a person applies it on the Credits card.
resources/<sha256>.png Input image bytes. Immutable. The file name is the content hash.
originals/<sha256>.glsl Third-party source as imported. Immutable.
audio/<sha256>.<ext> Retained audio and data bytes, only when shader.json has an audio block. Immutable. .wav or .json canonical bytes, and the import original (.wav, .flac, .mp3, .mid, .csv or .txt). See audio in the package.

A package must contain shader.json, source.glsl and provenance.json. A reader refuses any other path inside the zip, except audio/ files named by the audio block. Optional cover.jpg sits beside the package and is not a zip member. Text is UTF-8 without a byte-order mark, and writers use LF. A reader checks that each resources/, originals/ and audio/ file hashes to its name, and that a PNG is 8-bit RGBA with the width and height the frame declares.

Nothing that can be recomputed is stored. The package digest is sha256: plus the hex SHA-256 of the member bytes framed as hexshader-package-1. Register sends that digest. The code digest covers source.glsl and modules/** only. The program identity is the generated program for one render profile.

shader.json

One closed JSON object. A reader refuses an unknown key and names it. "hexshader": 1 comes first.

Family Role
meta Title and tags.
space Coordinate space. Leased with the code.
parameters, values The control's shape, and one current value per parameter.
inputs Image slots input1, input2, … and their frames.
passes accumulate, feedback or buffers. One mode.
clock, timeline BPM, speed, and the play range. Times that must be exact are [numerator, denominator].
modulators, drivers Motion sources, and what drives each target.
audio Optional. Retained sound and data resources, the tracks that place them, and the signals measured from them.
controls Mouse, channels, key bindings and an optional camera.
capture, output, view Capture time and seed, 2:1 output size, dome view angles in degrees.
looks Named states.
order Display order for parameters, modulators and Looks.

An address is a list of strings, never a dotted path. ["drivers", "tint.r"] is the driver whose target is tint.r. An edit is set, create, reshape or delete, and it names one unit. Do not replace a parent object.

You and an agent edit the same package. Fields you have touched keep your value unless the agent sends the human number it read. Code, space, passes, and the existence and shape of a parameter or an input slot follow the code lease. Only you move that lease, with Take control or Hand back.

Parameters are float, int, bool, angle, vec2, vec3, vec4, color, color_ramp or enum. Feel fields (label, min, max, step, clamp, control) sit on the parameter. There is no separate UI object. Angles are radians. A colour is { "srgb": [r, g, b] } with each channel from 0 to 1. Up to 1024 parameters. Parameter storage is separate from the 64-unit interface budget (mouse 16, camera 4, each referenced clock name 1, modulator aliases): when parameters would not fit beside those inputs as individual uniforms, the host packs them into uniform blocks automatically. GLSL is at most 31 modules plus the entry, 64 KiB in total, include depth 16.

output.width is exactly twice output.height. Dome diameter and Preserve 360° belong to a render request, not to output.

A Look stores a name, any subset of parameter values, optional capture and output overrides, and optional motion. Applying a Look sets those live fields. It does not replace the Shader, and it does not create or delete parameters.

A modulator kind is time, click, envelope, beat or sampled. beat has period (in beats), length, attack, release and two curves, and needs clock. A sampled modulator has signal_id, which names a row in audio.signals, and an optional spectrum_history. All kinds share alias, label, enabled, output_min and output_max. An alias starts with a letter, holds letters, digits and _ up to 32 characters, is unique, has no __ and does not start with P_.

Which runtime features a Shader needs is derived from the families it has. The package does not carry a capability list.

{
  "hexshader": 1,
  "meta": { "title": "First Shader", "tags": [] },
  "space": "direction_360",
  "parameters": {
    "gain": {
      "type": "float", "default": 0.8, "min": 0, "max": 1, "step": 0.01,
      "control": "slider", "label": "Brightness"
    }
  },
  "values": { "gain": 0.8 },
  "capture": {
    "time": 0, "frame": 0, "time_delta": 0, "frame_rate": [30, 1],
    "seed": 1, "pointer": [0, 0, 0, 0], "ray_origin": [0, 0, 0]
  },
  "output": { "width": 1024, "height": 512, "background": [0, 0, 0] }
}

Beside it: source.glsl and provenance.json. A module at modules/lib/noise.glsl is included from the entry with #include "modules/lib/noise.glsl".

Source and host ABI

source.glsl and every module are plain GLSL. No header, no embedded JSON, no generated text. The native entry is vec4 hxMain(in HxFrag hx). The host supplies the GLSL profile, HxFrag, uniforms and main(). Do not add your own main().

The host builds the program as a generated prologue plus source.glsl, with includes resolved, once per pass. The prologue is not stored. It provides hxParam_<id>, hxSampleInputN(), time uniforms, and the helpers a pass mode needs.

while and do are refused. A for is accepted only when its trip count is a proven constant. A quoted #include resolves from the including file and must not escape the package. Paths are at most 256 bytes.

For direction_360, hx.direction is a unit direction with +Y up and +Z forward. hx.uv runs south to north; hx.mapUv runs north to south. hx.fragCoord is the full-image pixel center from the bottom left, and hx.resolution is the full output size. The context also exposes rayOrigin, rayDirection, time, timeDelta, frame, frameRate, pointer and seed. Native output is linear sRGB with straight alpha. The current PNG writer composites the background and writes opaque encoded sRGB. Other spaces are equirect_map, ray_360 and shadertoy_image. Shadertoy's mainImage is for that space, not for direction_360.

Native linear EXR still export

shader-linear-rgba-exr/1 is a 360 Hextile host export-job profile, not a .hexshader version or a promise to other readers. It exports one saved native direction_360 hxMain frame at exact 2:1 dimensions. Software llvmpipe proof accepts 2048 × 1024 and 4096 × 2048. The helper memory guard is 832 MiB. That proof does not qualify a hardware GPU or an installed app.

The file is a north-first, single-part scanline OpenEXR with FLOAT R, G, B, A channels, ZIP compression, exact full data/display windows and colorInteropID=lin_rec709_scene (scene-linear sRGB/Rec.709 primaries). Native straight alpha is clamped to [0,1] and multiplied into RGB once before writing. Zero alpha writes zero RGB. Finite signed and above-1 RGB survive; nonfinite source values refuse. To composite in scene-linear space, use out = exr.rgb + background.rgb * (1 - exr.a). Apply exposure to linear colour before a display transform; do not decode these channels as sRGB. This contract assumes authored hxMain returns linear colour, which the host cannot infer from arbitrary GLSL.

The job uses the saved package. It creates the selected .exr destination only when absent. An existing target, an unsupported space, an unavailable codec, or a memory or storage refusal does not overwrite the file or substitute PNG. PNG remains the ordinary opaque export.

Time, images and required capabilities

The host supplies sampled content time (hx.time), frame number, delta and exact rational FPS. A sequence samples Start + n/FPS with End exclusive. Preview looping is separate. A preview that looks right does not prove a sequence will render. For the user-facing steps, see the Workshop timeline and first timed shader.

Image inputs are inputN slots sampled with hxSampleInputN. Pixels are sRGB RGBA8 PNG, top-left. filter is linear, nearest or mipmap. Edges are clamp or repeat. An equirectangular slot repeats U and clamps V. A still is one frame at index 0. A sequence has contiguous frames and a positive rational fps. In the ordinary helper, nearest chooses an encoded texel then decodes RGB to linear; linear interpolates encoded sRGB and straight alpha first, then decodes RGB. Alpha is never sRGB-decoded.

passes is one of three modes, and they are not combined:

Mode What it does
accumulate hxPriorColor reads the previous full frame. decay names an existing float parameter.
feedback A separate feedback buffer. No image inputs, clock, modulators, drivers or controls.
buffers Two to five ordered passes. The last entry is hxMain. Every input is a held still. No clock, modulators, drivers or controls.

The Workshop trail stops at 2048 × 1024 and 240 frames. Those are host limits, not fields in the package. Prior pixels are not stored. See A spherical trail.

Audio in the package

audio is optional and closed. It has three arrays, resources, tracks and signals. A writer never writes an empty block. A reader refuses an unknown key and a reference that does not resolve. A package can hold any number of tracks. The Workshop attaches at most 4 audio tracks for now, a product limit and not a format rule. MIDI, curve and label tracks are not counted.

Record Fields
Resource id (audio_<24 hex>), kind (audio, midi, curve or labels), display_name, original_sha256, original_ext, canonical_sha256. Audio adds pcm_profile (pcm16-48k/1), sample_rate (48000), sample_count, channels (1 or 2) and decoder. Data kinds add parser_version (1), duration and a count (note_count, row_count with columns, or label_count).
Track id (track_<24 hex>), label, resource_id, timeline_start. An audio track adds in_sample, out_sample (exclusive, after in_sample, within sample_count), monitor_gain (0 to 1) and monitor_mute. A data track has no trims and no monitor fields.
Signal id (signal_<24 hex>), track_id, measurement, gain (0 to 100), attack and release (seconds, 0 to 60), normalization and offset_ms (−1000 to 1000). window_s (0.5 to 30) only with rolling.

Times (timeline_start, duration) are exact {"num":"<int>","den":"<int>"} seconds. measurement.kind is one of the following. Every analysed kind has profile_id hann2048-hop512/1.

kind Track Fields
rms audio none
band audio low_hz, high_hz. At least one FFT bin (about 23.4 Hz apart) must fall inside.
spectrum audio bands (8, 16, 31, 32 or 64), low_hz (10 or more), high_hz (at most 24000, at least 2 × low_hz), floor_db (−120 or more), ceiling_db (at most 12, at least 6 dB above the floor) and peak (null, or hold_ms 0 to 5000 and fall_db_per_s 1 to 200).
midi_notes midi filter all, note (pitch) or range (pitch_low, pitch_high), 0 to 127, and value trigger, gate or velocity.
curve curve column (from 1), interpolation (linear or step), input_min below input_max.
labels labels mode (trigger or hold) and text (up to 256 characters, null reads every label).

normalization is fixed_full_scale, track or rolling. track and rolling apply to rms and band only. offset_ms shifts the read, not the cached curve, so changing it does not re-analyse. It is visual only.

The audio/ pool holds, for each resource, the canonical bytes (PCM16 48 kHz WAV for sound, JSON for data) and the original import, each named by its SHA-256. Analysis curves are not stored. They are derived, cached on the machine and rebuilt on demand. A render freezes the audio it uses, so replacing a file later does not change an accepted render.

Import limits: an audio original up to 2 GiB and 4 hours; a MIDI, CSV or label original up to 16 MiB. Counts are at most 200,000 MIDI notes, 1,000,000 curve rows and 100,000 labels, and a curve has at most 1024 columns. FFmpeg decodes audio to 48 kHz. A Spectrum curve has a value budget; one over it is refused before any analysis. .mid is notes only (no CC or pitch bend), and MIDI tempo becomes exact seconds, so the Shader BPM never applies.

The published reader.mjs and WebGL2 reference page admit the three example zips and do not read audio. Audio support is in 360 Hextile. A host that does not know audio must refuse the package, not drop the block, because shader.json is closed. A sequence with audio also needs soundtrack-<track_id>.wav and timing.json next to its frames; see Shader Output. Agent steps are on Audio from an agent.

Wave-1 reference profile and downloads

The version-1 example inventory names the reviewed bytes. Its minimal package, composite package and coordinate package are format-1 packages. The composite carries all ten control types, a helper, a still PNG and a Look. These original examples are CC0 1.0. Compare downloaded byte counts, SHA-256 and package digest with the inventory before using a fixture as proof.

reader.mjs read, check, inspect and render-data admit those three format-1 zips. check requires each zip's bytes, SHA-256 and package digest to match the inventory. The package digest is not the zip SHA-256.

The published packages demonstrate direction_360, one root and bounded helpers, all ten parameter types, a Look with complete values and no capture overrides, and still PNG resources sampled with nearest or linear filtering.

The example reader limits are 128 ZIP members, 32 MiB compressed, 64 MiB expanded, 16 MiB per member, 4096×2048 per PNG, 64 MiB decoded RGBA, four input slots, 32 source files and 64 KiB of source text. The standalone draw is 512×256. These are example-host limits, not format-validity rules and not production admission. A host may refuse a package that is valid but too large. Keep the original bytes when a host refuses.

Download the independent Node 22 reader, WebGL2 reference page, and README with proof commands and limits. These links name the reviewed bytes. The headless proof uses software WebGL2 and software native GL. It does not certify an installed app or a physical GPU.

Integration

  1. Check ZIP structure, paths, member count and your host's budgets before extraction or GPU allocation. Refuse a member the package does not allow.
  2. Read "hexshader". Refuse a version newer than you know, and say it was made with a newer 360 Hextile. Accept an older version by upgrading it in memory. Opening does not write.
  3. Require shader.json, source.glsl and provenance.json. Refuse any other path. Check content addresses and PNG IHDR for resources/ and originals/. Compute the package digest from the raw member bytes before repair.
  4. Validate the closed shader.json with your copy of the field rules. Unknown keys, bad values and a digest mismatch are malformed. A budget refusal is separate: the package may be valid and still too large for that host. Name the key.
  5. Compile hxMain for the declared space with the host prologue. Keep interactive playback separate from a sequence sample. Admit the whole package before you publish it or run it.

The published example zips are already format 1. reader.mjs check is the reader for those three files.

Start with the complete native shader tutorial, then use the Workshop guide to see how Hextile authors, saves and exports its own packages. A minimal shader in one host is not a cross-GPU parity certificate.

Esc
Searching...
No results found.
Type to search the documentation
↑↓ Navigate ↵ Select Esc Close

We use cookies for analytics, and to measure whether our Google ads lead to purchases. No ad personalisation. Privacy Policy