| View previous topic :: View next topic |
| Author |
Message |
gr8dane
Joined: 18 Aug 2005 Posts: 16
|
Posted: Thu Aug 18, 2005 11:16 am Post subject: GU_TRANSFORM_2D z buffer ordering problem |
|
|
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 |
|
 |
ector
Joined: 12 May 2005 Posts: 195
|
|
| Back to top |
|
 |
gr8dane
Joined: 18 Aug 2005 Posts: 16
|
Posted: Thu Aug 18, 2005 11:33 am Post subject: |
|
|
| 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 |
|
 |
gr8dane
Joined: 18 Aug 2005 Posts: 16
|
Posted: Thu Aug 18, 2005 2:01 pm Post subject: |
|
|
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 |
|
 |
|