Transparent Box?

Started by
2 comments, last by dragon376 22 years, 1 month ago
When doing blending, we need to order the object to be draw back to front. Though, when drawing a box that is a vertex array, I can not change the order in which the faces are drawn. How can I still have my box look OK from everyside?
Advertisement
if you dont want to presort the object data (still presort at object level) do:
glDepthMask(FALSE);
draw object
glDepthMask(TRUE);

//following part not needed if you presort at object level, and dont need to write z-values of the object
glColorMask(FALSE, FALSE, FALSE, FALSE);
draw object
glColorMask(TRUE, TRUE, TRUE, TRUE);
T2k:

This will work for additive blending, but for example GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA _needs_ sorted tris/polys for correct rendering.
True, but in most cases it will still look OK even if you don''t z sort your polygons. It depends what sort of thing you are doing. My sorting routines are well slow so I usually just put up with the risk of things occasionally looking a bit wrong.

-

Geocyte Has Committed Suicide.
Geocyte Has Committed Suicide.

This topic is closed to new replies.

Advertisement