π₯ 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