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

three-ntc

v0.2.0

Published

Neural Texture Compression runtime for three.js — load .ntc files as a node material.

Readme

three-ntc

npm version npm downloads ci Live demo

Neural Texture Compression runtime for three.js — load .ntc files and get back a standard MeshPhysicalNodeMaterial (via TSL) that decodes a compact grid + MLP model on the GPU.

Eight NTC materials rendered live in the three-ntc grid viewer

An implementation of NVIDIA's 2023 Neural Texture Compression paper: NTC jointly fits a material's whole texture stack — albedo, normal, roughness, metalness, and more — into a single grid + MLP model instead of one texture per channel. Every material pictured above is about 93KB total, often smaller than a single texture from the original material, for a fraction of the memory and download cost of standard PBR textures.

Try it live at three-ntc.ben3d.ca.

.ntc models are trained with the companion three-ntc-trainer package.

Install

npm install three-ntc

Usage

import { NTCLoader, NTCNodeMaterial } from 'three-ntc';

const loader = new NTCLoader();
const { cpuModel, channelClassification } = await loader.loadAsync('gold.ntc');

const material = new NTCNodeMaterial(cpuModel, channelClassification);
const mesh = new THREE.Mesh(geometry, material);

NTCNodeMaterial extends three.js's MeshPhysicalNodeMaterial, so it drops straight into an existing WebGPU renderer scene alongside ordinary materials.

Runtime sampling

const material = new NTCNodeMaterial(cpuModel, channelClassification, {
  samplingMode: 'nearest', // default
  lodBias: 0,
});

// Sampling changes rebuild the TSL graph and compile a specialized shader on next use.
material.setSamplingMode('stochastic'); // or 'nearest' / 'trilinear'
material.samplingMode = 'nearest';     // equivalent property setter
material.setLodBias(1);                // live uniform; positive bias selects finer mips

| Mode | MLP evaluations per material sample | Behavior | | --- | --- | --- | | nearest | 1 | Reconstruct the nearest physical texel at the nearest mip. | | stochastic | 1 | Randomly select a texel and mip with trilinear sampling probabilities. Noise varies by screen pixel and frame. | | trilinear | 8 | Reconstruct and blend four texels at each of two mip levels. |

Sampling mode is a JavaScript build-time choice, not a shader uniform. Each shader contains only its selected sampling path. Changing the property or calling the setter rebuilds the material's channel nodes and marks it for recompilation. Selecting the same mode again does nothing. Existing grid textures, decoder parameters, UV/LOD settings, and debug view are retained; training updates still upload in place.

Stochastic sampling follows the paper's UV/LOD jitter approach. It introduces noise; this library and the website currently apply no temporal reconstruction. Its expected material-channel values match trilinear filtering, but averaging shaded samples is not equivalent to shading averaged material channels. Add a temporal resolve in the renderer when using this mode for stable images.

The old interpolation option and setInterpolation() have been replaced by samplingMode and setSamplingMode(). Sampling controls runtime reconstruction, not the training model or its learned G0/G1 feature interpolation. Settings are not stored in .ntc exports. setLodBias() affects automatic LOD only; an explicit constructor lodNode takes precedence. The website viewer and trainer preview both expose sampling and LOD bias controls and start with nearest sampling.