[SOLVED] Issue with glDepthMask

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
kazade
Insane DCEmu
Insane DCEmu
Posts: 145
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Tue May 02, 2017 3:11 pm
Has thanked: 3 times
Been thanked: 34 times

[SOLVED] Issue with glDepthMask

Post by kazade »

My game engine has a GL1 renderer which runs on both the PC, and Dreamcast which lets me compare behaviour between the two. I currently am trying to render a scene that does the following:

- glDepthMask(GL_FALSE);
- Render a textured background quad at z == 0
- glDepthMask(GL_TRUE);
- Render a textured cube at z == -5

On the PC this works as expected; I see a textured cube in front of the background.

On the Dreamcast (both emulator and on hardware) I just see the background.

Are there any known issues with glDepthMask? Anyone have any idea what the problem could be?
Last edited by kazade on Fri Sep 15, 2017 2:03 pm, edited 1 time in total.
kazade
Insane DCEmu
Insane DCEmu
Posts: 145
Joined: Tue May 02, 2017 3:11 pm
Has thanked: 3 times
Been thanked: 34 times

Re: Issue with glDepthMask

Post by kazade »

Bump...

I'm at a loss; I can't see anything obviously wrong with the libGL code.. yet that's where the problem must lie :(
kazade
Insane DCEmu
Insane DCEmu
Posts: 145
Joined: Tue May 02, 2017 3:11 pm
Has thanked: 3 times
Been thanked: 34 times

Re: Issue with glDepthMask

Post by kazade »

Has anyone ever seen glDepthMask working? I've followed the code all the way down into KOS and everything looks fine, yet it definitely seems like depth writes are happening even when I've disabled them :(
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Issue with glDepthMask

Post by BlueCrab »

I'm not sure, as I've honestly never really worked with the current libgl at all. :|

That was pretty much all PH3NOM's thing, and unfortunately, he's not around maintaining it anymore. :(
kazade
Insane DCEmu
Insane DCEmu
Posts: 145
Joined: Tue May 02, 2017 3:11 pm
Has thanked: 3 times
Been thanked: 34 times

Re: Issue with glDepthMask

Post by kazade »

BlueCrab, have you ever disabled depth writes with PVR commands directly? Looking at the code it seems that the depth.write flag is correctly set when compiling the polygon header - it just doesn't seem to work.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Issue with glDepthMask

Post by BlueCrab »

Honestly, no, I haven't. I've never done any sort of 3D work at all on the Dreamcast, unfortunately. :|

Just a thought, but are either of the objects translucent or punch-throughs? If so, then they're possibly tripping up the automatic depth-sorting for translucent polygons that the hardware does unless you specifically disable it.
kazade
Insane DCEmu
Insane DCEmu
Posts: 145
Joined: Tue May 02, 2017 3:11 pm
Has thanked: 3 times
Been thanked: 34 times

Re: Issue with glDepthMask

Post by kazade »

Yep it was down to the auto-sorting. I've disabled that now in my libGL fork so that the behaviour is more like traditional OpenGL.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: [SOLVED] Issue with glDepthMask

Post by BlueCrab »

I'm glad to hear that solved the problem. :)
Post Reply