SCUMM Lighting

Started by Armageddon, Tue 12/06/2012 00:47:35

Previous topic - Next topic

Armageddon

So I'm a bit confused, I was replaying a bit of The Dig recently and I noticed that the player sprite was changing brightness as I walked around, and he has a slightly transparent blob shadow. I don't see how this could work with only 256 colors. I found this that was used for The Dig as inventory and character colors.

"A palette used by the artists, regulating the colors used in inventory icons, as well as which hues to use for in-engine shading and color shifting."
I can't find anything about this or how to replicate it. Any ideas?

Gilbert

Transparency in 8-bit mode usually means that either some colour slots are reserved for this purpose and their values are dynamically assigned, or the palette is set up to have enough variety of colours so that you can find close enough colours for the purpose. Either way usually involves approximation.

There is no direct way to do this (and not in AGS) and computations in pixel level are expected. It would be a bit less taxing if the area of the transparent effect is small (obviously) or it's simply darkening, tinting or lighting up an area (like a shadow, for example), as oppose to making a multi-colour sprite (e.g. a character) semi-transparent against say a multi-colour background.

Scavenger had been trying out with this a bit. You may read the discussion here and in fact he released a module for this.

Snarky

The player sprite changing brightness is very simple, since in VGA you can assign palette values to each color slot dynamically. You just reserve some of your color slots for the sprites (i.e. these are not used in the background or anything else that shouldn't change color as the character moves around), and adjust the palette values depending on the location of the character. (Since The Dig has multiple characters walking around and presumably being affected by the lighting, I'm curious how they made that work, though. If you reserve separate color slots for all the characters individually, you'll soon run out of colors.)

What I'm guessing they did for the shadow was design the background palette on color ramps (much like the ones you see in the picture you posted), and use the "light shadow" and "dark shadow" areas of the sprite as a mask to rewrite the background pixels with the next darker (or next two darker) value in the sequence (with black as the bottom).

SMF spam blocked by CleanTalk