Faster rectangle algorithm

3

SP4CEBAR 2022-12-31 09:10 (Edited)

Pushing NX to its limits!


        Open In Editor


Update:

Warning, flashing images

Optimizations:

Pretty Fast.nx | Open in app
2022-12-31 10:26
Pretty Fast.nx | Open in app
2022-12-31 10:00
Pretty Fast.nx | Open in app
2022-12-31 09:10

SP4CEBAR 2022-12-31 10:12 (Edited)

The bottleneck is the drawing of the left and right sides, these need to overlay the pixel bits for each row, ending the sub there (it's the first thing of the rectangle to be drawn) leaves it at 50% cpu
the preparations only take 1% of CPU


nitrofurano 2022-12-31 15:44

excellent! :)


SP4CEBAR 2024-11-15 22:54 (Edited)

This algorithm is way faster than my triangle algorithm, so drawing 3D worlds out of rectangles might be possible: a few rectangles can approximate a triangle.

The current algorithm can be made even faster by getting rid of all subprograms within it: If I remember correctly, a function call takes one tick plus a tick per passed parameter, so removing a subprogram within the pixel drawing loops will save many ticks.


Log in to reply.