0.49.0 • Published 7 months ago

troika-three-utils v0.49.0

Weekly downloads
18,722
License
MIT
Repository
github
Last release
7 months ago

Troika Three.js Utilities

This package provides various utilities for working with Three.js, particularly having to do with shaders. It is used by Troika 3D, but has no dependencies itself other than Three.js, so it can be used outside the Troika framework.

Installation

Get it from NPM:

npm install troika-three-utils

You will also need to install a compatible version of Three.js; see the notes on Three.js versions in the Getting Started docs for details.

npm install three

Provided Utilities

Several utilities are provided; for a full list follow the imports in index.js to their source files, where each is documented in JSDoc comments.

Some of the most useful ones are:

createDerivedMaterial()

This utility allows you to easily extend existing Three.js materials with your own custom shader code. This is an incredibly powerful tool, and is the secret behind most of Troika's shader-driven tools like troika-three-text, three-instanced-uniforms-mesh, and BezierMesh.

See the createDerivedMaterial documentation page and its source code with JSDoc for details.

BezierMesh

This creates a cylindrical mesh and bends it along a 3D cubic bezier path between two points, in a custom derived vertex shader. This is useful for visually connecting objects in 3D space with a line that has thickness to it.

See the BezierMesh documentation page and its source code with JSDoc for details.

InstancedUniformsMesh

NOTE: InstancedUniformsMesh has been moved to its own three-instanced-uniforms-mesh package.

0.49.0

7 months ago

0.48.0

8 months ago

0.47.2

12 months ago

0.47.0

1 year ago

0.46.0

2 years ago

0.45.0

2 years ago

0.44.0

2 years ago

0.43.0

3 years ago

0.42.0

3 years ago

0.41.0

3 years ago

0.40.0

3 years ago

0.39.0

3 years ago

0.38.1

3 years ago

0.38.0

3 years ago

0.37.0

3 years ago

0.36.0

3 years ago

0.35.0

3 years ago

0.34.0

4 years ago

0.33.1

4 years ago

0.32.0

4 years ago

0.31.0

4 years ago

0.30.0

4 years ago

0.29.0

4 years ago

0.28.1

4 years ago

0.28.0

4 years ago

0.27.0

4 years ago

0.26.0

4 years ago

0.25.0

4 years ago

0.24.0

4 years ago

0.23.0

4 years ago

0.22.0

4 years ago

0.21.0

4 years ago

0.20.0

4 years ago

0.19.0

4 years ago

0.18.0

4 years ago

0.17.1

4 years ago

0.17.0

4 years ago

0.16.0

4 years ago

0.15.7

4 years ago

0.15.6

5 years ago

0.15.3

5 years ago

0.15.0

5 years ago