正在加载视频...

视频加载失败

Three.js doesn't own the layout — CSS does. Opted-in [data-layout] elements are batched-read (init + resize) and mapped to world space. Children are inferred from parent boxes when possible. That same pass pulls computed styles and detects line breaks, so WebGL text wraps exactly the same. SDF keeps smaller...

106,660 次观看 • 6 个月前 •via X (Twitter)

13 条评论

Johnny Slack 的头像
Johnny Slack6 个月前

We recently shipped Shopify Design. 

 Here's a technical breakdown of how I built it. 🧵

Johnny Slack 的头像
Johnny Slack6 个月前

Ortho to perspective in 16 floats. 

 In flat mode the camera uses orthographic projection — mirrors the DOM.
 On press-and-hold, all 16 matrix values lerp toward perspective with a cubic ease. Content lifts, FOV widens. One lerp gives a webpage depth.

Johnny Slack 的头像
Johnny Slack6 个月前

Each photo is downsampled and split into 3–6 mesh planes by brightness — darks, mids, highlights.
 As you dive, they separate in depth. Block-noise “data moshing” displaces UVs per slice, while each color channel is sampled at slight offsets — creating the chromatic tearing through the image.

Johnny Slack 的头像
Johnny Slack6 个月前

The dive is layered with shader-driven effects: RGB channel splitting tears through images, barrel warp bends the viewport, Voronoi cell noise pulses through the wireframe grid, and a particle field fills the space between.

Johnny Slack 的头像
Johnny Slack6 个月前

The dive effect is driven by a post-process shader: edge detection + a noise-warped radial sweep + oscillating glow. Noise octaves control the crackle (scaled per GPU tier).
 Additional passes layer in radial zoom blur, barrel distortion, and vignette — all synced to the transition.

Johnny Slack 的头像
Johnny Slack6 个月前

The reveal mask reuses the electric edge's shape to cut the canvas — transparent outside, WebGL inside. It's the final pass that pulls everything together, hiding any misalignment between DOM and 3D geometry right where the crackling edge sits.
 The effect isn't just aesthetic, it's structural.

 Final result slowed down ↓

Johnny Slack 的头像
Johnny Slack6 个月前

See it live and don't forget to take the 💊 →

symbols 的头像
symbols6 个月前

Cute

Glauber 的头像
Glauber6 个月前

Inspiring and mind blowing - well done

Ste 的头像
Ste6 个月前

is flash back?

fohyspek 的头像
fohyspek6 个月前

how do you opt in the data layout elements? i feel like u imply that the opt-in is hardcoded. if i wanted to generalise this idea as a library what do you think would be the optimal strategy to intelligently do the opt-in. im thinking heuristics

Carlito 的头像
Carlito6 个月前

This is absolutely insane!!

Dan Heywood 的头像
Dan Heywood6 个月前

I’d love some sort of code demo on what this part specifically looks like. Sounds incredibly powerful to be able to create a layout normally and have it render inside three js

相关视频