Docs
Every file on tevy is a plain HTTPS download: no account, no API key, and CORS is open, so a browser can load files straight from tevy.dev. Everything is CC0.
Building with an AI agent
If an AI coding agent writes your code, give it https://tevy.dev/llms.txt. It is a single text page made for agents: what tevy is, the URL layout, the loader setup and every item with a link to its metadata, so the agent picks real assets and uses working URLs instead of guessing.
For example: Read https://tevy.dev/llms.txt and add a spruce forest along the road using tevy models.
Files and URLs
Every section (models, skies, materials) has the same shape:
| /models/<slug> | The page, with a preview and the downloads. |
| /models/<slug>.json | Metadata: files, sizes, sha256, versions. |
| /models/<slug>/v1/lod0.glb | A file of version 1. It never changes. |
| /models/<slug>/lod0.glb | The same file of the latest version. |
| /models/<slug>/v1/preview.webp | The preview image of version 1. |
| /models/<slug>/preview.webp | The preview image of the latest version. |
| /models.json | The latest version of every model in one file. |
Slugs are permanent. Models have levels of detail: lod0.glb is full detail, lod1.glb and up have fewer triangles. Skies have 2k.jpg for background and lighting and 1k.jpg for lighting only. Materials have a color, normal and ORM map in two sizes, such as color-2k.ktx2 and color-1k.ktx2.
Versions: pinned or latest
When an item improves, for example a better tree crown, it gets a new version in a new folder (v2, v3, ...). Older versions stay online for good. Each file has two URLs, and you choose which one to use:
| Pinned | Latest | |
|---|---|---|
| URL | /models/fire-extinguisher/v1/lod0.glb | /models/fire-extinguisher/lod0.glb |
| Changes | Never | When a new version ships |
| Use it for | Anything you ship | Prototypes, demos, always the best version |
- Pin when a change would surprise you. A new version can change the look, the size in meters, the triangle count or the node names, and a pinned URL keeps your project exactly as you tested it.
- Use latest to get improvements without touching your code. Updates reach your visitors as soon as a new version is published.
- To update a pinned project, read version in the metadata, check changes, and change v1 to the new version in your URLs.
- Fixes to names, tags or descriptions do not make a new version; only changes to the files do.
three.js: models
Models are glTF binary files with meshopt-compressed geometry and KTX2 textures, so GLTFLoader needs a decoder for each. Set the loader up once and reuse it for every model.
Load a model
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
// Once per app. renderer and scene: your THREE.WebGLRenderer and THREE.Scene
const ktx2 = new KTX2Loader()
.setTranscoderPath('https://cdn.jsdelivr.net/npm/three@0.186.1/examples/jsm/libs/basis/')
.detectSupport(renderer);
const loader = new GLTFLoader()
.setKTX2Loader(ktx2)
.setMeshoptDecoder(MeshoptDecoder);
const gltf = await loader.loadAsync('https://tevy.dev/models/fire-extinguisher/v1/lod0.glb');
scene.add(gltf.scene);Levels of detail
Load each level into a LOD object and three.js shows the right one for the camera distance.
Switch levels by distance
import { LOD } from 'three';
// Distances in meters at which each level takes over; tune them to your camera.
const distances = [0, 25, 60];
const lod = new LOD();
for (const [level, distance] of distances.entries()) {
const gltf = await loader.loadAsync(`https://tevy.dev/models/fire-extinguisher/v1/lod${level}.glb`);
lod.addLevel(gltf.scene, distance);
}
scene.add(lod);Units
Units are meters, +Y is up and the front faces +Z.
three.js: skies
Skies are Ultra HDR JPEGs: a normal JPEG with an HDR gain map, a fraction of the size of an .hdr file. One file is both the background and the lighting. The sun is in the image, so reflections and soft light come for free; for sharp shadows add a light from the sun values in the sky's metadata.
Use a sky
import { AgXToneMapping, EquirectangularReflectionMapping } from 'three';
import { UltraHDRLoader } from 'three/addons/loaders/UltraHDRLoader.js';
const sky = await new UltraHDRLoader().loadAsync('https://tevy.dev/skies/altocumulus-sunset/v1/2k.jpg');
sky.mapping = EquirectangularReflectionMapping;
scene.background = sky; // what you see
scene.environment = sky; // how everything is lit
renderer.toneMapping = AgXToneMapping;
renderer.toneMappingExposure = 0.733;exposure is a suggested starting point for AgX tone mapping. The 1K file is enough when you only need the lighting, for example with your own sky shader.
three.js: materials
Materials are seamless PBR texture sets for large surfaces such as roads and ground. Each has three KTX2 textures: color (sRGB), normal (OpenGL convention, which three.js uses) and ORM, which packs occlusion, roughness and metalness like glTF. They load with the same KTX2Loader as the models.
Use a material
import { MeshStandardMaterial, RepeatWrapping, SRGBColorSpace } from 'three';
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
// Once per app (the same loader the models use).
const ktx2 = new KTX2Loader()
.setTranscoderPath('https://cdn.jsdelivr.net/npm/three@0.186.1/examples/jsm/libs/basis/')
.detectSupport(renderer);
const [color, normal, orm] = await Promise.all(
['color', 'normal', 'orm'].map((map) => ktx2.loadAsync(`https://tevy.dev/materials/asphalt/v1/${map}-2k.ktx2`)),
);
color.colorSpace = SRGBColorSpace;
// One repeat covers 4 m. Repeat it over a plane of size width x depth in meters.
for (const texture of [color, normal, orm]) {
texture.wrapS = texture.wrapT = RepeatWrapping;
texture.repeat.set(width / 4, depth / 4);
}
const material = new MeshStandardMaterial({
map: color,
normalMap: normal,
aoMap: orm, // occlusion in red
roughnessMap: orm, // roughness in green
metalnessMap: orm, // metalness in blue
});tileSize in the metadata is the size in meters of one repeat, so the texture keeps its real scale on any surface. The 1K maps are a quarter of the download and look the same beyond a few meters.
Moving parts, animation and wind
A model's metadata says what can move: parts lists its moving nodes, animations its animation clips, and wind is true when it carries wind data. Each model page shows the same.
Moving parts
Wheels, steering wheels and similar pieces are separate nodes with their origin at the pivot and stable names, such as wheel_FL (front left; a model's left is +X). Wheels spin around the car's X axis, the axle, and the front wheels steer around Y. Small parts such as a steering wheel can be left out of the lower levels of detail.
Drive the wheels
import { Quaternion, Vector3 } from 'three';
// Moving parts are separate nodes with their origin at the pivot. Wheels on
// one side are turned to face out, so turn each wheel from its rest pose.
const names = ['wheel_FL', 'wheel_FR', 'wheel_RL', 'wheel_RR'];
const wheels = names.map((name) => gltf.scene.getObjectByName(name));
const rest = wheels.map((wheel) => wheel.quaternion.clone());
const spinQ = new Quaternion();
const steerQ = new Quaternion();
let spin = 0;
// Each frame: distance driven this frame and wheel radius in meters,
// steer in radians (positive turns left, front wheels only).
spin += distance / radius;
wheels.forEach((wheel, i) => {
spinQ.setFromAxisAngle(new Vector3(1, 0, 0), spin);
steerQ.setFromAxisAngle(new Vector3(0, 1, 0), i < 2 ? steer : 0);
wheel.quaternion.copy(steerQ).multiply(spinQ).multiply(rest[i]);
});Animated people
People are skinned meshes on one shared 55-joint skeleton, with their clips in the same file: idle, walk, wave and look_around. Every level of detail keeps the skeleton and the clips. Joint names are stable, so you can attach things to them, such as a bag to hand_R. Because the skeleton is shared, a move made in code fits every person: the viewer's dance, cheer, jump, clap and high five are a few joint rotations keyed with three.js, with no change to the files.
Play a walk
import { AnimationMixer, Timer } from 'three';
import { clone } from 'three/addons/utils/SkeletonUtils.js';
const gltf = await loader.loadAsync('https://tevy.dev/models/astronaut/v1/lod0.glb');
// Skinned models need SkeletonUtils.clone for each extra copy.
const person = clone(gltf.scene);
scene.add(person);
const mixer = new AnimationMixer(person);
const clip = (name) => gltf.animations.find((c) => c.name === name);
const walk = mixer.clipAction(clip('walk'));
walk.play();
const timer = new Timer();
// Each frame. The walk is made for 1.3 m/s, so move the person at that
// speed while it plays; people face +Z.
timer.update();
const dt = timer.getDelta();
mixer.update(dt);
person.position.z += 1.3 * dt;
// To stop: blend into the idle clip over 0.4 s.
// walk.crossFadeTo(mixer.clipAction(clip('idle')).play(), 0.4);Wind
Trees and plants carry a _WIND vertex attribute: how far each vertex sways, a phase so branches do not move in step, and how much leaves flutter. A few lines in the vertex shader make them move; tune the numbers to the wind you want. Shadows use their own material, so they stay still unless you patch customDepthMaterial the same way.
Sway in the wind
// _WIND per vertex: r = sway (0 at the trunk base, 1 at the tips),
// g = phase, b = leaf flutter. GLTFLoader names the attribute _wind.
const time = { value: 0 };
gltf.scene.traverse((object) => {
if (!object.isMesh || !object.geometry.attributes._wind) return;
object.material.onBeforeCompile = (shader) => {
shader.uniforms.windTime = time;
shader.vertexShader = shader.vertexShader
.replace('#include <common>', `#include <common>
attribute vec4 _wind;
uniform float windTime;`)
.replace('#include <begin_vertex>', `#include <begin_vertex>
float phase = _wind.g * 6.2832;
float sway = _wind.r * 0.12 * sin(windTime * 1.4 + phase);
float flutter = _wind.b * 0.02 * sin(windTime * 9.0 + phase * 7.0);
transformed.x += sway + flutter;
transformed.z += 0.6 * sway - flutter;`);
};
});
// Each frame: time.value = timer.getElapsed();Other engines
Any engine that reads glTF with the EXT_meshopt_compression and KHR_texture_basisu extensions can load the models.
React Three Fiber
import { useGLTF } from '@react-three/drei';
import { useThree } from '@react-three/fiber';
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
const ktx2 = new KTX2Loader().setTranscoderPath('https://cdn.jsdelivr.net/npm/three@0.186.1/examples/jsm/libs/basis/');
export function Model() {
const gl = useThree((state) => state.gl);
// drei decodes meshopt itself; KTX2 textures need the loader above.
const { scene } = useGLTF('https://tevy.dev/models/fire-extinguisher/v1/lod0.glb', false, true, (loader) => {
loader.setKTX2Loader(ktx2.detectSupport(gl));
});
return <primitive object={scene} />;
}Babylon.js
import { ImportMeshAsync } from '@babylonjs/core';
import '@babylonjs/loaders/glTF';
// Babylon decodes meshopt and KTX2 itself.
const result = await ImportMeshAsync('https://tevy.dev/models/fire-extinguisher/v1/lod0.glb', scene);model-viewer, no build step
<script type="module" src="https://cdn.jsdelivr.net/npm/@google/model-viewer@4.0.0/dist/model-viewer.min.js"></script>
<model-viewer src="https://tevy.dev/models/fire-extinguisher/v1/lod0.glb" camera-controls auto-rotate shadow-intensity="1"></model-viewer>Skies open as ordinary JPEGs anywhere; for the HDR range your engine needs to read the gain map (three.js does, through UltraHDRLoader).
Metadata and indexes
- An item's metadata, such as /models/fire-extinguisher.json, describes the latest version. versions lists every version, newest first, with its date, what changed, its preview and its files.
- Every file has its byte size and sha256, so you can check a download or cache files by hash.
- models.json, skies.json and materials.json hold the latest version of every item of a section in one file, for tools and build scripts. The version history is in each item's own file.
You can also download files and host them yourself; CC0 allows any use.