View Full Version : blending in three dimensions

lange

12-03-2002, 12:36 PM

Hi

All the 3 dim. examples that do blending use

the following for the glBlendFunc:

glBlendFunc(GL_SRC_ALPHA,GL_ONE);

Why do they use the GL_ONE instead of

ONE_MINUS_SRC_ALPHA?

Thanks,

Gail

Nick Nougat

12-03-2002, 03:11 PM

Hi!

We just had a discussion touching that topic here:

http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/010862.html

Nick

DFrey

12-03-2002, 07:13 PM

If you examine the blending arithmetic you get using those blending factors, you see that the blend is nothing more than a simple sum. And since addition is commutative, meaning things can be added in any order, no sorting is necessary. If you wish to use complete alpha blending, this blending is not commutative, again check the math to prove it to yourself, you must draw the blended polygons from farthest to nearest to ensure things are drawn correctly. Unless you have a Geforce 3 or better, which does allow you to perform order independent alpha blending. NVIDIA has a article about this in their developer section.

Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.