Trying to understand the VERA FX Polygon Tutorial

All aspects of programming on the Commander X16.
mgkaiser
Posts: 60
Joined: Sat Dec 02, 2023 6:49 pm

Re: Trying to understand the VERA FX Polygon Tutorial

Post by mgkaiser »

cosmicr wrote: Mon Jun 03, 2024 12:08 am Thanks - you don't need to illustrate. I get what the top point is lol. I want to understand the implementation. I understand everything about coordinates, triangles, pixels, VERA, rasterisation, slopes etc. I do not need an explanation of anything about triangles or the maths involved. Like I said I've already written several polygon rasterisers of my own. I know how the polygon helper works.

The part I was struggling with is the implementation - ie the code. I don't think it's entirely clear. Maybe it just needs better formatting.

It doesn't matter. I've spent some more time on it and I understand it all now and have it working. Thanks for your help!

edit: I forgot to include the screenshot! Here's an animated gif - this is running in C, but it should be a bit faster in assembly. The slope calculation and actual filling loop uses heaps of cycles. I'll probably use this in my Another World port.
quads.gif
You can leave the calculations in C and just make the double loop that "pumps" the data into the VERA data ports assembly and you will see it run nearly as fast as pure assembly.
mortarm
Posts: 299
Joined: Tue May 16, 2023 6:21 pm

Re: Trying to understand the VERA FX Polygon Tutorial

Post by mortarm »

Gotcha. Seeing it made it clear.
Post Reply