Electric Field Simulation in GPU

September 8, 2014 ยท View on GitHub

This is an example of how to use OpenGL for physical simulations. All the simulation runs in parallel in the GPU using my own engine as the rendering layer. The potential and electric field is calculated for each pixel in screen, then several rules are applied to choose the output color.

Electric Field

Download compiled app

http://forzefield.com/ElectricFieldSimulation.zip

Where is the magic?

Right here: simulation.frag

Contents

  1. 1Download compiled app
  2. 2Where is the magic?