Aetox web 3d

From Mikedev115/Aetox · View interactive version

Aetox web 3d is an AI agent skill from the GitHub repository Mikedev115/Aetox. ตอนงานต้องมีฉากสามมิติ shader หรือ canvas บนหน้าเว็บ ไม่ว่าจะเป็น hero ที่หมุนได้ พื้นหลังที่เคลื่อน โมเดลสินค้า หรือหน้าที่ web-templates ตัดสินว่าเป็นชั้น C

How to use this skill

Skill file

Aetox Web 3D

Three.js r186 (8 ก.ย. 2569). Snippets in references/three-r186.md. Every

public three.js skill read before writing this one stops at the API; none

of them says what the page does when the GPU is not there. That is the part

this file exists for.

The choices are yours: the scene, the material, the light, the motion and

how far to take them. The bar is not, and it is the same bar whichever model

opens this file: a piece ships when it looks finished, runs inside its

frame on a slow machine, and is still a page without the GPU. Nothing below

is a ceiling on the work; all of it is the floor the work stands on.

Four roads; name the one you take

One line, before any code, saying which and why:

  1. CSS 3D. perspective, rotateX/Y, transform-style: preserve-3d.

A tilt, a flip, a stacked-card depth. No canvas, no script that matters.

  1. One shader in one file. Raw WebGL2 and GLSL, no library, ชั้น A.

A hero background, a gradient that breathes, noise, a field of points.

Usually a hundred-odd lines. When it wants a camera you steer, that is

road 3.

  1. three.js. Real geometry, lights, a loaded model, post-processing.

Vendored beside the page (ชั้น B) or npm (ชั้น C);

import * as THREE from "three", addons from three/addons/....

  1. React Three Fiber. The same engine in components; at home when the

page is already React.

Any road is right when the piece calls for it. The habit to watch is taking

road 3 for something a shader draws in a hundred lines, or road 2 for

something that wants a camera; either way, the header says which road and

why, and a change of road mid-build is fine when it is said out loud.

The contract, before the first line

three/addons/capabilities/WebGL.js, or canvas.getContext("webgl2")

on road 2. When it is false, the canvas is removed and what stands in its

place is a real element already in the markup: a still image with

width/height, a gradient, or nothing, because the canvas was

decoration. The page's text, layout and every control are the same

either way.

and stop the loop. The object is there; it does not turn.

behind the canvas is hidden until the scene "arrives".

fallback is tested and how it is shown in the proof.

The bar, in numbers

the page. Over it, the piece is not done: classify first (CPU: many

objects, per-frame allocation; GPU fill: resolution, post passes,

overdraw; GPU vertex: triangle count; memory: textures), change one

thing, measure again.

when those change, not in a requestAnimationFrame loop. A scene that

breathes uses renderer.setAnimationLoop and stops it when the tab is

hidden (visibilitychange) or the canvas is out of view

(IntersectionObserver).

when the frame time doubles.

call is for. A hero lands under ~100; past that, instancing and merged

static meshes come before any other change.

photo. A texture the eye cannot resolve at the size it is drawn is cost

without a picture.

the screen. Take them when they are the point of the piece, say what

they buy, and they count inside the 8 ms.

The bar, in craft

fill that says where the room is, nothing at intensity 1 because the

tutorial had it. Materials read as a material (paper, glass, brushed

metal), not as the constructor's grey.

both themes and does not float over it.

it on a narrow one, never behind the words.

render, or an SVG of its silhouette in the same colours), not a

placeholder gradient. Someone on that page gets the same idea.

camera walk that follows the copy. Ambient motion with no reason reads as

a screensaver.

r186 facts that old snippets get wrong

three/examples/jsm in an app import.

need texture.colorSpace = THREE.SRGBColorSpace, data textures do not.

near black now; intensities are candela and lux, so start around 3 for a

point light in a small scene and scale to taste.

question left.

to WebGL2 on its own. For a page, WebGL is still the road unless the

brief names WebGPU; TSL is a different language to learn.

Lifecycle

set camera.aspect, camera.updateProjectionMatrix(),

renderer.setSize(w, h, false).

geometry, material and texture you created, then renderer.dispose(),

then stop the loop. The GPU holds what JS forgot.

Clock is deprecated in r186. Never += 0.01 per frame.

Prove it, then say what was measured

Before saying it works: the canvas is not blank (pixels vary), draw calls

and frame time at the heaviest moment under 4x CPU throttle, the ?nogl=1

page, the prefers-reduced-motion: reduce page, and a narrow viewport.

Five screenshots or it is a guess, and a guess does not ship. Five, taken

once at the end, at reduced scale; the numbers (renderer.info, frame

times, the pixel check) are text and carry every iteration before that.

The numbers

go in the file header next to the road and its reason (STANDARD.md ข้อ 6);

a header without them is the header of a page that was not measured.

aetox-verify before the sentence "it runs".

Hand-offs

aetox-motion.

aetox-frontend-design.

and reach for the project's own dependencies with aetox-brainstorm.

What is not an exit

"Every modern device has WebGL" is true of the devices on the desk and

false of the one the client will open the file on, in a webview, behind a

GPU blocklist. "The fallback can come later" is a page that is blank

today. "It runs at 60 on my machine" is a number from a machine nobody

else has; throttle it.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.