GithubHelp home page GithubHelp logo

ameobea / three-volumetric-pass Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 30 KB

Raymarched screen space volumetrics in Three.JS, compatible with the pmndrs `postprocessing` library

Home Page: https://three-volumetric-pass.ameo.design/

Just 0.49% HTML 1.89% TypeScript 59.17% GLSL 35.23% JavaScript 3.22%
postprocessing raymarching threejs volumetric-rendering

three-volumetric-pass's Introduction

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

three-volumetric-pass's People

Contributors

ameobea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.