three-volumetric-pass-fork
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

three-volumetric-pass

npm version twitter

An implementation of raymarched screen space volumetrics in Three.JS, compatible with the pmndrs postprocessing library.

Useful for adding clouds, fog, and other volumetric effects to your Three.JS scenes.

Interactive Demo: https://three-volumetric-pass.ameo.design/

Installation + Usage

npm install three-volumetric-pass postprocessing

import { EffectComposer, RenderPass } from 'postprocessing';
import { VolumetricPass } from 'three-volumetric-pass';

const composer = new EffectComposer(renderer, { frameBufferType: THREE.HalfFloatType });

composer.addPass(new RenderPass(scene, camera));
const volumetricPass = new VolumetricPass(scene, camera, {
  halfRes: true,
  // other params go here
});

const animate = () => {
  composer.render();
  animate();
};

animate();

Credits

Several parts of the core shader implementation were inspired by this "Clouds" ShaderToy demo by Inigo Quilez: https://www.shadertoy.com/view/XslGRr

Some shader components involving the depth buffer were taken from three-good-godrays which contains code originally written by n8programs

Readme

Keywords

none

Package Sidebar

Install

npm i three-volumetric-pass-fork

Weekly Downloads

9

Version

0.1.0

License

none

Unpacked Size

52.4 kB

Total Files

5

Last publish

Collaborators

  • heyana