1
Scripting and Reverse Engineering / How are polygons sorted before rendering ?
« on: 2013-08-24 12:21:10 »
Hi,
I'm working on a BattleScene exporter for FFIX (I'm aware that one of them already exists, but it was fun nevertheless). I've currently got the exact same output than Zidane's one, but I'm struggling on one issue.

You can see that some elements which should be transparent are actually too much transparent - they ignore the objects behind them and are filled with the screen background color (here, grey). Zidane's viewer does not have this issue because it does not follow the PSX object description : it basically says that each polygon should be drawn appart from the others, so they can be easily sorted. The problem is that it can't be a general solution, since it is very heavy : instead of 7 draw calls, you have 7000. In a webgl context, the FPS drops from 60 to 20, and I assume that on PSX, it would be worse.
So I'm wondering : how does the PSX (or maybe the game engine of FF7 / FF9) handle the polygon sorting ?
Thanks,
I'm working on a BattleScene exporter for FFIX (I'm aware that one of them already exists, but it was fun nevertheless). I've currently got the exact same output than Zidane's one, but I'm struggling on one issue.

You can see that some elements which should be transparent are actually too much transparent - they ignore the objects behind them and are filled with the screen background color (here, grey). Zidane's viewer does not have this issue because it does not follow the PSX object description : it basically says that each polygon should be drawn appart from the others, so they can be easily sorted. The problem is that it can't be a general solution, since it is very heavy : instead of 7 draw calls, you have 7000. In a webgl context, the FPS drops from 60 to 20, and I assume that on PSX, it would be worse.
So I'm wondering : how does the PSX (or maybe the game engine of FF7 / FF9) handle the polygon sorting ?
Thanks,