GsSortObject4Inserts an object in an OT | |||||||||
Arguments
Return ValueNone.ExplanationPerforms perspective transformation and light source calculation for the 3D object pointed to by objp.Generates drawing commands for the object and stores those commands at the packet area work base address, previously specified with GsSetWorkBase(). Z-sorts the drawing commands and enters them in the ordering table pointed to by otp, shifting the Z values by an amount specified by shift. The precision of Z may be adjusted using shift. The maximum size of the ordering table (i.e. its resolution) is 14 bits and is specified in the GsOT structure. The value of shift must be set so that the area allocated to the ordering table will not be exceeded when the object is entered. For example, if the size of the ordering table is 12 bits, the shift value must be set to 14-12, or 2. scratch is a pointer to the Scratchpad buffer which is used when automatic polygon subdivision is being performed on the object. The size of the Scratchpad buffer is 1024 bytes. The Scratchpad allows access to the Data Cache on the R3000. Using the Cache provides much faster access than main memory RAM for time-critical operations such as polygon subdivision. The Scratchpad is memory-mapped from addresses 0x1F800000 to 0x1F8003FF. Automatic polygon subdivision is enabled by setting the appropriate bits in the attribute member of GsDOBJ2. Subdivision is enabled by ORing the attribute member with one of the macros GSDIV1 through GsDIV5 which are defined in libps.h. For example, if GsDIV1 is specified, a single polygon will be divided into 4 segments of 2 x 2. If GsDIV5 is specified, a single polygon will be divided into 1024 segments of 32 x 32. See AlsoGsDOBJ2, GsOT, GsSetWorkBase() |