So how does the PPU actually convert sprites and background into pixels? Does it directly loop through each individual pixel on each line, then loop through tiles/sprites to calculate the final pixel that should end up in that spot? Or does it loop through each tile or sprite, draw a row of pixels all at once (assuming there isn't a pixel there already)? Both of those sound like they'd be a very intensive process, especially for such old hardware; there's just so many pixels (and layers!). Not to even mention the
Also, clipping: transparent pixels. Is it as simple as
Finally, compositing (semi-related to above) is something I'm wondering about as well. According to the video I linked above, the various types of graphics are rendered separately. Are objects and background layers all rendered and stored into their own personal "buffers" before compositing? If so, do the "high-priority" bg tiles and sprites have their own separate buffers from low-priority, or are they separated from lower-priority tiles in a different way?
It is also not clear to me whether the compositing process is done per-pixel one after the other, or if each scanline is rendered in it's entirety before being composited together.
Can someone help me understand, at least on a slightly lower level than the video I linked, how does the "internal logic" of clipping, drawing and compositing everything work, and how is it so efficient?
Code:
byte or word of VRAM data -> bits -> pixel value + palette -> final color
conversion, which sounds time-consuming as well considering the sheer amount of pixels on screen. So how is everything blitted onto the screen so efficiently?Also, clipping: transparent pixels. Is it as simple as
Code:
if (pixel_value != 0) draw_pixel() else continue
? Retro Game Mechanics Explained mentions clipping behavior here (without going into any real detail), it seems to decide which sprite pixels to render and which to "clip away" in a convoluted way.Finally, compositing (semi-related to above) is something I'm wondering about as well. According to the video I linked above, the various types of graphics are rendered separately. Are objects and background layers all rendered and stored into their own personal "buffers" before compositing? If so, do the "high-priority" bg tiles and sprites have their own separate buffers from low-priority, or are they separated from lower-priority tiles in a different way?
It is also not clear to me whether the compositing process is done per-pixel one after the other, or if each scanline is rendered in it's entirety before being composited together.
Can someone help me understand, at least on a slightly lower level than the video I linked, how does the "internal logic" of clipping, drawing and compositing everything work, and how is it so efficient?