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

@fern-solutions/aframe-highlight

v0.2.0

Published

A-Frame component for giving objects a highlight when occluded

Downloads

10

Readme

Highlight component

npm version npm version github twitter mastodon ko-fi

This component adds a highlight to objects. The highlight can be drawn on either the occluded parts (default) or the visible parts (mode: visible). This allows the user to easily and quickly spot them. The highlight consists of accentuating the rim of the object.

Checkout the example: Online Demo | Source

Usage

Load the script from npm or add the following script tag:

<script src="https://unpkg.com/@fern-solutions/aframe-highlight/dist/highlight.umd.min.js"></script>

The highlight component can be attached to any object:

<a-sphere highlight="rimColor: #FF0000; coreColor: #FF0000; coreOpacity: 0.5"></a-sphere>

To ensure certain objects or entities are rendered on top of any highlight (e.g. hands), you can use the above-highlight component:

<a-entity hand-controls="hand: left" above-highlight></a-entity>

Properties

| Name | Type | Default |Description | | ---- | ---- | ------- |----------- | | rimColor | color | #FF0000 | The color at the rim of the object | | rimOpacity | float | 1.0 | The opacity of the rim between 0.0 and 1.0 | | coreColor | color | #000000 | The color at the core of the object | | coreOpacity | float | 0.0 | The opacity of the core between 0.0 and 1.0 | | mode | 'occlusion' or 'visible | occlusion | Whether to show the highlight on occluded or visible parts of the object|

Caveats

This component tries to be a relatively lightweight and does not introduce any post-processing. Instead it renders the highlighted objects one (or two) more times to achieve the effect. There are however a couple of caveats associated with this:

  1. If the object is expensive to draw, the highlight rendering can be expensive as well
  2. The component uses an Object3D directly attached to the scene with renderOrder set to 1000. If you make use of renderOrder make sure there is no conflict.
  3. When rendering the highlight on occluded parts, the object itself is rendered without proper depth testing, meaning for concave objects the highlight won't always match the outer surface.
  4. Multiple objects with highlights when occluded can render in arbitrary order. It's recommended to limit the amount of entities this effect is used on and try to make sure these entities don't overlap each other.