Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

mcanthony/regl-fire

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

regl-fire

Cheap-looking fire particle system implemented with regl.

Demo here

Animated

Implementation Details

The fire is rendered as a particle system of about 300 particles. It turns out that only 300 particles can result in a significant amount of overdraw, and this will cause poor performance on lower-end graphics cards.

But I solved this problem by rendering the particle system to an FBO that is about one-fifth the size of the screen, and then upscaling and rendering it to the actual screen. Since then less fragments are processed, the overhead from all the overdraw for the fragments is significantly reduced.

This technique is called off-screen particles, and you can read more about it in this article

Build

First install all dependencies by doing

npm install

To then run the demo, do

npm run start

About

Fire particle system made with regl

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.9%
  • HTML 2.1%