Tyrbo Make your game

Free three.js assets: models, skies, textures and effects for the web

A three.js game has a constraint the big engines don't: everything downloads before it plays. So what suits it is light, in formats the browser handles well, and under a license that lets you serve the files from your own site without a credits page. GLB models, 1K HDRIs and compact PNG textures tick every box, and every item in this library is CC0.

The library for a three.js game: GLB models, HDR skies, textures, sounds and effect modules. 707 here.

Tyrbo made the effects in this library itself, for three.js. Each is a plain ES module that needs nothing but three.

Models with GLTFLoader

Import the loader from three/addons/loaders/GLTFLoader.js and load the .glb. The result's scene is ready to add, and its animations array holds the clips: make an AnimationMixer for the model, call clipAction with the clip you want, and update the mixer every frame.

Two traps catch everyone once:

  • Cloning a rigged character with clone() breaks its skeleton. Use SkeletonUtils.clone from the addons instead.
  • Download size. Run a kit through gltfpack or glTF Transform to quantize and compress it, then give the loader the matching decoder (MeshoptDecoder or a DRACOLoader). It can shrink a kit a long way.

Lighting from an HDRI

Load the .hdr with HDRLoader, which was called RGBELoader before release r180, the name older tutorials still use. Set the texture's mapping to EquirectangularReflectionMapping and assign it to scene.environment: every MeshStandardMaterial now takes its light and reflections from the sky. The renderer runs it through PMREMGenerator for you. Call PMREMGenerator.fromEquirectangular yourself when you want that work done at load rather than on the first frame, or want to free the original texture afterwards.

Put the same texture in scene.background to see the sky, or keep a flat color there and use the sky for light alone. Turn on a tone mapper (ACES Filmic or AgX) so the brightest part of the sky rolls off instead of clipping to white.

Textures for MeshStandardMaterial

Load each map with TextureLoader and wire it to its slot: map, normalMap, roughnessMap, metalnessMap, aoMap. Three settings decide whether it looks right:

  • Color space: set colorSpace to SRGBColorSpace on the color map only. Normal, roughness and occlusion maps are data and stay linear.
  • Normals: three.js expects the OpenGL convention, green up. A DirectX map works once you set the material's normalScale.y to -1.
  • Repeat: set wrapS and wrapT to RepeatWrapping, and raise repeat to tile a floor.

For pixel art on a plane, set magFilter and minFilter to NearestFilter and turn off mipmaps, or the sprite blurs.

Effects as ES modules

Tyrbo's effects cover fire, smoke, explosions, impact hits, magic, a portal, rain, snow, weapon trails, water and a sky, with screen looks such as pixelate, CRT and a toon outline. Each module exports an effect you construct with your scene and a few options; step it from your render loop with the frame's delta time, and dispose of it along with the scene. The download's demo.html shows it running before you wire it in.

Because they're CC0 and plain source, you can read them, change the shaders and the timings, and ship your edited version with no notice to keep. The particle effects page covers how to keep them cheap.

Questions people ask

Which 3D format suits three.js?

glTF, in its binary GLB form. It's the format three.js's own loaders are built around: one file with meshes, materials, textures and animation, quick for a browser to parse.

Why does my GLB model look dark in three.js?

A MeshStandardMaterial needs light, and an empty scene has none. Add an HDRI as scene.environment, or a hemisphere light and a directional light, and check that the renderer outputs sRGB, the default in recent releases.

Can I use these assets with React Three Fiber?

Yes. React Three Fiber runs on three.js, so the same files load through drei's useGLTF and useTexture hooks, and an effect can run inside a component that hands it the scene and steps it in useFrame.

Do I need to credit the makers in my web game?

No. CC0 asks for nothing, even when the files sit on your own server where anyone can save them from the browser. A credits screen naming Kenney, KayKit or Poly Haven is still a kind gesture.

Make a game with them

Make your game

Sign in to get the plan and its concept art. Both are free.