r/webgl • • 13m ago

Golf Melee — a daily 3D mini-golf game in Three.js where all geometry, skies, water, and audio are generated in code

Post image
2 Upvotes

I've been building Golf Melee, a free 3D mini-golf game in Three.js that runs in the browser on desktop and mobile with zero external texture, model, or audio files.

Every day at noon (Paris time), a new 3-hole course is generated for everyone to compete on.

Some WebGL / Three.js highlights from the latest updates:

  • 7 procedural biomes: Zen Garden (raked gravel grooves, koi pond, lantern boats, falling cherry petals), Cyber City (lit tower windows, neon edges, flying taxis, holographic bridges, laser barriers), Meadow, Desert, Ice Floe, Volcano, and Space.
  • Real-time time-of-day lighting & December snow/lights overlay: long solar shadows during the day, moonlit night courses with additive light pools and halos, and thresholded bloom so emissive lights glow without blowing out snow.
  • Giant loop-the-loops, spiral slides, and banked turns, plus deterministic physics that the server replays from your shot inputs to verify leaderboard scores.
  • Play as Guest: instant ranked play with no signup required.

Play here: https://golf-melee.pages.dev/


r/webgl • • 12m ago

HTML5 Canvas & WebGL video compositing: synchronizing 60fps video layers with decoupled simulation ticks and Web Audio scheduling

1 Upvotes

Hi everyone,

We are developing **V.E.T.O.R — A Ruptura**, a narrative sci-fi tactical action project built on an in-house engine using HTML5 Canvas / WebGL. In this post, we'd like to share how we tackle multi-layered video compositing, tick decoupling, and sample-accurate Web Audio synchronization.

1. Multi-Layer Video Compositing in HTML5 Canvas

Rendering pre-rendered background scenes alongside dynamic 2D lighting, character sprites, and UI elements requires tight synchronization between the HTMLVideoElement and the canvas rendering context:

  • Rather than naive polling inside a generic requestAnimationFrame loop (which frequently samples the same video frame twice or drops frames due to slight clock mismatches), we hook into the HTMLVideoElement API using requestVideoFrameCallback() (rVFC).
  • Whenever a new video presentation frame is decoded by the browser, rVFC supplies high-precision presentation metadata (now, metadata.mediaTime). We upload or blit the frame directly to our intermediate compositing canvas.
  • Fallback for browsers lacking rVFC: standard requestAnimationFrame coupled with monotonic timestamp tracking to prevent redundant draw calls when video.currentTime hasn't progressed.

2. Decoupling Simulation Ticks from Render Refresh

To guarantee deterministic game logic regardless of variable screen refresh rates (60Hz, 120Hz, 144Hz):

  • The core simulation operates on an accumulator-based fixed timestep (60 ticks/s).
  • Visual interpolation smoothly renders transform positions between previous and current ticks, while the video layer remains locked to the decoded media timestamp.

3. Web Audio Scheduling & Dynamic Attenuation

Audio synchronization across narrative beats is driven entirely through the Web Audio API (AudioContext):

  • All dialogue cues and environmental audio events are scheduled against audioContext.currentTime rather than standard HTML5 audio playback offsets, eliminating drift over longer sequences.
  • For negative-space tension, we use parametric gain automation: gainNode.gain.setValueAtTime(currentGain, audioContext.currentTime); gainNode.gain.exponentialRampToValueAtTime(0.0001, targetTime); This prevents click/pop artifacts when plunging the soundscape into sudden silence before dramatic narrative shifts.

Technical Demonstration & Reference

We recently produced an atmospheric cinematic trailer showcasing this exact pipeline in action (3m31s, 1080p at 60fps), featuring an isolated cabin acting as an unstable temporal anchor, with 5 synchronized radio cues (at 00:29, 01:21, 02:03, 02:52.5, and 03:08) followed by a deliberate silence beat: ▶ Trailer (Technical Timing Reference): https://youtu.be/yAbd7N3jyk4

Project Links

We’d love to hear how other web and graphics developers handle video compositing drift and synchronization across varied browser runtimes!


r/webgl • • 18h ago

Error when not directly calling gl function

1 Upvotes

This code works:

(gl.uniformMatrix3fv)(
    uMatrix, true,
    [
    	1, 0, 0,
    	0, 1, 0,
    	0, 0, 1
    ])

But this code gives the error "Uncaught TypeError: 'uniformMatrix3fv' called on an object that does not implement interface WebGL2RenderingContext"

(true && gl.uniformMatrix3fv)(
    uMatrix, true,
    [
    	1, 0, 0,
    	0, 1, 0,
    	0, 0, 1
    ])

I have never seen javascript act like this. Is there some kind of typing or macro I don't know about?


r/webgl • • 1d ago

I made a 3D stadium where you can check the view from your seat

