.hexshader Format Reference
Format 1 package, shader.json, plain GLSL, provenance and how a host admits a .hexshader
Last updated: 2026-11-13
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. |
A package must contain shader.json, source.glsl and provenance.json. A reader refuses any other path inside the zip. 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/ and originals/ 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. |
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. At most 32 parameters, and 64 vec4-equivalents of uniform storage. A colour ramp costs 10. 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.
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.
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
- Check ZIP structure, paths, member count and your host's budgets before extraction or GPU allocation. Refuse a member the package does not allow.
- 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. - Require
shader.json,source.glslandprovenance.json. Refuse any other path. Check content addresses and PNG IHDR forresources/andoriginals/. Compute the package digest from the raw member bytes before repair. - Validate the closed
shader.jsonwith 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. - Compile
hxMainfor the declaredspacewith 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.