forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GU_TRANSFORM_2D z buffer ordering problem

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
gr8dane



Joined: 18 Aug 2005
Posts: 16

PostPosted: Thu Aug 18, 2005 11:16 am    Post subject: GU_TRANSFORM_2D z buffer ordering problem Reply with quote

I seem to be having a problem when using GU_TRANSFORM_2D to do my 2D polygons.

The polygons draw just fine but they always appear behind any 3D objects that I draw. I have tried feeding the 2D polygons various Z values in the vertices. I would assume that giving it a Z value slightly higher than my near clipping plane would do the trick... but no...

Any help here would be appreciated.. Thanks in advance.
Back to top
View user's profile Send private message
ector



Joined: 12 May 2005
Posts: 195

PostPosted: Thu Aug 18, 2005 11:29 am    Post subject: Reply with quote

Turn off depth test and draw your 2D stuff last?
_________________
http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come.
Back to top
View user's profile Send private message
gr8dane



Joined: 18 Aug 2005
Posts: 16

PostPosted: Thu Aug 18, 2005 11:33 am    Post subject: Reply with quote

yeah, that would be an option but that should not be needed at all. I should be able to do this without mucking with the Z-buffer state.
Back to top
View user's profile Send private message
gr8dane



Joined: 18 Aug 2005
Posts: 16

PostPosted: Thu Aug 18, 2005 2:01 pm    Post subject: Reply with quote

I found the answer to my own question so I guess I'll post it here in case anybody else wanted to know.

It seems that when using GU_TRANSFORM_2D nothing is done to any of the vertice values, including the Z value. This makes you unable to just specify a Z value like you would for a 3D object.

Instead you have to pass in values compatible with whatever you have set your depth range to.

For example, if you have something like this in your code:

sceGuDepthRange(0xc350,0x2710);

You would need to set your 2D vertices Z values to a range between 0xc350 - 0x2710. So if you want your 2D polygons to appear in front of everything else make your Z values 0xc350.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group