In two weeks, I developed a particle system in OpenGL from the ground up. This system utilizes the OpenGL Point object to quickly render more than one hundred thousand particles at over 30 FPS, allowing different particle physics, color gradations, and shaders.
Designed the software and OpenGL parameters to best handle transparent, translucent, and opaque particles simultaneously.
Rendered points as spheres with Phong lighting using the GPU and creative fragment shading.
Aside from getting OpenGL to run properly, the most difficult problem I encountered was implementing different levels of transparency. In some of my images/video, you can see that there are fuzzy particles, translucent particles, and even bubble particles. I corrected the rendering order so that opaque objects would render first, then after researching thoroughly, I decided that not writing the translucent particles to the Depth Buffer would be the best course of action, since sorting 100,000+ particles would take a little more planning.
The only other considerable difficulty I faced was properly lighting the particle-spheres according to the Phong model. Utilizing OpenGL’s point sprite implementation, I could get ambient, diffuse, and specular light onto the spheres, but if I wanted them to rotate I had to do all of the rotation myself, since the particles don’t actually “face” a direction. After failing to use the particles’ relative positions to the camera, I fell back on passing in the camera rotation information and using that instead. It didn’t look good when every sphere’s diffuse was the same on the screen, but then I found that the specular lighting (which could be different per particle) masked the effect! You’ll have to look closely to tell that I cut any corners!