Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Best approach to building particle system

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2018
    Posts
    8

    Best approach on building particle system

    Hello, I am pretty new to opengl and I want to do a particle system. I have been using GLUT for everything in opengl that I did up to now. Eventually I want this particle system to be relatively big project, and working with at least hundreds of thousands of particles so I don't know if GLUT is a good choice. Initially I was planning to do this on GPU side using GLSL but it appears a little more complex that I thought. Will the GPU increase the speed significantly or not that much? And generally what approach and what libraries do you recommend for building a good particle system?
    Last edited by princip; 02-26-2018 at 01:35 AM.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,828
    Quote Originally Posted by princip View Post
    Hello, I am pretty new to opengl and I want to do a particle system. I have been using GLUT for everything in opengl that I did up to now. Eventually I want this particle system to be relatively big project, and working with at least hundreds of thousands of particles so I don't know if GLUT is a good choice.
    The choice of windowing toolkit (GLUT vs GLFW vs whatever) doesn't matter. Typically you'd use the simplest one which is flexible enough for your purposes.

    Quote Originally Posted by princip View Post
    Initially I was planning to do this on GPU side using GLSL but it appears a little more complex that I thought. Will the GPU increase the speed significantly or not that much?
    Considering the particle system in isolation, the GPU will almost certainly be faster than the GPU. OTOH, as part of a system where the GPU is saturated while the CPU is idle, using the CPU will be more efficient (and vice versa). Getting the most from the GPU boils down to maximising parallelism. If the particles don't interact, then you can just update all of the particles in parallel. If there's some form of interaction (e.g. collision), you'd typically update all of the particles in parallel, identify interactions which invalidate the calculations, recalculate (in parallel) the cases where the initial calculations were invalid, identify interactions in the updated particles, repeat until done. Typically the set of particles requiring recalculation will shrink at each stage. I can't think of anything which would absolutely require particles to be processed sequentially.

    Quote Originally Posted by princip View Post
    And generally what approach and what libraries do you recommend for building a good particle system?
    I don't know of any relevant libraries.

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2018
    Posts
    8
    Got it. Thanks for the answer.

  4. #4
    Intern Contributor
    Join Date
    Dec 2016
    Location
    Ocean Shores, WA USA
    Posts
    97
    In my youtube video channel on opengl tutorials, I have been slowly building and playing with a particle system that is just POINTS (Point Sprites), however, I use the Fragment shader to map either my own creation (procedural texturing) or actual textures.

    Here's one of the first videos where I explore a simple particle system using gl_pointcoord in the fragment shader:

    https://www.youtube.com/watch?v=pONkSilFDPo

    There are a bunch of others, in fact, particle systems are of particular interest to me, so if you have a request for something you want to see me make a video of, please let me know! Hint: I will see your comments on my videos on youtube, so that's the quickest way to get my attention.

    Hope this helps,
    Jeff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •