PDA

View Full Version : glBlendFunc Beginner Question



robob
12-22-2010, 04:39 PM
Hi!

I'm trying to do a simple thing, but can't get it working with glBlendFunc.
I have many "Particles", which are basically white blurred circles (transparency in the center is 0% and increasing to the borders of the circle).

Now I wanna do that:
Everytime if two or more circles a drawn on the same pixel(s) then this pixels should get a (random) color and the alpha should be multiplied. I can blend everything right, without color if I'm using

glBlendFunc(GL_SRC_ALPHA,GL_ONE)
How can I add the color thing to this now?

I tried also glBlendFuncSeparate without luck. :(

thanks for your help.

Alfonse Reinheart
12-22-2010, 04:54 PM
Everytime if two or more circles a drawn on the same pixel(s) then this pixels should get a (random) color and the alpha should be multiplied.

What do you mean by a "random" color? Do you truly want to execute a pseudo-random number generator, or do you simply mean an "arbitrary" color? In short, how do you expect to get this color?

robob
12-23-2010, 01:53 AM
first it would be enough if it is only one color.
later I will generate a pseudo-random number and put that into opengl.
but for my problem, it is not so important which color it is.

thanks