gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > glDepthMask(), glDepthRange() and glDisable(GL_DEPTH_TEST)?

#140534 - hi2u - Mon Sep 17, 2007 7:22 am

Does either have any equivalence in libnds?
_________________
hi2u

#141009 - hi2u - Fri Sep 21, 2007 8:00 am

Nobody knows? :/

Well, perhaps someone can help me out anyway; I'm creating a skybox.

Thankful for help.

Edit: I forgot to search the forums before I asked. Seems like I'm out of luck.
_________________
hi2u

#141011 - simonjhall - Fri Sep 21, 2007 8:11 am

From personal experience, I've found the DS Z-buffer a bit funky to use, since I don't think there is one. However you do get Z sorting instead, which is pretty similar.

Stuff:
- your depth range is set up through glPerspective, ie setting of the near and far clip planes
- you can either use Z or W sorting to control the visiblity of your triangles, but there's no option to turn off Z/W sorting (99% sure)
- there's a glClearDepth function
- I don't think you can control depth writes with a mask

Anyone with more experience wanna chime in?
_________________
Big thanks to everyone who donated for Quake2

#141016 - kusma - Fri Sep 21, 2007 9:43 am

I don't have more experience, but it seems to me that flags to SWAP_BUFFERS control z-buffering and sorting (see http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol for more details.
). I don't quite understand why the sorting is documented to be on the y-axis though.

#141017 - simonjhall - Fri Sep 21, 2007 9:51 am

That Y sorting gives a complete mess for me, so I just avoid it!
I use W sorting, and that seems to work ok (even with orthographic projections).

It'd be nice to work professionally on the DS for a bit, get the hardware manuals, read them cover to cover and go "oh right! NOW it makes sense!"
...don't see that happening any time soon though :-)
_________________
Big thanks to everyone who donated for Quake2

#141038 - tepples - Fri Sep 21, 2007 12:44 pm

simonjhall wrote:
It'd be nice to work professionally on the DS for a bit, get the hardware manuals, read them cover to cover and go "oh right! NOW it makes sense!"
...don't see that happening any time soon though :-)

And watch the non-disclosure agreement kill your chances of homebrewing for any Nintendo platform in the future. That's the impression I got when I interviewed with the company that made BreakThru! for Game Boy. It's enough to drive people to GP2X or Windows Mobile. And the impression I got on the nesdev mailing list from a developer who worked on The Three Stooges was that Nintendo's NES manuals aren't nearly as detailed as the manuals that homebrewers have come up with, especially with regard to some of the 2D graphics corner cases that later games rely on.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.