(11-26-2011, 08:52 PM)MyDreamName Wrote: Gabest, are you aware that there are issues with games using the Tony Hawk's Pro Skater engine? It seems that all, if not most, games using that engine suffer from somewhat minor polygon/texture flickering on software rendering when the camera changes position. (as of GSDX 4922)
I was checking THPS4 and the playground was flickering as you said. What I found was a little crazy. Sometimes when there are two adjacent edges, the stepping size for z calculated as 259.49... and 259.50..., slightly different, but right around .5. The absolute value of z is around 8 million, too big for a float, so the decimals are lost while stepping the rows. One edge ends like ..2, ..2, ..2, ..2, the other ..2, ..1, ..0, ..9., they are slowly drifting appart. This makes one of the triangles put values way too far from the correct ones into the zbuffer, and following z-tests fail in that area. One solution would be to not step, but to use a slower absolute addressing (for each row, row value = base value + (y - top) * step size). Not sure how much slower, gonna be testing it.