html-to-3d-texture

A workflow for turning a web page or React component into a PNG image that can be displayed on the surface of a 3D model. It uses browser or canvas capture and then loads the image as a Three.js texture.

In plain words
What is it for?
Use it to capture UI screens at a chosen size and resolution, save them as PNG textures, and apply them to screens or other surfaces in Three.js models.
Why use it?
A web interface cannot be placed directly on a 3D screen as HTML. Capturing it as an image creates the texture that the 3D scene can display.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/random6913/claude-code-superkit/html-to-3d-texture
Any agent
npx skills add RaNDoM6913/claude-code-superkit --skill html-to-3d-texture
Clone the repo
git clone --depth 1 https://github.com/RaNDoM6913/claude-code-superkit

Made for: Claude Code, Codex.

Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,043 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00050 $0.01043
Opus 5 $0.00025 $0.00522
Sonnet 5 $0.00010 $0.00209
Haiku 4.5 $0.00005 $0.00104

Measured 2d ago against content hash 5d653443cff0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

html-to-3d-texture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/codex/skills/html-to-3d-texture/SKILL.md · 146 lines

How it starts

The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.

HTML to 3D Texture Pipeline

Capture React components as PNG images for use as textures on 3D model screens.

Architecture

React Component → Capture (Playwright/html2canvas) → PNG → Three.js Texture → 3D Mesh

Best for: production screenshots, pixel-perfect captures.

// scripts/capture-screen.mjs
import { chromium } from 'playwright';

const PORT = process.argv[2] || 3000;
const WIDTH = 440;   // Native screen width
const HEIGHT = 956;  // Native screen height
const SCALE = 2;     // Retina (output: 880x1912)

async function capture() {
  const browser = await chromium.launch();
  const page = await browser.newPage({
    viewport: { width: WIDTH, height: HEIGHT },
    deviceScaleFactor: SCALE,
  });

  await page.goto(`http://localhost:${PORT}/capture`);
  await page.waitForLoadState('networkidle');

  // Find target element
  const el = await page.locator('[data-screen-id="main"]');
  await el.screenshot({
    path: 'public/textures/screen.png',
    type: 'png',
  });

  await browser.close();
  console.log(`Captured: ${WIDTH * SCALE}x${HEIGHT * SCALE}px`);
}

capture();

Method 2: html2canvas (runtime capture)

Best for: dynamic content that changes during session.

import html2canvas from 'html2canvas';
import * as THREE from 'three';

async function captureToTexture(element: HTMLElement): Promise<THREE.CanvasTexture> {
  const canvas = await html2canvas(element, {
    scale: 2,
    useCORS: true,
    backgroundColor: null, // transparent
  });

  const texture = new THREE.CanvasTexture(canvas);
  texture.colorSpace = THREE.SRGBColorSpace;
  texture.needsUpdate = true;

  return texture;
}

Method 3: CanvasTexture from React (live updates)

Best for: real-time UI displayed on 3D surface.

function useHTMLTexture(ref: React.RefObject<HTMLDivElement>) {
  const textureRef = useRef<THREE.CanvasTexture | null>(null);

  useEffect(() => {
    const interval = setInterval(async () => {
      if (!ref.current) return;
      const canvas = await html2canvas(ref.current, { scale: 2 });
      if (textureRef.current) {
        textureRef.current.image = canvas;
        textureRef.current.needsUpdate = true;
      } else {
        textureRef.current = new THREE.CanvasTexture(canvas);
        textureRef.current.colorSpace = THREE.SRGBColorSpace;
      }
    }, 1000 / 10); // 10fps refresh

    return () => clearInterval(interval);
  }, [ref]);

  return textureRef;
}

Read the full file on GitHub · 146 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 146 lines · 50 tokens per session scan A 5d653443cff0

Subscribe to this mod's changes

html-to-3d-texture is a skill published in the GitHub repository RaNDoM6913/claude-code-superkit (2 stars, last pushed 1mo ago), licensed MIT. It adds 50 tokens to every session and 1,043 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

frontend-work

Use when starting or continuing frontend code changes — components, pages, styling, client-side state.

pmikutel/directed-memory-bank · 21 tokens

apm-review-panel

Use this skill to run a multi-persona expert advisory review on a labelled pull request in microsoft/apm. The panel fans out to five mandatory specialists plus a test-coverage specialist (active on every PR that touches src/) plus three conditional specialists (auth, doc-writer, performance-expert), all running in…

microsoft/apm · 178 tokens

batch-bug-shepherd

Use this skill to drive a batch of suspected bugs in microsoft/apm from raw issue list to mergeable PR queue. Fan out one triage subagent per issue (LEGIT / UNCLEAR / FIXED-AT-HEAD), gate every legit bug against PRINCIPLES.md via an apm-ceo strategic-alignment pass, cross-reference legit issues against open PRs, then…

microsoft/apm · 227 tokens

apm-issue-autopilot

Use this skill to drive any open microsoft/apm issue (bug, feature, docs, refactor, perf) from raw intake to a mergeable PR with triage as the central, paramount gate. Run the apm-triage-panel rubric per issue first, then present ONE consolidated triage review for the whole batch and escalate to the maintainer BY…

microsoft/apm · 238 tokens

apm-spec-guardian

Use this skill to run a four-panel adversarial advisory review on any pull request that touches the OpenAPM specification artifact (docs/src/content/docs/specs/openapm-.md), its inline / sidecar JSON Schemas (docs/src/content/docs/specs/schemas/.schema.json), or the conformance fixture seed…

microsoft/apm · 215 tokens

apm-triage-panel

Use this skill to triage one microsoft/apm issue selected by the daily sweep, the status/needs-triage fast path, or manual dispatch. Emit one synthesized comment with a decision, label set, exact milestone, and suggested next action.

microsoft/apm · 59 tokens