Skip to main content
deck-shader: a volumetric light beam rendered by a fragment shader, under editable slide text

deck-shader

Decks whose light is computed, not painted.

Write a JSON file. A shader renders the light — volumetric beams, caustics, drifting dust — and you get a .pptx where the text is still editable.

python3 scripts/render.py examples/hello/deck.json

▶ Try it live in the browser — no install

A 6-second render from examples/hello. The text is native PowerPoint text; only the light is baked.


The problem

Every slide background you have ever made is one of three things: a flat gradient, a stock photo, or a blurred blob someone spent twenty minutes on.

None of them have light. They have the suggestion of light — a Photoshop drop shadow, a radial gradient, an overlay at 12% opacity.

Light is a physical process. It scatters through dust, bends at a surface, casts caustics on a floor. That is a few lines of math, and your GPU has been able to do it in real time since 2010.

So: describe the slide in JSON, render the light with a fragment shader, and lay native PowerPoint text on top.

deck.json  ──►  WebGL shader  ──►  background.png  ──►  .pptx (editable text)

Why not just generate the background with a model

Because you can't point at it.

Ask a text-to-image model for "a warm beam of light cutting through a dark room" and you get something plausible. Ask it again and you get a different room. Change the color and the composition moves with it. There is no "no, that beam, move it 40px left" — there is only re-rolling and hoping.

A shader is the same picture, but every property is a named number you can edit.

text-to-image this
change the light's position re-roll, keep your fingers crossed "origin": [0.55, 0.85] → [0.42, 0.85]
run it twice two different pictures byte-identical
brand color drifts between generations one hex, in one place
the deck's 10 slides look related if you're lucky because they share a preset
review a change look at pixels git diff
who can fix it in six months someone with the same model anyone who can read JSON
an agent can check its own work no re-render, assert the number
Top row: three text-to-image renders from one prompt — three different rooms. Bottom row: three shader renders with only origin.x changed — the same room, the beam moved

Top row: one prompt, three runs, three different rooms. Bottom row: one shader, one number changed, everything else identical. Nothing in the bottom row was re-rolled.

The honest tradeoff: a shader cannot give you a photograph. It gives you light, atmosphere, and texture — procedural things. For a person, a product, a street, use a photo. This is the layer that decides whether the photo sits in a scene or on a slide.

Built for the one thing models are actually good at

Ask a model to "design a beautiful slide" and you get an opinion. Ask it to make a number 8% bigger, or move a rule 40px left, or swap the light from #ffc98a to #7fd1ff — and it is flawless.

Layout is a coordinate problem. Typography is a set of numbers. Light is math. All of it is expressible, all of it is checkable, none of it is a matter of taste once you've decided what the page says.

So the deck is a file with pixel coordinates and a shader, and the model works the way it works best: edit → render → look → edit. Every change compiles into something you can see and git diff.

you:   把第 3 页的光往左挪一点,标题再小一号
agent: [edits origin, sizePt] [renders] [opens the png]
       origin x 0.55 → 0.42; title 40 → 36. beam now clears the text.

This is the part most "AI makes your slides" tools skip. They put the model in the role of designer — judgment, taste, one shot, no way to check. It is far better as a craftsman: exact, iterative, verifiable.

The deck is a file. The renderer is a script. Nothing in the loop is un-inspectable.

It ships with a SKILL.md, so Claude Code, WorkBuddy, or any host that reads skills can pick it up as-is.

What you get

.pptx 13.33 × 7.5 in, background is a rendered image, all text is native and editable
.png 1920 × 1080 background plates, if you want to compose in Figma or Keynote
notes per-slide speaker notes, written straight into the pptx

Quickstart

pip install git+https://github.com/anzy-renlab-ai/deck-shader
deck-shader deck.json --out out/deck.pptx

Or from a checkout:

git clone https://github.com/anzy-renlab-ai/deck-shader && cd deck-shader
pip install python-pptx
python3 scripts/render.py examples/hello/deck.json --out out/hello.pptx

Requires Chrome (headless, for the WebGL pass). macOS path is auto-detected; override with CHROME=/path/to/chrome.

A slide is a list of elements at exact coordinates

A paper-white slide: kicker, title, two columns split by a 1px rule at x=656, one red sentence

Content slides are not "title + bullets + a theme". Every element is placed by hand — a text box at x: 704, a 1px rule at x: 656, a 96px number that is allowed to be bigger than the title because on this page it is the subject.

{ "type": "rect", "x": 656, "y": 208, "w": 1, "h": 116, "fill": "#D8DEE4" },
{ "type": "text", "x": 704, "y": 238, "w": 504, "h": 120, "paragraphs": [
    { "align": "left", "lineSpacingPct": 170, "runs": [
      { "text": "每一页只描述它自己要说的那件事。", "sizePt": 17,
        "color": "#142B40", "font": "PingFang SC" } ] } ] }

Three element types: text (paragraphs → runs, each with its own font, size, color, letter-spacing), rect (hairlines, fills, dividers), image.

Canvas is 1280 × 720. 1 px = 0.75 pt, 1 in = 96 px — the numbers are the same ones you'd read off a Figma inspect panel, so you can measure once and type it in.

Three large numbers — 72, 1, 1 — each with a label and a two-line explanation

The full example is examples/precision/.

Why coordinates and not a layout engine

A layout engine chooses where things go. That is exactly the thing you cannot delegate when the deck has to say something: the sentence that matters gets the same weight as the sentence that doesn't, and all ten slides come out looking like the same slide.

Templates are selected. Coordinates are written. The difference shows up as whether a page can be louder than the page before it.

A deck is a JSON file

{
  "preset": { "light": "#ffc98a", "origin": [0.55, 0.85], "dir": [-0.42, -1.0], "intensity": 1.0 },
  "style":  { "font": "Songti SC", "titleColor": "FFFFFF" },
  "slides": [
    {
      "kicker": "DECK · SHADER",
      "title": "光线是可以计算的",
      "titleTop": 330,
      "sub": "把 PPT 的背景交给 WebGL",
      "subTop": 470,
      "notes": "开场:先让他们注意到光,再注意到字。"
    }
  ]
}
field meaning
preset.light light color
preset.origin where the beam enters, in normalized stage coords
preset.dir beam direction
preset.intensity how hard it hits
time shader time; change it and the dust moves, the beam breathes

Why this exists

Two observations.

One. A deck is read in three seconds, and the first thing anyone perceives is not your words — it is the light in the room. Slides with real light read as staged; slides with gradients read as slides.

Two. Agent skills that "generate decks" all stop at layout. They arrange boxes. None of them render anything. The moment you want a背景 that looks photographed, you are back in Photoshop.

This is the missing layer: a renderer, not a template.

Roadmap

  • volumetric beam + floor caustics + dust, parameterized
  • JSON → PNG → editable .pptx
  • absolute element model: text / rect / image at 1280×720, 1px = 0.75pt
  • presets: editorial, glass, dawn, signal
  • video export (15s loop, for social covers)
  • HTML runtime (same shader, live in a browser)
  • paper mode: arXiv PDF → deck outline → rendered deck

Works as an agent skill

SKILL.md is included. Drop the folder into ~/.claude/skills/ (Claude Code), ~/.workbuddy/skills/ (WorkBuddy), or any host that reads SKILL.md, and the agent can render decks directly.

License

MIT.

Metadata

Release files for deck-shader 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deck-shader 0.1.0
File Size Uploaded Provenance Actions
deck_shader-0.1.0.tar.gz 17.6 kB Without provenance Details for deck_shader-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for deck-shader 0.1.0
File Interpreter ABI Platform Actions
deck_shader-0.1.0-py3-none-any.whl Python 3 none any Details for deck_shader-0.1.0-py3-none-any.whl

Total release size: 32.1 kB

Release files / deck_shader-0.1.0.tar.gz

Download URL deck_shader-0.1.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
90c57d8cf41110702dddfed673ad6384cc4fe2c8964108c58b5b80d4e7c31f1d
BLAKE2b-256 checksum
How to use checksums
1267dac372b68555c6fb5f07a595d062956f08f7550f7126719ca69d06027016
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / deck_shader-0.1.0-py3-none-any.whl

Download URL deck_shader-0.1.0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3c0ec855d52bcd0eb5d94a18ec67104c3214847765ed5d8c8a07f8f2411ba8b
BLAKE2b-256 checksum
How to use checksums
ef1be6061daf5448b69e3c8426896a37349226486f4361d5f677aa6a97473a33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for deck-shader 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page