Archived

This topic is now archived and is closed to further replies.

Depth Testing

This topic is 5610 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, For my program, i need to render, mmmm, let''s say 5 things (number does not matter, just for example / each thing is a series of opengl commands, ex. 1 = a cube, 2 = sphere ... whatever :D ) I would need to have that i can say which things to render first... For example i would need to draw the first thing and on top of it the second thing... (And i cannot just turn off depth testing as the stuff inside one ''thing'' must be correct considering depth testing...) So should i make may own depth testing (BSP trees or something like that) or is there another way of doing this (so, inside the units it must be depth tested, but the units against each other must not be depth tested because the user decides that...) And if you must your own depth testing for this, do you guys have some links for that... (i got enough info on the theoretical side of BSP trees for example, but a practical example or tutorial would be nice... )

Share this post


Link to post
Share on other sites
i'm not exactly sure about this, since it's just a theory, and i've never tried it... but here goes.

if you know the order in which you want to render the objects (that's easy, have an array w/ 5 elements, where the 1st cell's object renders 1st, and last cell's object renders last), then do this. render the 1st object w/ depth testing on. then, call glFlush(). after that, clear the depth buffer (glClear(GL_DEPTH_BUFFER)), and go on w/ the next object.

i think that might work, but don't flame if it doesn't.

edit: please don't use the term BSP trees if you don't know what it means.

---
shurcool
wwdev


[edited by - shurcool on July 25, 2002 5:19:21 PM]

Share this post


Link to post
Share on other sites