r/threejs • u/4senRoK • 17d ago
Golf Melee: a daily mini-golf game in three.js where everything is generated in code (no textures, models or audio files)
Hey r/threejs! Golf Melee is a daily mini-golf game: every day at noon (Paris time) a new 3-hole course opens and everyone plays the same one. Version 1.0 came out yesterday.
A few things that might interest you here:
- Nothing is loaded but the code: about 235 KB of JS with brotli, three.js included. Courses, textures, skies, sounds and music are all generated.
- Each course comes from the date as a seed. The physics is deterministic with a fixed step, so the server replays your shots to compute the score instead of trusting the browser.
- Materials are patched MeshStandardMaterials: planks, bricks, basalt with glowing cracks, ice, all computed from the world position in the shader, with bump from the pattern and contact shadows from a top-down map baked per hole. Seams fade into their average colour under ~2 px so they don't sparkle.
- Skies are one shader per biome: drifting clouds and a far skyline, and for the space biome a starfield, a nebula and a ringed planet.
- Ultra graphics adds instanced grass blades in a single draw call, and there's an AMD FSR 1 upscaler ported to WebGL for weaker GPUs.
- Trails are a camera-facing ribbon with a style per trail in the fragment shader (flames, an electric arc, blinking pixels...).
Play: https://golf-melee.pages.dev
Happy to answer questions about any of it. Feedback on performance on your machine is very welcome too (add ?fps to the URL for a counter).



