OpenGL Renderer: Before rendering, determine the list of clipped poly…
…gons, and then only render the clipped polygons, just like how SoftRasterizer does it. Most 3D games will see a significant performance improvement. For certain games with very high polygon count scenes, those games will see a massive performance boost.
Just had a quick try out, this causes a ~20% perf increase in one scene that looked rather simple but performed terrible along with a few other scenes seeing smaller increases. Thanks again for your work on optimization.
EDIT: When enabling all OpenGL compatibility options, I've seen up to 38% increases!!
Is it directly because of culling that Depth testing becomes significantly cheaper?
@Jules-A: When clipping polygons, EVERYTHING becomes cheaper, including depth testing. This commit only helps the OpenGL renderer, since it never clipped any polygons before rendering, whereas SoftRasterizer already did clip its polygons before rendering.
On the NDS, there are many games that process lots of polygons, but only render less than half of them in any given scene. This is why a lot of 3D games will see significant performance boosts.
And then you have games like Sands of Destruction, which take this to the extreme. Sands of Destruction processes several thousands of polygons, but only renders about 15% of them after clipping. When the user runs the OpenGL renderer, this commit literally makes Sands of Destruction go from "totally unplayable" to "fully playable". The performance benefit for that game is, well, game-changing. Users are no longer stuck to resorting to SoftRasterizer in order to run this game in HD.
Please try commit e06d11f, which is available on our Downloads page. It finalizes the work on this polygon clipping stuff, and should yield a universal performance improvement for all 3D renderers.
When clipping polygons, EVERYTHING becomes cheaper, including depth testing.
Yes but it seems to affect the Polygon Facing depth testing the most, for my system and the game's I've tested the impact has dropped from up to 35% to just 3-5%. If that is replicated across other systems and games, it might even be worth enabling by default?
Please try commit e06d11f. It finalizes the work on this polygon clipping stuff, and should yield a universal performance improvement for all 3D renderers.
With that commit I'm seeing up to 6% gain over this commit, nice work!
This comment has been minimized.
Jules-A repliedJan 22, 2019
•
edited
Just had a quick try out, this causes a ~20% perf increase in one scene that looked rather simple but performed terrible along with a few other scenes seeing smaller increases. Thanks again for your work on optimization.
EDIT: When enabling all OpenGL compatibility options, I've seen up to 38% increases!!
Is it directly because of culling that Depth testing becomes significantly cheaper?
This comment has been minimized.
rogerman repliedJan 24, 2019
@Jules-A: When clipping polygons, EVERYTHING becomes cheaper, including depth testing. This commit only helps the OpenGL renderer, since it never clipped any polygons before rendering, whereas SoftRasterizer already did clip its polygons before rendering.
On the NDS, there are many games that process lots of polygons, but only render less than half of them in any given scene. This is why a lot of 3D games will see significant performance boosts.
And then you have games like Sands of Destruction, which take this to the extreme. Sands of Destruction processes several thousands of polygons, but only renders about 15% of them after clipping. When the user runs the OpenGL renderer, this commit literally makes Sands of Destruction go from "totally unplayable" to "fully playable". The performance benefit for that game is, well, game-changing. Users are no longer stuck to resorting to SoftRasterizer in order to run this game in HD.
Please try commit e06d11f, which is available on our Downloads page. It finalizes the work on this polygon clipping stuff, and should yield a universal performance improvement for all 3D renderers.
This comment has been minimized.
tabnk repliedJan 24, 2019
The Legend of Zelda: Spirit Tracks performance improve significantly. Nice.
This comment has been minimized.
Jules-A repliedJan 24, 2019
•
edited
@rogerman
Yes but it seems to affect the Polygon Facing depth testing the most, for my system and the game's I've tested the impact has dropped from up to 35% to just 3-5%. If that is replicated across other systems and games, it might even be worth enabling by default?
With that commit I'm seeing up to 6% gain over this commit, nice work!