DESCENT 是一个用 Three.js 和 TypeScript 构建的卡通渲染下坡 BMX 竞速游戏,仓库内所有资源均由代码生成,并包含一整套风格化渲染与确定性回放工具链。

Stars

23

7 天增长

暂无数据

Fork 数

7

开放 Issue

0

开源协议

暂无数据

最近更新

2026-08-01

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它展示了不依赖任何外部模型、纹理、字体或音频,如何用代码生成完整游戏资产;同时实现了结构化的非真实感渲染(NPR)管线、水力侵蚀地形与可复现的测试机制。

适合谁使用

  • 对 Three.js/WebGL 游戏开发感兴趣的开发者
  • 想研究卡通渲染/NPR 技术的美术或技术美术
  • 程序化生成与地形模拟爱好者
  • BMX/竞速游戏玩家或独立游戏玩家

典型使用场景

  • 作为 WebGL 卡通渲染和非真实感绘制的参考实现
  • 学习代码生成资产、程序化地形与侵蚀模拟
  • 构建固定时间步物理和相机系统的竞速游戏原型
  • 使用确定性浏览器捕获做视觉回归对比

项目优势

  • 全部资源由代码生成,无外部下载依赖,内容管线统一且可复现
  • NPR 渲染有结构性约束:无 PBR、色相偏移阴影、量化光照、双线系统与可变线宽
  • 地形使用噪声加液滴水力侵蚀与热侵蚀,并结合赛道走廊生成真实山体路径
  • 工程实践扎实:120Hz 固定物理步长、自适应分辨率、接口化架构和确定性捕获工具

使用前须知

  • 性能目标为高配置设备(如 M5 Pro)上的 retina 60fps,中低端设备可能无法达到
  • 操作组合多,技巧门槛较高,休闲玩家不易上手
  • 所有资源由代码生成,意味着修改美术内容需通过代码或重新生成,而非直接替换文件

README 快速开始

DESCENT

A cel-shaded downhill BMX racing game. Four riders, point to point, summit to valley floor. Built in Three.js and TypeScript.

Every asset in this repository is generated by the code in this repository. No downloaded models, textures, HDRIs, fonts, or audio. Every mesh is built from geometry primitives and procedural lathes in code. Every texture is rasterised with canvas 2D or evaluated in a shader. Every sound is synthesized with the Web Audio API. The mountain is noise plus a hydraulic erosion simulation. The letterforms in the HUD are drawn as paths.

npm install
npm run dev

That is the whole setup. Open the URL it prints and you are racing.


Controls

W / Pedal
A D / Steer
S / Rear brake — locks the back wheel, scrubs speed, throws dirt
QFront brake
SpaceCrouch → preload. Hold into a lip, release at the top for extra air. Also bunny-hops on flat ground.
J / KLean back / forward. Lean back on the flat to manual.
Shift + directionTrick modifier 1 (tailwhip, x-up)
E + directionTrick modifier 2 (superman, tabletop)
FBoost — spends the meter you filled with tricks
RReset to the last checkpoint
CLook back
VCycle camera
EscPause
`Debug overlay

A standard gamepad works too; the left stick bypasses the keyboard's input smoothing.

The one mechanic worth learning: preload and pump. Hold crouch on the approach to a lip and release it at the lip. Time it well and you leave the ground with substantially more vertical velocity than the ramp gave you. Release early and you go flat. There is a ~140ms window and it is the skill ceiling of the whole game.


Art direction

One committed palette: dawn-gold alpine. A low sun at 21.5° raking across the mountain from the east-southeast, cool violet-slate shadows, and a teal-shifted haze stacking the far ridges into flat paper layers. Every colour in the game is declared in src/npr/Palette.ts and nowhere else.

Three rules the code enforces structurally, not by convention:

  1. There is no PBR to leak in. There is no MeshStandardMaterial anywhere in the project and no code path that could construct one. Every surface is a CelMaterial built from a RampPreset.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

TanStack
精选
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web 开发前端框架
14,861
vercel-labs
精选
vercel-labs GitHub avatar

scriptc

scriptc compiles ordinary TypeScript into small, fast native executables without needing Node.js, V8, or any JavaScript runtime in the binary.

开发者工具代码质量与构建
1,985
bashalarmistalt
精选
bashalarmistalt GitHub avatar

decimen-optical-transfer

A proof-of-concept that transfers files between two devices using only a screen and camera by encoding data as an endless stream of animated QR codes with fountain coding to handle dropped frames.

TypeScript
1,960