π₯ Three.js + TypeScript + SolidJS + Vite + Vitest π
Minimal, yet complete template for developing three.js projects.
Three.js Boilerplate
βββ __mocks__/
βββ coverage/
βββ dist/
βββ node_modules/
βββ public/
β βββ assets/
β βββ favicons/
β βββ scripts/
β βββ styles/
β βββ browserconfig.xml
β βββ manifest.json
β βββ robots.txt
β βββ sitemap.xml
βββ src/
β βββ app/
β βββ assets/
β βββ components/
β βββ sandbox/
β βββ scss/
β βββ shaders/
β βββ utils/
β βββ global.d.ts
β βββ main.tsx
βββ tests/
β βββ app/
β βββ components/
β βββ sandbox/
β βββ shaders/
β βββ utils/
β βββ canvas.mock.d.ts
β βββ canvas.mock.ts
β βββ global.spec.ts
βββ index.html
βββ package.json
βββ tsconfig.json
βββ vite.config.ts
βββ vitest.config.ts
ββSimply click Use this template and Create a new repository.
ββThis will initialize your own repository from this boilerplate.
βββββ β’ Cross-platform Favicons
βββββ β’ Meta tags for sharing on Facebook and Twitter
βββββ β’ Unsupported browser and disabled JavaScript screens βββββ β’ Application entry point
βββββ β’ Logo label component
βββββ β’ Current version tag βββββ β’ Simple three.js scene with:
ββββββ β¦ Linear Fog
ββββββ β¦ Ground Plane
ββββββ β¦ Orbit Controls
ββββββ β¦ Stats Monitoring
ββββββ β¦ Perspective Camera
ββββββ β¦ Default WebGL2 Renderer
ββββββ β¦ Ambient & Directional Lighting
βββββ β’ Scene configuration file with initial parameter values.
βββββ β’ Custom checkerboard-like ground plane material.
βββββ β’ GUI controls built on top of lil-gui
.
βββββ β’ Uncharted 2 tone mapping shader.
βββββ β’ Three.js shaders for ground plane material.
βββββ β’ Three.js shaders for custom tone mapping. βββββ β’ Assets loading manager:
ββββββ β¦ Promise based APIs
ββββββ β¦ Loading errors logging
ββββββ β¦ Start, Progress & Complete loading events
ββββββ β¦ usePublicFolder
option for setting assets path
ββββββ β¦ Audio, GLTF/GLB, CubeTexture & Texture loaders
βββββ β’ Array, Color, Number, String & deepFreeze
methods.
βββββ β’ Elastic Number, Vector3 and Vector3 classes.
βββββ β’ Custom Events and EventEmitter manager.
βββββ β’ Mouse Wheel normalization function.
βββββ β’ debounce
and throttle
functions.
βββββ β’ requestAnimationFrame
manager.
βββββ β’ Custom Web Worker manager.
βββββ β’ Unity-like Vector3
directions.
βββββ β’ Spline interpolation manager.
βββββ β’ Screen Viewport manager.
βββββ β’ Support for common 3D formats.
βββββ β’ Common assets folders.
βββββ β’ PWA-ready manifest.
βββββ β’ MIT license. βββββ This project was build with
pnpm
, but yarn
and npm
are also supported.βββββ Just replace
pnpm
in all commands below with yarn
or npm run
.βββββ For
npm
users, one exception is the installation, where it's npm i
.
βββββ All the code in the src/
directory has been fully tested and has a 100% code coverage.ββ
git clone https://github.com/UstymUkhman/threejs-boilerplate.git
ββ
cd threejs-boilerplate