Members - Reputation: 167
Posted 21 October 2012 - 07:48 PM
I am trying to recover a particle system that I programmed some time ago.
The main difference between "some time ago" and "now" in my engine is that now I render all transparent objects in a different buffer. This buffer is a multi render target (2 buffers) of 64 bits per pixel each buffer. I do this because I use one buffer for color and the another one for displacement.
I have an issue with the blending, I use the standar blending new*alfa+old*(1-alfa) (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and with 30,000 particles I have this:
The expected result should be be different, something like this:
This pictures has only 1,000 particles because I use new+old blending (GL_ONE,GL_ONE) for this screenshot. It's only to exemplify the expected result, but of course is wrong, with more particles everything will become white.
Any idea of why I am getting this behavior with GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA? I am not sure if the problem is the multi render target or the 64 bits buffers.
Crossbones+ - Reputation: 13469
Posted 22 October 2012 - 12:19 AM
I guess you have enabled the z-buffer ? Nevertheless, if you want to render alpha blended surfaces correctly, you need to sort them.