Thumbnail
seats-view.pages.dev
2 Upvotes

It's Kaloor stadium in Kochi, built with Three.js on top of an open-source stadium model. Pick a stand, row and seat to see the pitch from there. It's unofficial and seat positions are estimates.


r/webgl • • 3d ago

Ember: a word made of glowing embers that the cursor blows on and the scroll burns away, with ink-dissolve transitions

0 Upvotes

This is a demo for an imaginary wood-fire restaurant, with Three.js and GSAP inside a Next.js page.

What happens on screen:

  • the restaurant's name, in a giant serif, is a bed of cracked embers lit from inside, with sparks coming off the letters;
  • the cursor blows on it, and scrolling consumes it;
  • a pinned section goes through five plated dishes in 3D, each revealed by an ink stain with a glowing edge;
  • everything is generated in code, no textures to download.

The page weighs 1724 KB once built.

To be clear about how it was made: an AI coding agent designed and built it, and my friend and I publish the specification (scene code included) as a free prompt. We sell other ones.

Live demo, it runs in the page: https://siteinone.app/prompts/ember?utm_source=reddit&utm_medium=post&utm_campaign=jv-yx6ivu

I'd like technical criticism: the dissolve edge, the sparks, and anything that stutters on your GPU (tell me which one).


r/webgl • • 6d ago

Yard: a parametric backyard home configurator in Three.js

1 Upvotes

I’m building Yard with Three.js and React Three Fiber. The floor plan drives the geometry, so swapping a layout or roof profile updates the building while the orbit camera keeps moving.

The walkthrough shows the same model assembled, with exposed framing, and in an exploded view. The sun study moves the lighting as you scrub the time of day. I’d be interested in feedback on whether the framing and shadow views stay readable while the camera moves.

Demo: https://yard.itssudhir.com/

Video walkthrough: https://www.reddit.com/r/threejs/comments/1y5w9uc/i_built_a_3d_backyard_home_configurator_with/


r/webgl • • 7d ago

what got my webgl2 air traffic control game running ok on a mid range phone

3 Upvotes

been building a 3d atc game in three.js that has to run in a phone browser, my test phone is a galaxy a55. few things that actually mattered

phones get their own tier. render at about 1 css pixel internally, fxaa, one shadow cascade, 30 fps cap, then a single cas sharpen pass on the way out. looks way better than native dpr and stuttering

adaptive quality drops effects first and resolution last. if frame times go bad it sheds stuff like clouds before it touches render scale, and the scale moves in a few fixed steps so it doesnt jitter around every second

trees, buildings, taxiway joints and jet bridges are all instanced meshes and the airport lights are one point cloud. draw calls were the real killer on mobile before that

shaders compile behind the loading screen with KHR_parallel_shader_compile where it exists. before that the first time a new plane type came into view the whole thing hitched

on desktop theres nothing temporal in the default path, no taa, so a still camera is actually still. matters more than i thought for atc since you stare at the same view for ages

if anyone wants to poke at it on their phone https://approach-world-atc.app and theres a ?q=mobile param to force the phone tier on pc

curious what other people do for mobile shadows, one cascade still feels heavy


r/webgl • • 7d ago

Building a custom HTML5 Canvas + WebGL video synchronization engine with frame-accurate pause & time dilation for V.E.T.O.R — A Ruptura

0 Upvotes

Hi r/webgl! I wanted to share some technical insights and architectural challenges from developing our indie action-RPG, V.E.T.O.R — A Ruptura (~80% complete), which runs on a custom HTML5 Canvas rendering pipeline packaged for desktop Windows.

Frame Synchronization & Time Dilation

One of our core technical goals was blending high-fidelity cinematic video sequences seamlessly with real-time interactive Canvas/WebGL overlays. Rather than relying on simple DOM video elements on separate layers, our pipeline synchronizes video frame updates directly:

  1. requestVideoFrameCallback integration: We bind video playback callbacks to sync canvas render cycles with exact video decode presentation timestamps. This prevents frame micro-stuttering and visual tearing during fast action.
  2. Semi-Turn Tactical Pause & Time Dilation: When players engage tactical pause, the rendering loop scales game time down while keeping camera transforms, targeting vectors, and particle shaders responsive in real time. This allows precise tactical targeting while navigating intense encounters.
  3. Boss Interaction Mechanics: In our Limbo Spider encounter, a living hostage is held captive in an energy web cocoon on the boss body. Reckless area damage harms the captive, so tactical pause and sub-frame collision detection are crucial for targeting specific weak points to break the barrier safely.

You can see the system in action in our 149-second 1080p 60fps gameplay showcase: https://www.youtube.com/watch?v=vtvE_7ay2_4

Desktop Runtime & Demo V7.1

We package the web runtime for desktop Windows execution. We just rolled out Demo V7.1 for Windows (Build 2492372), which resolves interface language rendering issues and refines audio/subtitle sync during memory flashback sequences.

The demo is currently accessible on our official portal (under "Minha conta" for pre-purchasers at R$ 69,00 and invited test participants) and itch.io (US$ 11.72 pre-purchase):

Hardware specs: Windows 11 64-bit, Intel i5-8400 / Ryzen 5 2600, 16 GB RAM, GTX 1050 Ti 4GB, 50 GB storage (internet connection required for AI dialogues, includes 2,000 VT).

Development transparency: Custom HTML5 Canvas engine architecture, logic/architecture assisted by Codex, cinematic pre-rendered sequences assisted by Veo, and localized voice actors.

Would love to discuss canvas video frame synchronization techniques and performance optimizations with the community!


r/webgl • • 15d ago

Batching mobile WebGL2 projectiles without losing their dark cores

1 Upvotes

I’m the developer of Starvoxel: Defender, a mobile merge tower defense running on WebGL2 and Three.js. When I moved the projectile effects from Pixi to Three.js, I wanted to preserve their silhouettes without drawing each trail, core, and accent separately.

The projectile sprites come from one Canvas2D atlas. Red stores body coverage and green stores accent coverage. Each instance supplies its two tint colors, so different shots reuse the same atlas cell. I split the in-flight quads into two instanced batches. The first draws trails and auras additively. The second composites cores and small accents normally on top. A dark projectile core disappears into the glow if you make it additive too. This keeps the in-flight quad layer to two draw calls when both batches are populated.

One practical detail on iOS: our WebGL context-restoration path explicitly rebakes this atlas. I’d include a forced context-loss test in any port that builds its textures at runtime, because a successful first render tells you nothing about that restart path.

The screenshot is a frame from a Dungeon boss fight in the current gameplay trailer. Some game art and the trailer narration were made with AI assistance.

Official gameplay trailer: https://www.youtube.com/watch?v=9XTzlsd1qQM


r/webgl • • 15d ago

Introducing Wima Engine 0.4.0!

Thumbnail
reddit.com
1 Upvotes

r/webgl • • 18d ago

macOS genie effect as a vertex shader: a 16×64 grid that bends, then drains row by row

Thumbnail
uicraft.in
3 Upvotes

r/webgl • • 20d ago

What's new in Verge3D 4.14

Thumbnail
youtube.com
3 Upvotes

r/webgl • • 20d ago

LibreCorsa: Open-source WebGL2 / Three.js motorsport simulator (500 Hz physics, dynamic wet asphalt, volumetric clouds)

16 Upvotes

Play in browser (no install): https://librecorsa.org

GitHub (MIT): https://github.com/KhazP/librecorsa

LibreCorsa is a racing sim I'm building solo on WebGL2 with Three.js.

- Rendering: AgX tone mapping, physically based atmosphere and volumetric clouds (`@takram/three-atmosphere` + `three-clouds`), a wet-road water film that dries along the racing line, a rubbered-in groove, normal-variance specular AA on water, live cockpit mirrors and wheel screens.

- Geometry: meshopt-compressed circuit GLBs that keep the hidden physics colliders bit-exact (`?colliders=1` to see them), and 4-LOD instanced foliage (~14k trees in 9.7 MB on RISE Motordrome).

- Sim: 500 Hz fixed-step 6-DOF physics, Pacejka combined-slip thermal tyres, WebRTC P2P multiplayer, gamepad trigger haptics, and experimental WebHID wheel force feedback.

I hope you guys like it.


r/webgl • • 20d ago

Update on liquid glass: Demo is out

1 Upvotes

r/webgl • • 21d ago

Real-time 3D bass aquarium in WebGL: every mesh and texture generated at load, fish that actually hunt

Post image
2 Upvotes

Everything you see is generated at load in one ~650 KB HTML file with Three.js r160: the fish meshes, the scales

(painted one by one on a canvas), the plants, sand, driftwood, caustics and the post-processing. No glTF, no

images, no video.

The fish are simulated, not animated: two bass (a largemouth and a smallmouth) get hungry, hold by cover, stalk,

and strike with a suction feed that only takes prey whose body depth fits their gape. The shad school and burst

apart when attacked.

Day, night and the weather follow the real clock and weather at Lake Fork, Texas.

It runs 24/7 on YouTube, and the chat can drop in shad (!feed) or cast a lure.

Try it in the browser: https://ksk-baits-bass-aquarium.pages.dev

Live: https://www.youtube.com/@kskbaits/live

Happy to answer questions about any part of it (the fin shaders and the strike were the hardest).


r/webgl • • 22d ago

What’s the best use of 3D you’ve seen on a real website, not a portfolio or tech demo?

