open-index/open-npm huggingface dataset:
npm package: @mesmotronic/three-crtpass
Description: CrtPass makes it look like you're watching your Three.js project on an old TV, emulating the visual style of  classic CRT display
Author: Neil Rackett
Latest version: 1.0.1

# CrtPass for Three.js

View your Three.js projects like it's the 80s with this CRT TV post-processing effect for Three.js.

The perfect companion for our colour and resolution reducing [RetroPass](https://npmjs.com/package/@mesmotronic/three-retropass)!

## Installation

```bash
npm install @mesmotronic/three-crtpass
```

Requires `three` as a peer dependency.

## Usage

Here’s an example of how to use CrtPass in your Three.js project:

```javascript
import * as THREE from "three";
import { EffectComposer } from "three/addons/postprocessing/EffectComposer.js";
import { RenderPass } from "three/addons/postprocessing/RenderPass.js";
import { CrtPass } from "@mesmotronic/three-crtpass";

// Scene setup
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

// Time
const clock = new THREE.Clock();

// Composer setup
const composer = new EffectComposer(renderer);
const renderPass = new RenderPass(scene, camera);
composer.addPass(renderPass);

// Add CrtPass
const crtPass = new CrtPass();
composer.addPass(crtPass);

// Render loop
renderer.setAnimationLoop(() => {
  crtPass.update(clock.getElapsedTime());
  composer.render();
});
```

## Screenshots

![Screenshot](https://github.com/user-attachments/assets/eb48f46a-427e-478c-bd1c-b82e4eb6b69e)
npm package: @mesmotronic/three-mesh-bvh-json
Description: Tools for converting three-mesh-bvh data to and from JSON for caching
Author: Neil Rackett
Latest version: 0.0.1

# JSON tools for three-mesh-bvh

This library contains utility methods for serializing BVH data generated by
[three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) into JSON or
easily JSON-able Objects for caching or embedding:

| Method                   | Description                                     |
|--------------------------|-------------------------------------------------|
| serializeToObject        | Serialize MeshBVH instance into plain Object    |
| serializeToJson          | Serialize MeshBVH instance into JSON            |
| deserializeFromObject    | Deserialize MeshBVH instance from plain Object  |
| deserializeFromJson      | Deserialize MeshBVH instance from JSON          |

In addition to the ability to serialize directly to and from JSON format,
support for plain Objects has been included for use with custom `toJSON()`
functions, `fetch` requests and other circumstances where JSON encoding and
decoding is handled by another process

## Install

```bash
npm i github:mesmotronic/three-mesh-bvh-json
```

## Example

### Save as JSON

```typescript
import * as THREE from 'three';
import { MeshBVH } from 'three-mesh-bvh';
import { serializeToJson } from 'three-mesh-bvh-json';

const geometry = new THREE.TorusKnotGeometry(10, 3, 100, 16);
const bvh = new MeshBVH(geometry);
const body = serializeToJson(bvh);

fetch('/api/save-bvh', {
    method: 'POST',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    },
    body
});
```

### Load from JSON

```typescript
import * as THREE from 'three';
import { deserializeFromObject } from 'three-mesh-bvh-json';

async function loadBvh(geometry) {
  const response = await fetch('/path/to/bvh.json');
  const obj = await response.json();
  const bvh = deserializeFromObject(obj, geometry);

  geometry.boundsTree = bvh;
}

const geometry = new THREE.TorusKnotGeometry(10, 3, 100, 16);
loadBvh(geometry);
```