https://github.com/ustymukhman/threejs-boilerplate
:fire: Three.js + TypeScript + SolidJS + Vite + Vitest :rocket:
https://github.com/ustymukhman/threejs-boilerplate
boilerplate pnpm solidjs template threejs typescript vite vitest webgl webgl2
Last synced: about 1 year ago
JSON representation
:fire: Three.js + TypeScript + SolidJS + Vite + Vitest :rocket:
- Host: GitHub
- URL: https://github.com/ustymukhman/threejs-boilerplate
- Owner: UstymUkhman
- License: mit
- Created: 2017-06-15T13:31:39.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2023-05-25T14:28:30.000Z (about 3 years ago)
- Last Synced: 2025-03-01T04:15:51.309Z (over 1 year ago)
- Topics: boilerplate, pnpm, solidjs, template, threejs, typescript, vite, vitest, webgl, webgl2
- Language: TypeScript
- Homepage: https://ustymukhman.github.io/threejs-boilerplate/dist/
- Size: 7.02 MB
- Stars: 55
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Three.js Boilerplate #
π₯ [Three.js](https://threejs.org/) + [TypeScript](https://www.typescriptlang.org/) + [SolidJS](https://www.solidjs.com/) + [Vite](https://vitejs.dev/) + [Vitest](https://vitest.dev/) π
> Minimal, yet complete template for developing three.js projects.










[](https://ustymukhman.github.io/threejs-boilerplate/dist)
## π Structure ##
```
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
```
π Usage
ββSimply click Use this template and Create a new repository.
ββThis will initialize your own repository from this boilerplate.
β¨ Features
ββββοΈ Basic
βββββΒ β’ Cross-platform Favicons
βββββΒ β’ Meta tags for sharing on Facebook and Twitter
βββββΒ β’ Unsupported browser and disabled JavaScript screens
βββπ§© Components
βββββΒ β’ Application entry point
βββββΒ β’ Logo label component
βββββΒ β’ Current version tag
βββποΈ Sandbox
βββββΒ β’ 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.
βββπ¨ Shaders
βββββΒ β’ Custom shader support through vite-plugin-glsl.
βββββΒ β’ Three.js shaders for ground plane material.
βββββΒ β’ Three.js shaders for custom tone mapping.
βββπ οΈ Utilities
βββββΒ β’ 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.
βββπ§° Miscellaneous
βββββΒ β’ Scoped SCSS and common easing functions.
βββββΒ β’ Support for common 3D formats.
βββββΒ β’ Common assets folders.
βββββΒ β’ PWA-ready manifest.
βββββΒ β’ MIT license.
βββπ¦ Package Manager
βββββΒ 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.
βββπ Tests Coverage
βββββΒ All the code in the src/ directory has been fully tested and has a 100% code coverage.
ββββΒ Show me some numbers!
βββββΒ
πΎ Download
ββgit clone https://github.com/UstymUkhman/threejs-boilerplate.git
ββcd threejs-boilerplate
β¨οΈ Develop
ββpnpm i
ββpnpm start
βοΈ Lint
ββpnpm lint:js
ββpnpm lint:css
π§ͺ Test
ββpnpm test
ββpnpm test:watch
ββpnpm test:cover
π§± Build
ββpnpm build
ββpnpm serve