Thanks for the info!
The rtps info about the Z value I found it in the "All the things you wanted to know about psx but were afraid to ask" pdf.
There is some info for all the gte commands, there it reads that if you want to retrieve smaller z values you will have to implement your own function.
This issue seems to happen in all the psyq examples but one- ZIMEN tuto4, unfortunately the code for tuto4 is not available
. But I assume subdivision works well with that particular geometry only.
Before, trying to do some subdivision with gte, I tried to see if using normal functions RotAverageNclip3 and DivideFT3 would get the results I wanted.
But then I came across with an example on the psyq sdk that reads the following:
"The Divide function judges normal clipping only once before division.
This means that large polygons that have approached a viewpoint are
all clipped prior to divison. This can produce situations where a
section which is expected to be drawn is not. To prevent this from
happening, use the RCpoly function instead of the Divide function as
shown below."
Then I used some assembler code for subdivision that I got from one of the examples, it seems to "work", the problem with subdivision is that, at least on my case, you don't have much room selecting where in the z distance you want to start and how many divisions because soon it either starts lagging or simply goes bananas.
So in my case, subdivision doesn't really helps much with clipping.
The model I'm using has some large polys in some areas and probably that's making the near clipping problems worse, but it bugs me a bit that none of the examples really tackles this issue in a general way, and I've seen many graphical problems in psx games, but none having near clipping problems.
This leads me to think that the solution might not be too difficult or that I'm simple doing something wrong with my code.
EDIT:
Browsing the ref docs for some info I found out:
There is a bit that can be set for TMD objects using GsDOBJ2 to ignore that.
"Bit 7: Near clipping
If this bit is set, in cases where the polygon end point is very close to the viewpoint (distance between
viewpoint and polygon < (distance between viewpoint and screen) /2), a polygon that has overflowed
during perspective transformation will not be simply clipped, but can be forcibly displayed, even if its
shape is distorted."
Also, most of the RotPMD, RotRMD,SMD, etc.. functions include an attribute nclipmode that also controls that:
"If nclipmode = 0, polygons are far and near clipped by sz=[0,2^16].
If nclipmode = 1, polygons are far and near clipped by sz=[h,2^16] (h=distance of eye to screen)."
But I cannot find any similar settings for custom models render with gte_ instructions