JSPM

@mesmotronic/three-crtpass

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q29416F
  • License BSD-2-Clause

CrtPass makes it look like you're watching your Three.js project on an old TV, emulating the visual style of classic CRT display

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@mesmotronic/three-crtpass) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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!

    Installation

    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:

    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