6 Upvotes

After a discussion on another sub about whether 3D on websites is worth it, a lot of people said it’s mostly a gimmick, except in a few cases like furniture, cars or anything where size matters.

So I’m curious: what’s a real, live website (a store, a product page, a booking site, anything) where 3D actually made the experience better?

Bonus points if it also loaded fast on your phone 😄


r/webgl • • 23d ago

Magma Cracks, vibe coded

0 Upvotes

Hi!

Doodling and burning tokens. In the end it's a nice demo, maybe will inspire someone with such effects.
Don't forget to enable the sound, bottom right.

I had an idea in my head I had to describe it literally close as I could.
Cheers!

https://vcostin.github.io/doodles/magma-cracks


r/webgl • • 26d ago

Built a browser-based aerobatic flight simulator using Three.js (No plugins, real-time WebGL rendering)

Thumbnail
vimeo.com
0 Upvotes

Hey everyone! I wanted to share a browser-based aerobatic air race project I've been building, powered entirely by Three.js and custom WebGL pipelines.

The project features a full flight loop: a 360-degree garage orbit camera view, dynamic M-14 engine sound states (E key trigger), low-altitude valley slaloms, and precise runway touchdown physics.

How I built it: For the visual pipeline, I handled all the 3D asset breakdown, modeling, and environment design using Blender and LEGO Studio. For the architecture and codebase, I paired up with my development stack to fast-track the coding loop, optimize draw calls, and build out the flight physics logic directly in Three.js. For the soundscape, I handled the audio design and procedural states to match the flight pacing.

Would love to hear your thoughts on the Three.js implementation, performance metrics, or the control scheme!


r/webgl • • 27d ago

Creating a Liquid Glass UI Effect for the Web: Inspired by Apple

1 Upvotes

I made a liquid glass UI effect for the web(trying to copy Apple because thats what the world do)

Webgl helped me made it and hence I decided to make Mac for web too (inspired by windows 11 in react made for web)

I know you have seen many professional people make it, many guys on github, so I tried to make it as realistic and satisfying as I can


r/webgl • • 29d ago

spud3

Thumbnail torpor.com
3 Upvotes

r/webgl • • 29d ago

From a browser building configurator to an assembled GLB — four architectural examples

Thumbnail
gallery
3 Upvotes

Hi everyone,

I wanted to show the digital output of my building configurator, PrintHaus. The examples are a half-timbered house, an English manor house, a defensive tower and a factory hall.

The building geometry comes from a deterministic parametric generator, not from generative AI.

The building is configured in the browser, with controls for its footprint, storeys, roof, openings and facade details. The GLB export contains the assembled scene with its project colours. It is separate from the print export, where parts have to be prepared for a printer.

The screenshots show the saved GLB files opened in CAD Viewer. There is one image for each building. The printable versions linked below are HO-scale examples.

One practical export choice is how much surface detail belongs in the mesh. Compact uses normal maps for surface relief. More detailed options retain finer geometry. The compressed options use Draco and WebP; an uncompressed option uses PNG images without Draco.

For people putting buildings into interactive web scenes, which is usually more useful to you: a lighter mesh with baked surface detail, or detailed geometry that still holds up close to the facade?

PrintHaus: https://printhaus.app/en/ Free registration includes a first free export for personal use.

Printable example files: Half-timbered house: https://makerworld.com/en/models/3483427-half-timbered-house-1-87-h0 English manor house: https://makerworld.com/en/models/3483219-english-manor-house-1-87-h0 Defensive tower: https://makerworld.com/en/models/3483497-defense-tower-1-87-h0 Factory hall: https://makerworld.com/en/models/3483425-factory-hall-1-87-h0


r/webgl • • Oct 30 '26

WebGPU Best Practices

Thumbnail toji.dev
8 Upvotes

r/webgl • • Oct 30 '26

Experimenting with Bindless Textures in WebGPU

Thumbnail toji.dev
6 Upvotes

r/webgl • • Oct 25 '26

Amiga Juggler, 40 years later — a browser tribute

Post image
30 Upvotes

The mirrored balls, the checkerboard floor, that little “ding”…

Try it here: https://www.mahieu.nl/amiga-juggler/en/

To mark the 40th anniversary of Eric Graham’s Amiga Juggler, I made an interactive browser tribute. It starts with the familiar chunky pixels, then opens up into smooth animation, music and a world you can explore with a free camera.

What interested me most was the atmosphere: revisiting that small, strange world and giving it some room to grow.

I used AI tools during development, including help with writing and refining the code. I want to be open about that when sharing the project.

Sound on for the transition! The video is a short preview; in the interactive demo, your browser renders the scene live and you can take over the camera yourself.

Did you see the original back in the day? I’d love to hear what you remember about it.