Road rendering like in Top Gear 2

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.
Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
pettersson
Posts: 5
Joined: Mon Jan 20, 2020 8:04 am

Road rendering like in Top Gear 2

Post by pettersson »

Hi,

are there any demos/explanations on how to achieve a road rendering like in Top Gear 2? Or any other racing game of that time :)
I know it's done using HDMA effects for curves and the imitation of a moving road but I cannot get my head around it. And it's hard to google for "road rendering" - even samples or explanations for Amiga/C64 (anything pre-3d) would be helpful :)
Myself086
Posts: 184
Joined: Sat Nov 10, 2018 2:49 pm

Re: Road rendering like in Top Gear 2

Post by Myself086 »

It's the same as 3D texture rendering but it's rendered onto a 1D plane instead of 2D. 1D plane being the HDMA table.

The road is a line strip where each vertex is 3D calculated and affine rendered. Top Gear 2 uses a lot of vertices, one per color change on the side of the road (white-blue lines, idk what they're called). Level data controls 1 vertex every 4 rendered and are smoothed out from what seems to be bezier curve.

The game seems to handle 3D math very well. Even camera rotation looks accurate after testing with extreme hills (hack).

EDIT: Correction on vertex count.
secondsun
Posts: 43
Joined: Tue Jul 31, 2018 9:37 am

Re: Road rendering like in Top Gear 2

Post by secondsun »

The phrase you're looking for is "raster racer". Here's an article that talks about building one : https://jakesgordon.com/writing/javascript-racer/
User avatar
freem
Posts: 186
Joined: Mon Oct 01, 2012 3:47 pm
Location: freemland (NTSC-U)

Re: Road rendering like in Top Gear 2

Post by freem »

Another reference for this kind of thing can be found here: http://www.extentofthejam.com/pseudo/
pettersson
Posts: 5
Joined: Mon Jan 20, 2020 8:04 am

Re: Road rendering like in Top Gear 2

Post by pettersson »

Thanks for the hints!
"Raster Racer" - did not think of that...
Oziphantom
Posts: 2001
Joined: Tue Feb 07, 2017 2:03 am

Re: Road rendering like in Top Gear 2

Post by Oziphantom »

Here is an open source C64 racing game engine https://github.com/martinpiper/C64Publi ... RacingGame