Hi there:
Just got a question about the alpha transparency in Gem.
Say I have 2 cubes (A & B) and both have them have alpha transparency on. and because the rendering order (say A renders first), they won't be mutually transparent. I mean cube B can see through cube A but cube A can't see through cube B. making sense?
Is there a way so that both of them are mutually transparent?
Many thanks
Yours
CHUN
chun lee wrote:
Hi there:
Just got a question about the alpha transparency in Gem.
Say I have 2 cubes (A & B) and both have them have alpha transparency on. and because the rendering order (say A renders first), they won't be mutually transparent. I mean cube B can see through cube A but cube A can't see through cube B. making sense?
Is there a way so that both of them are mutually transparent?
You need to adjust the rendering order so that objects are drawn from the front of the scene towards the back. Unless I am mistaken (50% a priori probability) in openGL there is no other way. Martin
On 7/7/04 9:27 pm, "Martin Peach" martinrp@vax2.concordia.ca wrote:
chun lee wrote:
Hi there:
Just got a question about the alpha transparency in Gem.
Say I have 2 cubes (A & B) and both have them have alpha transparency on. and because the rendering order (say A renders first), they won't be mutually transparent. I mean cube B can see through cube A but cube A can't see through cube B. making sense?
Is there a way so that both of them are mutually transparent?
You need to adjust the rendering order so that objects are drawn from the front of the scene towards the back. Unless I am mistaken (50% a priori probability) in openGL there is no other way. Martin
But don't you have to switch the rendering off and on again for the new rendering order to get effect? What was in my mind is that say both of the cubes are in a global rotation so that sometimes A is in front and other times B is in front.
So there is no way to do this in openGL?
Cheers
CHUN
On Jul 7, 2004, at 6:11 PM, chun lee wrote:
But don't you have to switch the rendering off and on again for the new rendering order to get effect? What was in my mind is that say both of the cubes are in a global rotation so that sometimes A is in front and other times B is in front.
So there is no way to do this in openGL?
The alpha blending is done using the fragment unit, which requires all of the geometry to be rendered to 2D. The blending functions take the pixels already in the pixel buffer and apply the transform, so obviously the pixels have to exist in the buffer before the transform happens.
This is an age old problem, and while solutions exist, there is no
ideal one. Probably the most accurate way to handle this involves the
construction of a b-tree for sorting the geometry before rendering.
This is pretty much impossible with the way GEM is structured currently
since each Geo object directly renders using immediate mode GL calls,
and thus has no knowledge of any other Geos in the scene. There might
be a way to do this with vertex-array rendering since that does not use
immediate mode, and the vertex data is exposed and manipulatable.
If you are directly feeding in matrix transform info using translate then it would be possible to change render order on the fly to do front to back rendering.
cgc
Cheers
CHUN
chris clepper wrote:
On Jul 7, 2004, at 6:11 PM, chun lee wrote:
But don't you have to switch the rendering off and on again for the new rendering order to get effect? What was in my mind is that say both of the cubes are in a global rotation so that sometimes A is in front and other times B is in front.
So there is no way to do this in openGL?
If you are directly feeding in matrix transform info using translate then it would be possible to change render order on the fly to do front to back rendering.
you don't have to turn off+on the rendering engine to make the rendering order take effect. it works on the fly.
so for simple objects this should work (see help-file 02/14). for complex (concave) objects, you are out of luck
mfg.as.dr IOhannes
On 8/7/04 9:42 am, "IOhannes m zmoelnig" zmoelnig@iem.at wrote:
chris clepper wrote:
On Jul 7, 2004, at 6:11 PM, chun lee wrote:
But don't you have to switch the rendering off and on again for the new rendering order to get effect? What was in my mind is that say both of the cubes are in a global rotation so that sometimes A is in front and other times B is in front.
So there is no way to do this in openGL?
If you are directly feeding in matrix transform info using translate then it would be possible to change render order on the fly to do front to back rendering.
you don't have to turn off+on the rendering engine to make the rendering order take effect. it works on the fly.
so for simple objects this should work (see help-file 02/14). for complex (concave) objects, you are out of luck
mfg.as.dr IOhannes
Thanks for your reply, I just tried changing the rendering order on the fly but it does not seems to take any effect. The only way I could change the rendering order is to type the number in gemhead's object box and than switch the rendering off+on. What am I doing wrong? I thought I could assign the rendering order by passing a number into gemhead's inlet, is this right?
I am doing this on OSX.
Thanks
CHUN
Ok, just found out how now. I need to do "set $1" then connect to gemhead's inlet. This is not explained in the gemhead's help file for OSX.... But is in the help for the linux Gem.
cheers:)
CHUN