npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adatechnology/game-render-three

v0.2.0

Published

Owner of the GPU-facing state of a three.js game: the one ThreeLib type, a LightBudget with a fixed number of lights (slots, priority, fades), a ProgramWarmup that links every shader program at load and keeps it linked, and geometry and material pools.

Readme

@adatechnology/game-render-three

Owner of the GPU-facing state of a three.js game (spec 005, D4). In three, the program key of every lit material carries the number of lights, the fog type, the tone mapping and more: change one in the middle of play and the whole scene recompiles. This package keeps those numbers fixed after boot.

  • ThreeLib: the one name of the three namespace (typeof import('three')); narrow it with Pick<ThreeLib, ...>.
  • createLightBudget(THREE, scene, sizes): creates every PointLight/SpotLight/HemisphereLight at boot and never adds, hides or removes one. Clients ask for slots: acquire (short-lived: blast, rocket, flare), addSource (long-lived and competing by priority and distance, follow an object), lease (fixed slots, the room lights of a house) and leaseHemisphere (the weather lightning). Priority preemption with fades, shadow slots first, seal() / check() for the light counts, fog presence and type, scene.environment, toneMapping, outputColorSpace, shadowMap.type and camera far against the neutral fog.
  • createProgramWarmup(): register(probe), registerEffect, registerTexture, warmUp(renderer, scene, camera, { lights, fogStates, target }) links every program once, uploads buffers, seals the budget; probe materials go to anchors and are never disposed (a program is freed when its last material is disposed). linkedSince(renderer) counts linkProgram calls after the warmup: it must stay 0.
  • createFog(THREE, scene, { stable: true }): clear() leaves a neutral linear fog (near 6.0e4, far 6.4e4) instead of null.
  • createGeometryPool() / createMaterialPool(): keys, use counts, retain/register, own for per-frame materials, trim at load points, and a development warning when a pooled resource is disposed directly.
import * as THREE from 'three'
import { createLightBudget, createProgramWarmup, LIGHT_PRIORITY } from '@adatechnology/game-render-three'

const budget = createLightBudget(THREE, scene, { point: 16, pointShadows: 2, spot: 4 })
const warmup = createProgramWarmup(THREE)
warmup.warmUp(renderer, scene, camera, { lights: budget, fogStates: ['linear', 'exp2'] }) // behind the loading screen

const flash = budget.acquire({ owner: 'weapons.muzzle', priority: LIGHT_PRIORITY.muzzle, urgent: true, color: 0xffcc88, intensity: 4, distance: 12, position: [0, 1.5, 0] })
budget.present([camera.position.x, camera.position.y, camera.position.z], dtSeconds) // once per frame
flash?.release()

three is a peer dependency (^0.160.0) and is never imported as a value: pass your THREE. The pools read three's internal renderer.properties.get(material).programs (r160); programKeysOf isolates that read, a test checks it against the installed three, and when it is missing the pools keep every material (more memory, no recompilation).