hn.today

Show HN: A 3D shower shelf in Three.js without Blender or heavy HDRIs

showerthoughts.dev5 points0 comments
Screenshot of Show HN: A 3D shower shelf in Three.js without Blender or heavy HDRIs

A personal portfolio of shower-inspired product ideas is presented as an interactive Three.js bathroom scene: projects appear in apothecary bottles on a stone shelf, which visitors can rotate, inspect, and click. The central challenge was making the glass convincing while avoiding large downloaded assets and keeping the experience responsive on phones. The account argues that lighting, geometry, and loading strategy matter more than relying on elaborate modeling tools or heavyweight environment maps.

For the glass, a six-panel studio scene is generated in memory and converted with PMREM, using narrow warm and cool highlights against dark panels to create crisp reflections. The setup can be recolored for four bathroom themes without additional network requests; glass transmission also requires keeping transparency disabled and adjusting attenuation settings. Bottles are built from about a dozen profile points spun with Three.js LatheGeometry, while 64 animated condensation beads per bottle are rendered together through instancing. To prevent mobile startup stalls, a small Web Worker fetches and decodes textures off the main thread, transferring image bitmaps without copying. Critical textures load separately from nonessential ones, and a main-thread fallback supports browsers where workers or bitmap decoding fail. The live scene also lets visitors fog the glass and change themes by interacting with the shower and a loose tile.

Read on showerthoughts.dev0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Show HN: Rust Commander

Show HN: Rust Commander

Rust Commander is a Rust terminal file manager modeled on Midnight Commander, with dual-pane navigation, a persistent shell, archive and remote browsing, and background file operations. Version 0.3.1 adds file-change alerts, viewer copy controls, customizable skins, and faster SFTP previews and copying. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.