Advertisement

hardware accelerated transparency

Started by January 23, 2001 01:33 AM
9 comments, last by hamzat 23 years, 9 months ago
Hi all, Does anybody know how to take advanage of hardware acceleration in transparency. Algorithm of sorting triangles each time when I rotate a figure that consists of lots of triangles allows me to use nither display lists nor other techniques to take advantage of my hardware. People, is there any solution? Thank you in advance.
What do you mean? If you are using alpha blending, and you are not sorting that, then yes, it can be slow(er), but everything still should be accelerated via hardware, unless the hardware doesn''t support that feature. What vid card you got?

If you want to know how, usually they sort the polygons via the Z value, and start from back to front.

Advertisement
I have ATI Radeon DDR 32MB. I mean that when I rotate some big figure of about 70000 triangles with triangle strips in display lists I have about 11 fps but when I use transparency I can''t use display lists and I cant use triangle strips because I have to sort triangles each time I rotate a figure. So I have about 20 time drop in speed. Some people suggested me to use multiple z-buffers, but i didn''t find such a thing in OpenGL. What do you think?
If you don''t render back faces, you probably only need to sort the objects by depth.

Elixer:

I am pretty sure the hardware doesn''t sort the triangles by depth.

You have to do it though because if you draw the closest ones first, others don''t get drawn because they are behind it, and if you turn off depth testing, you can see the transparent triangles through solid triangles.

Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
I didn''t mean to imply that smart_idiot. I meant that you (hazmat) should do depth sorting first (and cull) to get rid of all the extra stuff that the user won''t see but the hardware will draw it. (Oh wait, Radeon uses HyperZ, I don''t know how to enable that though.)

But since you are sorting 70k polygons, you now need to NOT draw all those, and only draw the visable ones. I think glvelocty had some good stuff under ''code archive'' that would help you out.

No, I have to draw all of them because I''m implementing transparency and draw them from back to front.
BTW does anybody know the most efficient algorithm for the depth sorting. If yes gimme the URL please.
Advertisement
hamzat...surely a bsp tree will fulfill your requirements ( look at tutorials on http://www.mr-gamemaker.com )
Hi there,

couldnt you use 2 display lists one for opaque and
one for transparent triangles.

Render the opaque ones first with the z buffer enabled
then switch the z buffer to read only and enable blending
then render the transparent triangles.
mbutchers idea will work if your clear polygons all have the same alpha values or very similar ones. If this is the case then enable zbuffer reading and writing and draw all the opaque polygons. Then disable zbuffer writing but keep reading enabled. Then draw the alpha blended polygons in any order.

If the alpha blended polygons have different alpha values then you will have to sort them. When you sort them now are you sorting each vertex? If you take the average z value of each polygon then it might be faster.

I''m not sure but a BSP tree might also work.

(also if two alpha blended polygons that have different alpha values intersect then it''s impossible to render them correctly without splitting them)
Actually I need that all traigles be semi-transparent.

This topic is closed to new replies.

Advertisement