Results 1 to 4 of 4

Thread: Particle system blending

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2003
    Location
    Gainesville, FL
    Posts
    11

    Particle system blending

    I'm fairly new to OpenGL, and I'm in the process of making a simple particle system. Everything was going well until I changed my background color. On a black background, the particles blend together fine and display correctly. On any other color background, the background color starts to blend with the particles and once I switch to a white background it blends my particle system out of sight. I've tried several different blending modes to no avail -- either the background interferes with the particle or the particles don't blend and appear very blocky. I thought that GL_DST_ALPHA might be able to fix the problem -- just set the background alpha to 0 and it won't blend, but unfortunately Windows' ****ty implementation doesn't support it so I can't test it out.

    Is there any way to exclude the background color when blending? With my luck, its going to involve something like low level manipulation of the color buffer :P

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Jan 2003
    Location
    Virginia
    Posts
    586

    Re: Particle system blending

    If you have a semi-decent GPU it should support greater than OpenGL v1.1 (MS implementation). You may just need to download and #include "glext.h". A link can be found here .

    But, a good blend func to use is glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and may do the trick.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2003
    Location
    Gainesville, FL
    Posts
    11

    Re: Particle system blending

    I tried alpha, 1 - alpha blending, but since it blends the polygons with the same mode it darkens the particle system drastically. The file you linked me to works though for the most part. I can get the particle system to show up properly against anything except a white background (even a white polygon). Kind of strange, but I'm just happy that it works now. Thanks bro.

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Jan 2003
    Location
    Virginia
    Posts
    586

    Re: Particle system blending

    Also, try these 1 at a time of course.

    glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ONE);
    glBlendFunc(GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR

    One of them may do the trick.

Similar Threads

  1. Particle system help
    By EchoDolphin in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 01-11-2018, 10:23 AM
  2. Particle System
    By Unresolved External in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-30-2011, 08:56 AM
  3. Particle System
    By micetta2482 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-14-2010, 11:05 AM
  4. Particle System API
    By cochondinde in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-20-2005, 03:37 AM
  5. Particle System
    By Coluna in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-13-2003, 09:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean