PDA

View Full Version : Blending problem



Imotiep
04-18-2001, 12:49 AM
Here is the deal :
I've created a molecule object composed of
a transparent sphere (blend = src_alpha, one_minus_src_alpha) and a 3d char inside the sphere.
I create a lot of these and the pb is that i can't see through all of them (because of the order) : i can see any sphere through the last one but none through the first one.
And I want to see them all through anyone...
If i play with the depth mask, my blending effect vanished so ... I NEED YOUR HELP

Thanks
ps : i can send you a sample code to illustrate the pb

lpVoid
04-18-2001, 05:21 AM
sounds to me like the order in which you render the objects is the problem. If you don't render from back to front for every frame, your blends won't look correct.

if there's nothing behind the semi-transparent object at the time it was rendered, then you'll never see the alpha effect. So if you render the objects from front to back, you're only going to see the one closest to the viewport.

Dave

Imotiep
04-19-2001, 12:51 AM
Thanks, but i already sort them but there is no concept of back or front in my problem cause 1) they have all the same z coord
2) i draw them from first to last and as i can do rotation of all of these molecules the first can be the closest to the viewport.
In fact it would be easy if all these molecules couldn't rotate...

PS : sorry for my english ... i'm french...

NeoTuri
04-19-2001, 07:22 AM
If I understand your problem correctly, all you really need to do is save your sphere for last during rendering and just render them in farthest to nearest order with blending enabled.

[This message has been edited by NeoTuri (edited 04-19-2001).]