Pakk
06-18-2004, 09:03 AM
Hi, let me describe the geometric situation first and the problem later:
I have to draw a sphere with a maximum radius circunference over it. Like an "equator line", the center of the circunference is coincident with the center of the sphere. The sphere is translucid and the circunference is opaque.
The problem: In order to draw this scene with a high quality, using blending to produce the antialising, I need to draw things in the following sequence:
1) A semi-arc of circunference that will be almost "hidden" by the translucid sphere.
2) The entire translucid sphere.
3) The other semi-arc of circunference that can be directly viewed.
The reson for doing so is the apha blending for antialising.
My question is: How can I draw this?
If we first draw the sphere (with glDepthMask( GL_FALSE ) ) and then draw the circunference, the later will appear just as if it is in the front of the sphere.
If we first draw the circunference and the sphere later, the part of the circunference that can be viewed directly, won't be properlly antialised (because it will be blended with the background, and not with the sphere).
Just know that the sphere is made of polygon faces, while the circunference is made of lines (so culling works just for polygon).
Thank you very much,
Fabio
I have to draw a sphere with a maximum radius circunference over it. Like an "equator line", the center of the circunference is coincident with the center of the sphere. The sphere is translucid and the circunference is opaque.
The problem: In order to draw this scene with a high quality, using blending to produce the antialising, I need to draw things in the following sequence:
1) A semi-arc of circunference that will be almost "hidden" by the translucid sphere.
2) The entire translucid sphere.
3) The other semi-arc of circunference that can be directly viewed.
The reson for doing so is the apha blending for antialising.
My question is: How can I draw this?
If we first draw the sphere (with glDepthMask( GL_FALSE ) ) and then draw the circunference, the later will appear just as if it is in the front of the sphere.
If we first draw the circunference and the sphere later, the part of the circunference that can be viewed directly, won't be properlly antialised (because it will be blended with the background, and not with the sphere).
Just know that the sphere is made of polygon faces, while the circunference is made of lines (so culling works just for polygon).
Thank you very much,
Fabio