r/howdidtheycodeit • u/paulojrmam • Aug 05 '26
How are vertical raster effects done?
I was trying to understand raster effects that stretch and compact images in old 2D games by searching the internet, watching youtube videos and ultimately even talking to Google Gemini, but it all just confused me. Whitepointer Gaming, Gamehut and Retro Game Mechanics youtube channels weren't enough.
Anyways, to the question:
tl;dr Are effects like Road Rash's hills and valleys, Axelay and Sonic 3D Blast's 3D effects done by skipping certain lines of the tilemap in certain sections, like instead of drawing lines 1,2,3,4,5,6,7 it draws lines 1,3,5,7? Or it uses vertical scroll faster in certain sections to overlay lines compacting them and scrolls slower to extend them?
And how can lines be added (like in Lawnmower Man), where do those lines come from? Gemini tells me they are repeated stripes.
1
u/blazesbe Aug 06 '26
all i can see common in the examples noted is parallax mapping and notably the first example uses it horizontally. you have layers of textures and slide them at different speeds. what you say for sonic tiles is a quirk of CRT displays - because it blends pixelcolors due to how the monitor works transparency could be faked by drawing every other line only.
if this isn't the topic please clarify
3
u/khedoros Aug 06 '26
A typical way would be to have a horizontal interrupt, which triggers when a line has been finished on the TV, at which point the code in the interrupt handler loads the next scroll position (like, from a table that was calculated at the end of the previous frame) and sets the scroll register to the right value for that line.
The value to write to the scroll register would be calculated how you were guessing; increment the scroll value to skip lines and squish the image together, decrement the scroll value to repeat lines and stretch the image.
There's a page talking about it and including some nice examples here: https://rasterscroll.com/mdgraphics/graphical-effects/vertical-scaling/