0xsline/OpenChatCut / src/agent/skills/shader-gen
shader-gen
VerifiedAI shader generator for WebGL video effects, transitions, masks, and color grading (LUT / 调色 / 电影感 / film look). Use when the user wants a video effect (滤镜 / 特效), a transition (转场 / crossfade / wipe / cube / 3d), a mask (蒙版 / 遮罩 / reveal), a zoom / push-in (推近 / 推镜头), or a color grade — try the built-in effects (zoom, builtin LUTs) before generating a new shader.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.7 KB |
| examples/cube-rotate.md | markdown | 2.2 KB |
| examples/door-open.md | markdown | 4.1 KB |
| examples/page-curl.md | markdown | 4.1 KB |
| references/design-principles.md | markdown | 12.3 KB |
| references/property-changes.md | markdown | 4.4 KB |
examples/cube-rotate.md
View on GitHub---
tags: 3d, cube, rotate, box, spin
description: 3D cube rotation — outgoing on front face, incoming on right face, rotates 90° around Y axis.
complexity: high
---
# Cube Rotate Transition
Uses BoxGeometry with per-face materials. Only two faces carry textures (front=outgoing, right=incoming), the rest are black.
Key decisions:
- `BoxGeometry(1.5 * aspect, 1.5, 1.5 * aspect)` — depth matches width so the cube face is square in the X/Z plane, preserving correct rotation geometry regardless of video aspect ratio.
- `camera.position.z = 2.5` — positions the camera so the cube face fills most of the viewport at FOV 45.
- Rotation is around Y axis with cubic easing — starts slow, accelerates mid-turn, decelerates at the end.
```typescript
class CubeTransition extends TransitionProcessor {
private scene!: Scene;
private camera!: PerspectiveCamera;
private cube!: Mesh;
private outMat!: MeshBasicMaterial;
private inMat!: MeshBasicMaterial;
async initialize(ctx: TransitionInitContext): Promise<void> {
const aspect = ctx.width / ctx.height;
this.scene = new Scene();
this.camera = new PerspectiveCamera(45, aspect, 0.1, 1000);
this.camera.position.z = 2.5;
const geometry = new BoxGeometry(1.5 * aspect, 1.5, 1.5 * aspect);
this.outMat = new MeshBasicMaterial();
this.inMat = new MeshBasicMaterial();
// Front face (index 4) and Right face (index 0)
const materials = [
this.inMat,
new MeshBasicMaterial({ color: 0x000000 }),
new MeshBasicMaterial({ color: 0x000000 }),
new MeshBasicMaterial({ color: 0x000000 }),
this.outMat,
new MeshBasicMaterial({ color: 0x000000 }),
];
this.cube = new Mesh(geometry, materials);
this.scene.add(this.cube);
}
protected render(ctx: TransitionRenderContext): WebGLTexture {
this.outMat.map = ctx.three.wrapTexture(ctx.outgoingTexture);
this.inMat.map = ctx.three.wrapTexture(ctx.incomingTexture);
// Cubic easing
const p = ctx.progress;
const eased = p < 0.5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2;
this.cube.rotation.y = -eased * (Math.PI / 2);
return ctx.threePass(this.scene, this.camera);
}
}
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |