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

layered-material

v0.2.0

Published

A threejs material to manage texture layers.

Downloads

18

Readme

LayeredMaterial

A threejs material to manage texture layers. MaterialLayers are defined as described below and set to the LayeredMaterial property layers. The Material takes care of the combination of the layers due to their configurations.

The material is intended to be used on landscape surfaces. It supports triplanar mapping and texture randomization to prevent the classical tiling effect.

** This is a first version, not yet stable **

Clone

To clone the project:

git clone https://github.com/pvogel2/LayeredMaterial.git

Installation

Install the node module :

npm install layered-material

To include the modules in node:

import MaterialLayer from 'layered-material/dist/jsm/MaterialLayer';
import MeshLayeredMaterial from 'layered-material/dist/jsm/MeshLayeredMaterial';

To include the plain javascripts in the browser:

<script src="<path/to/node-module>/dist/js/MaterialLayer.js"></script>
<script src="<path/to/node-module>/distjs/MeshLayeredMaterial.js"></script>

Usage

To use the MeshLayeredMaterial you also need to use the MaterialLayer, a defined format for configuring all properties used for a layer of the material.

Basic support for tileable diffuse maps and bump maps is provided, also the option to randomize the tiling. Slope and range settings can be configured including transition areas for smooth blending between layers.

MeshLayeredMaterial

To create a new layered material:

const new MehsLayeredMaterial({ layers: [], direction: new THREE.Vector3(0, 1, 0)});

The material is based on phong material properties.

Properties:

layers Array <MaterialLayer> Array of MaterialLayer objects

direction THREE.Vector3 The direction in world coordinates for stacking the layers

MaterialLayer

To create a new layered material:

const new MaterialLayer();

id Unique id of the layer

range Array <Number> lower and upper limit

rangeTrns Array <Number> lower and upper transition range

slope Array <Number> lower and upper limit

slopeTrns Array <Number> lower and upper transition range

map Image diffuse texture image

bumpMap Image bump texture image

bumpScale Number bump scale

specularStrength Number the strength of the specularity of the layer

specularColor THREE.Color the color of the specularity of the layer

Development

Start dev server on port 5000:

npm run dev

The browser interface of the dev server provides a live view on an editable simple predefined material setup.

alt text

alt text