Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 months 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 (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-05-25T14:28:30.000Z (over 1 year ago)
- Last Synced: 2024-10-12T14:44:52.811Z (3 months 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: 56
- 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://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/three?style=flat-square)
![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/dev/typescript?style=flat-square)
![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/solid-js?style=flat-square)
![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/dev/vite?style=flat-square)
![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/dev/vitest?style=flat-square)![](https://img.shields.io/github/deployments/UstymUkhman/threejs-boilerplate/github-pages?style=flat-square)
![](https://img.shields.io/badge/coverage-100%25-brightgreen?style=flat-square)
![](https://img.shields.io/github/repo-size/UstymUkhman/threejs-boilerplate?color=yellowgreen&style=flat-square)
![](https://img.shields.io/github/package-json/v/UstymUkhman/threejs-boilerplate?color=orange&style=flat-square)
![](https://img.shields.io/github/license/UstymUkhman/threejs-boilerplate?color=lightgrey&style=flat-square)[![](./public/assets/images/preview.jpg)](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 oflil-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
andthrottle
functions.
βββββΒ β’requestAnimationFrame
manager.
βββββΒ β’ Custom Web Worker manager.
βββββΒ β’ Unity-likeVector3
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 withpnpm
, butyarn
andnpm
are also supported.
βββββΒ Just replacepnpm
in all commands below withyarn
ornpm run
.
βββββΒ Fornpm
users, one exception is the installation, where it'snpm i
.
βββπ Tests Coverage
βββββΒ All the code in thesrc/
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