View Single Post
Old 07 October 2021, 18:25   #1
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Blitter filling multiple polygons at once?

I'm looking for a challenge, and having outgrown my current polygon filling code I thought I'd try and rewrite it to fill an entire scene's polygons in a single blit.

The approach I'm considering is to rasterise the possible concave polygons so that there is an array of lists, one list per scanline, with the list containing the entry and exit points for how the scanline intersects the polygon.

That I believe is pretty standard.

Then, for each additional polygon that needs to be rendered, I want to do the same thing, but then "merge" the results, properly handling overlaps, so that later polygons will be rendered over the top of earlier ones.

I believe that's been done before, probably many times, but I haven't yet found any existing code for it. Maybe I'm not using the right search terms.

Then, want to set the bits right in some pre-cleared bitmaps so that I can do a single blitter fill operation to draw them all at once. Since the lists contain all the information needed to draw the screen, it should be possible to work out which bitplane bits so set at which points to make the blitter "change colour" as it fills the screen.

I think the disadvantages of this approach will probably outweigh the advantages, but I still think it will be a fun challenge. Does anything spring to mind that might make it unachievable?
deimos is offline  
 
Page generated in 0.04295 seconds with 11 queries