Hello guys, I have a little problem.
I'm using AddPrism to draw a simple vertex array and GsSortObject4 to draw vertices from TMD file.
Ok, nice.
Except the polygons drawn by AddPrism always get behind the polygons drawn by GsSortObject4, no matter if I move the z axis forward or backward.
My draw rotine is the following:
...
if ((OT_z > 0) && (OT_z < (1 << OT_LENGTH)))
AddPrim(&OT_TAGs[currBuffer][OT_z - 2], &f3[currBuffer]);
...
GsSortObject4(spr->obj, spr->ot, 14 - OT_LENGTH, getScratchAddr(0));
...
GsDrawOt(&OTs[currBuffer]);
Somebody can help me?
Thanks.
AddPrim, GsSortObject4 and Z problem
-
- Interested PSXDEV User
- Posts: 7
- Joined: Mar 14, 2020
- I am a: Software engineer & PSX enthusiast
- PlayStation Model: SCPH-101
- Location: Brazil
I believe I found the solution.
I figure out I need divide the OT_z result by (14-OT_LENGTH).
AddPrim(&OT_TAGs[currBuffer][(OT_z) >> (14 - OT_LENGTH)], &f3[currBuffer]);
I figure out I need divide the OT_z result by (14-OT_LENGTH).
AddPrim(&OT_TAGs[currBuffer][(OT_z) >> (14 - OT_LENGTH)], &f3[currBuffer]);
Who is online
Users browsing this forum: No registered users and 2 guests