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

@jaimebboyjt/three-double-texture-materials

v0.1.0

Published

A Three.js library for combining textures easily

Readme

npm

Three double texture materials

Three double texture material (I know, I know, long name right...) is a simple yet in many occasion useful npm pkg that extend your materials in three.js, making them possible to add a second texture ,this includes PBR textures like: normalMap, aoMap, roughnessMap etc.

Making them possible to easily combine them without a specialized software like blender, substance designer or armory paint. Keep in mind that this tool doesn't replace those softwares

Installation

npm i @jaimebboyjt/three-double-texture-materials

Usage

All three classes share the same blending parameters and helper methods. The blending is driven by an internal Perlin noise texture — no extra setup required.

Common parameters

| Parameter | Type | Default | Description | |---|---|---|---| | blend | number | 0.5 | Blend point between the two textures (0–1). | | feather | number | 0.1 | Width of the transition edge. Larger values produce a softer blend. | | noiseScale | number | 1 | Tiling scale of the noise texture used for the transition. | | noiseMap | Texture \| null | Perlin (built-in) | Override the default noise texture with your own. |

Common methods

| Method | Description | |---|---| | setblend(value: number) | Update blend at runtime (e.g. inside an animation loop). | | setFeather(value: number) | Update feather at runtime. | | setNoiseScale(value: number) | Update noiseScale at runtime. |


DTMeshBasicMaterial

Extends MeshBasicMaterial. Accepts all standard MeshBasicMaterialParameters plus a second color map.

| Extra parameter | Type | Description | |---|---|---| | secondMap | Texture \| null | Second albedo texture to blend with map. |

import * as THREE from 'three'
import { DTMeshBasicMaterial } from '@jaimebboyjt/three-double-texture-materials'

const loader = new THREE.TextureLoader()

const material = new DTMeshBasicMaterial({
  map: loader.load('/textures/grass/albedo.jpg'),
  secondMap: loader.load('/textures/rock/albedo.jpg'),
  blend: 0.5,    // blend midpoint
  feather: 0.15, // edge softness
  noiseScale: 2,    // noise tiling
})

// Animate the transition at runtime
function animate() {
  requestAnimationFrame(animate)
  material.setBlend(Math.sin(Date.now() * 0.001) * 0.5 + 0.5)
  renderer.render(scene, camera)
}
animate()

DTMeshStandardMaterial

Extends MeshStandardMaterial. Accepts all standard MeshStandardMaterialParameters plus a full second PBR texture set.

| Extra parameter | Type | Description | |---|---|---| | secondMap | Texture \| null | Second albedo texture. | | secondNormalMap | Texture \| null | Second normal map. | | secondRoughnessMap | Texture \| null | Second roughness map. | | secondMetalnessMap | Texture \| null | Second metalness map. | | secondAoMap | Texture \| null | Second ambient occlusion map. | | secondDisplacementMap | Texture \| null | Second displacement map. |

import * as THREE from 'three'
import { DTMeshStandardMaterial } from '@jaimebboyjt/three-double-texture-materials'

const loader = new THREE.TextureLoader()

const material = new DTMeshStandardMaterial({
  // First PBR set (standard three.js params)
  map:           loader.load('/textures/moss/albedo.jpg'),
  normalMap:     loader.load('/textures/moss/normal.jpg'),
  roughnessMap:  loader.load('/textures/moss/roughness.jpg'),
  aoMap:         loader.load('/textures/moss/ao.jpg'),

  // Second PBR set
  secondMap:           loader.load('/textures/metal/albedo.jpg'),
  secondNormalMap:     loader.load('/textures/metal/normal.jpg'),
  secondRoughnessMap:  loader.load('/textures/metal/roughness.jpg'),
  secondAoMap:         loader.load('/textures/metal/ao.jpg'),

  blend: 0.5,
  feather: 0.1,
  noiseScale: 1,
})

DTMeshPhysicalMaterial

Extends MeshPhysicalMaterial. Identical second-texture API to DTMeshStandardMaterial, with the addition of all MeshPhysicalMaterialParameters (clearcoat, transmission, iridescence, etc.).

| Extra parameter | Type | Description | |---|---|---| | secondMap | Texture \| null | Second albedo texture. | | secondNormalMap | Texture \| null | Second normal map. | | secondRoughnessMap | Texture \| null | Second roughness map. | | secondMetalnessMap | Texture \| null | Second metalness map. | | secondAoMap | Texture \| null | Second ambient occlusion map. | | secondDisplacementMap | Texture \| null | Second displacement map. |

import * as THREE from 'three'
import { DTMeshPhysicalMaterial } from '@jaimebboyjt/three-double-texture-materials'

const loader = new THREE.TextureLoader()

const material = new DTMeshPhysicalMaterial({
  // Physical-only params
  clearcoat: 1,
  clearcoatRoughness: 0.1,

  // First PBR set
  map:          loader.load('/textures/ice/albedo.jpg'),
  normalMap:    loader.load('/textures/ice/normal.jpg'),
  roughnessMap: loader.load('/textures/ice/roughness.jpg'),

  // Second PBR set
  secondMap:          loader.load('/textures/rock/albedo.jpg'),
  secondNormalMap:    loader.load('/textures/rock/normal.jpg'),
  secondRoughnessMap: loader.load('/textures/rock/roughness.jpg'),

  blend: 0.4,
  feather: 0.2,
})

DTMeshBasicNodeMaterial

Soon

DTMeshStandardNodeMaterial

Soon

DTMeshPhysicalNodeMaterial

Soon

Contributing

We are open to contributions, please read the contributing guide to get started.

License

MIT

Sponsors

Be the first to support this project here ☺️.