Git Product home page Git Product logo

ink_dr_p's Introduction

ink_dr_p

A GPU particle implementation for love2d.

details

The meat of this project is in three parts.

  • A set of position / velocity fbos, and the shader code that updates them (in physics_frag.glsl)
  • A mesh which renders the contents of the position fbo to the screen, and the shader which builds out the contens of that mesh (in render_vert.glsl and render_frag.glsl)
  • A shader which generates a field of curl noise into an fbo, which then drives the velocity of the particles

The things that are strange about this implementation are mostly based on the fact that love2d doesn't have a geometry shader to generate vertexs to pass on to the next shader stage. Because of that, we generate all the verts that we will need for displaying every particle, and store them in a mesh. Each frame, the mesh vert shader checks the associate pixel from the position fbo (which also contains information about the age of the particle), and updates the vert positions.

Curl Noise implementation contains code from https://github.com/cabbibo/glsl-curl-noise/blob/master/curl.glsl and https://github.com/ashima/webgl-noise/tree/master/src

further work

Right now, the particle forces are pretty simple. You could also drive the particles from meshes or SDFs if you wanted to display objects with them. More potential work would be to add light and shadow to the particles, using techniques from https://directtovideo.wordpress.com/2009/10/06/a-thoroughly-modern-particle-system/

ink_dr_p's People

Contributors

jonbro avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

antoniomoder

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.