# three.js

> The standard WebGL and WebGPU 3D engine: scenes, cameras, materials, loaders.

Source: https://tastebase.ehsanulsiam.workers.dev/browse/three

free

The standard WebGL and WebGPU 3D engine: scenes, cameras, materials, loaders.

by mrdoob and contributors[GitHub](https://github.com/mrdoob/three.js)[npm](https://npmjs.com/package/three)

[visit](https://threejs.org/?utm_source=tastebase&utm_medium=referral&utm_content=detail-page)

[https://threejs.org](https://threejs.org/?utm_source=tastebase&utm_medium=referral&utm_content=detail-preview)

## Try these

no preview

### [React Three Fiber](https://tastebase.ehsanulsiam.workers.dev/browse/r3f)

React renderer for three.js: build 3D scenes as JSX components with hooks.

no preview

### [OGL](https://tastebase.ehsanulsiam.workers.dev/browse/ogl)

Minimal WebGL library (about a tenth of three.js) for custom shader effects.

no preview

### [Spline (react-spline)](https://tastebase.ehsanulsiam.workers.dev/browse/spline)

Embed 3D scenes designed in the Spline editor as a React component.

no preview

### [GSAP](https://tastebase.ehsanulsiam.workers.dev/browse/gsap)

Timeline animation engine with ScrollTrigger, SplitText, Flip and MorphSVG, now free including every plugin.

## Looks that pick it

[Minimal](https://tastebase.ehsanulsiam.workers.dev/looks/minimal)[Neon / cyber](https://tastebase.ehsanulsiam.workers.dev/looks/neon)[Aurora](https://tastebase.ehsanulsiam.workers.dev/looks/aurora)[Holographic](https://tastebase.ehsanulsiam.workers.dev/looks/holographic)[Cyberpunk](https://tastebase.ehsanulsiam.workers.dev/looks/cyberpunk)[Synthwave](https://tastebase.ehsanulsiam.workers.dev/looks/synthwave)[AI glow](https://tastebase.ehsanulsiam.workers.dev/looks/ai-glow)[Sci-fi HUD](https://tastebase.ehsanulsiam.workers.dev/looks/sci-fi-hud)[Bento grid](https://tastebase.ehsanulsiam.workers.dev/looks/bento-grid)[Flat design](https://tastebase.ehsanulsiam.workers.dev/looks/flat-design)[Document / Notion-like](https://tastebase.ehsanulsiam.workers.dev/looks/document)[SaaS marketing](https://tastebase.ehsanulsiam.workers.dev/looks/saas-marketing)[and 4 more](https://tastebase.ehsanulsiam.workers.dev/looks)

## For your agent

##### Install

`npm i three && npm i -D @types/three`

##### Use it for

- a 3D product viewer or configurator outside React
- custom shader scenes and WebGPU experiments
- the engine under r3f, drei, ShaderGradient and Spline exports

##### Skip it when

- React apps: use r3f so the scene follows React state and unmounts cleanly
- a 2D gradient or noise background: use paper-shaders
- a designer-built scene with no code edits: use spline

##### What's inside29 free

- Scenes
- Cameras
- Geometries
- Materials
- Lights
- Textures
- Loaders
- Objects
- Renderers (WebGLRenderer, WebGPURenderer)
- Animation
- Audio
- Helpers
- Math
- Nodes
- TSL (three.js Shading Language)
- Controls
- Postprocessing
- Effects
- Environments
- Exporters
- Curves
- Lines
- Csm
- Gpgpu
- Physics
- Modifiers
- Interactive
- Inspector
- Webxr

##### Facts

**Frameworks**
vanilla, vue, svelte, solid, angular

**Styling**
unstyled

**Weight**
large

**Accessibility**
weak

**Maturity**
established

**License**
MIT

**Price**
Free

##### Pairs with

[React Three Fiber](https://tastebase.ehsanulsiam.workers.dev/browse/r3f)[GSAP](https://tastebase.ehsanulsiam.workers.dev/browse/gsap)

##### Alternatives

[React Three Fiber](https://tastebase.ehsanulsiam.workers.dev/browse/r3f)[OGL](https://tastebase.ehsanulsiam.workers.dev/browse/ogl)[Spline (react-spline)](https://tastebase.ehsanulsiam.workers.dev/browse/spline)

[Compare three.js with its alternatives](https://tastebase.ehsanulsiam.workers.dev/alternatives/three-alternatives)

```
import * as THREE from 'three'

const el = document.getElementById('scene')!
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true })
renderer.setPixelRatio(Math.min(devicePixelRatio, 2))
renderer.setSize(el.clientWidth, el.clientHeight)
el.appendChild(renderer.domElement)

const scene = new THREE.Scene()
const camera = new THREE.PerspectiveCamera(50, el.clientWidth / el.clientHeight, 0.1, 100)
camera.position.z = 3
const mesh = new THREE.Mesh(new THREE.TorusKnotGeometry(0.6, 0.2, 128, 16), new THREE.MeshNormalMaterial())
scene.add(mesh)

renderer.setAnimationLoop((t) => { mesh.rotation.y = t / 2000; renderer.render(scene, camera) })
```

https://threejs.org/examples/

Loading website

[Visit](https://threejs.org/?utm_source=tastebase&utm_medium=referral&utm_content=floating-pill)
