Headlights in a top view racing game

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
tommik
Newbie
Posts: 3
Joined: Sun Jul 10, 2011 9:37 am

Headlights in a top view racing game

Post by tommik » Sun Jul 10, 2011 9:50 am

How would you render headlights effect in front of a car in a top view scrolling racing game?

First I was thinking it could be done by using the second playfield to cover the scene with black pixels but it would be only limited to absolute dark with a small segment uncovered - to simulate the headlights in front of the car. It would not look good if we wanted to use some more grades of darkness by altering the pixels of the cover playfield.

But I think the most flexible would be to alter the colours of the scene. That way we can simulate intensity of darkness. But the question is how do we keep the full light in front of the car? Can we change the colours of just that small portion of the playfield without affecting the rest of the screen? I was thinging like prerendering the small area of cells (in front of the car) to get different colours. I gues it is somehow possible on Genesis.

Also, there are those shadow/highlight features but I guess they are restricted to whole scanlines rather than a specific portion of the playfield, should I say trapezoid...

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Jul 10, 2011 11:09 am

Not much can be done on SMD for this effect. You can use shadow/highlight, though, it is not restricted to whole scanlines.

Also, check this.

tommik
Newbie
Posts: 3
Joined: Sun Jul 10, 2011 9:37 am

Post by tommik » Sun Jul 10, 2011 11:15 am

That's looking good. The question is what range of colours is possible....

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Jul 10, 2011 11:41 am

You can put normal background on bottom layer, and put copy of highlight part on another layer, giving it brighter palette. It will be 31 colors combined, out of palette of 512, which is pretty limited in amount of shades of a color. It will be blocky, but you probably can prerender masked tiles in a buffer and transfer to VRAM, should fit into available VRAM access time.

Another solution could be a dithered mask overlay, it looked nice in Mickey Mania on TV.

tommik
Newbie
Posts: 3
Joined: Sun Jul 10, 2011 9:37 am

Post by tommik » Sun Jul 10, 2011 4:00 pm

Hm, dithering doesn't look that bad afterall... How about changing the cells in front of the car? Could you get different colours by that?

Post Reply