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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@google/model-viewer-effects

v1.4.0

Published

Easily add and combine post-processing effects with <model-viewer>!

Downloads

1,612

Readme

<model-viewer-effects>

npm bundle size npm (scoped)

<model-viewer-effects> is a web component library addon for <model-viewer> that makes adding post-processing effects to your models easy to do, on as many browsers and devices as possible.

<model-viewer-effects> strives to give you great defaults for rendering quality and performance.

A 3D Model of a Rocket Ship

ExamplesDocumentation

Usage

Using effects is as simple as adding the <effect-composer> inside your <model-viewer>, and placing any effects inside the composer component.

<model-viewer src="...">
  <effect-composer>
    <bloom-effect></bloom-effect>
  </effect-composer>
</model-viewer>

PostProcessing

<model-viewer-effects> uses the postprocessing library under the hood, for its superior performance and support.

In addition to the built-in effects wrapped by this library, you can add any custom effects/passes that follow the postprocessing spec.

XR Support

The effects are not supported in the <model-viewer> XR modes, which will render as usual.

Installing

NPM

The <model-viewer-effects> library can be installed from NPM:

npm install three @google/model-viewer @google/model-viewer-effects

HTML

<model-viewer-effects> and <model-viewer> share a Three.js dependency. In order to avoid version conflicts, you should bring Three through an import-map:

<!-- ES-Shims for older browser compatibility -->
<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js"></script>

<!-- Import Three.js using an import-map -->
<script type="importmap">
  {
    "imports": {
      "three": "https://cdn.jsdelivr.net/npm/three@^0.169.0/build/three.module.min.js"
    }
  }
</script>

You should then bring the module version of <model-viewer>, along with <model-viewer-effects> from your favourite CDN, such as jsDelivr:

<script type="module" src=" https://cdn.jsdelivr.net/npm/@google/model-viewer/dist/model-viewer-module.min.js "></script>

<script type="module" src=" https://cdn.jsdelivr.net/npm/@google/model-viewer-effects/dist/model-viewer-effects.min.js "></script>

Browser Support

<model-viewer-effects> is supported on the last 2 major versions of all evergreen desktop and mobile browsers, and on all platforms (Android, IOS, MacOS, Windows, Linux).

| | Chrome | Firefox | Safari | Edge | | -------- | --- | --- | --- | --- | | Desktop | ✅ | ✅ | ✅ | ✅ | | Mobile | ✅ | ✅ | ✅ | ✅ |

<model-viewer-effects> builds upon standard web platform APIs so that the performance, capabilities and compatibility of the library get better as the web evolves.

Development

To get started, follow the instructions in the main README.md file.

The following commands are available when developing <model-viewer-effects>:

Command | Description ------------------------------- | ----------- npm run build | Builds all <model-viewer-effects> distributable files npm run build:dev | Builds a subset of distributable files (faster than npm run build) npm run test | Run <model-viewer-effects> unit tests npm run clean | Deletes all build artifacts npm run dev | Starts tsc and rollup in "watch" mode, causing artifacts to automatically rebuild upon incremental changes


Rocket Ship by Daniel Melchior CC-BY via Poly Pizza