ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Alpha Image: Difference between revisions

From ModEnc
Jump to navigation Jump to search
m added ra2 format palette link.
Added gamemate's input
Line 5: Line 5:
=== Original post ===
=== Original post ===
Attached is the image for the AlphaLight effect seen in TiberianSun. It works fine in RA2 and there is the possibility of creating further alpha effects if my understanding is correct. This is another totally unused feature in RA2/YR. The alpha image is called alphatst.shp, but is reported wrongly by XCC (or at least the version I have) as sibmlr.shp. Put this file into the normal mod mix files and place a [TSTLAMP] on a map and marvel at the difference between alpha image light and the regular cell tinting effect. Don't try to convert the image to a pallet since it doesn't use one. Instead, any index above #127 in the pallet increases the light and I suspect (though haven't tested) that values below this decrease the among of light effect (negative light). You can create a useful alpha image by working in a greyscale pallet that runs from black (index 0) to white (index 255) and setting colour as index 127 to start with. 127 is a neutral pallet entry that does not affect the light ingame at all.
Attached is the image for the AlphaLight effect seen in TiberianSun. It works fine in RA2 and there is the possibility of creating further alpha effects if my understanding is correct. This is another totally unused feature in RA2/YR. The alpha image is called alphatst.shp, but is reported wrongly by XCC (or at least the version I have) as sibmlr.shp. Put this file into the normal mod mix files and place a [TSTLAMP] on a map and marvel at the difference between alpha image light and the regular cell tinting effect. Don't try to convert the image to a pallet since it doesn't use one. Instead, any index above #127 in the pallet increases the light and I suspect (though haven't tested) that values below this decrease the among of light effect (negative light). You can create a useful alpha image by working in a greyscale pallet that runs from black (index 0) to white (index 255) and setting colour as index 127 to start with. 127 is a neutral pallet entry that does not affect the light ingame at all.
Unfortunately, according to gamemate, ''animated'' alpha-images are ''not'' possible; in addition, if the alpha image is attached to something movable, the emitted light will stay at it's initial position, and not move around with the object.


=== Screenshot ===
=== Screenshot ===
Line 34: Line 36:


NineBreakerFan - palette conversion to RA2 format.
NineBreakerFan - palette conversion to RA2 format.
gamemate - animated SHP & movable object test.

Revision as of 14:38, 17 December 2004

AlphaImage

AlphaImage is a very nice feature that was used in TS, but left out of RA2.

Original post

Attached is the image for the AlphaLight effect seen in TiberianSun. It works fine in RA2 and there is the possibility of creating further alpha effects if my understanding is correct. This is another totally unused feature in RA2/YR. The alpha image is called alphatst.shp, but is reported wrongly by XCC (or at least the version I have) as sibmlr.shp. Put this file into the normal mod mix files and place a [TSTLAMP] on a map and marvel at the difference between alpha image light and the regular cell tinting effect. Don't try to convert the image to a pallet since it doesn't use one. Instead, any index above #127 in the pallet increases the light and I suspect (though haven't tested) that values below this decrease the among of light effect (negative light). You can create a useful alpha image by working in a greyscale pallet that runs from black (index 0) to white (index 255) and setting colour as index 127 to start with. 127 is a neutral pallet entry that does not affect the light ingame at all.

Unfortunately, according to gamemate, animated alpha-images are not possible; in addition, if the alpha image is attached to something movable, the emitted light will stay at it's initial position, and not move around with the object.

Screenshot

http://dcoder.cannis.net/images/alphatst.jpg

LOOK DADDY, NO LAG!

Explanations

The key is this tag:

[TSTLAMP]
AlphaImage=ALPHATST

So, you can add the effect to other buildings and create alternate effects for other structures.

To edit/add alternate effects of this type, you'll need the proper palette, that goes from black(#0) to white(#255). To help you, I've uploaded the correct palette in JASC format and RA2 format.

Keep in mind that the game adds (pixel's index-127) to the current map level.

So, indecies (0-126) reduce the lighting by (127-index), index 127 does nothing, and (128-255) add (index-127) to the lighting.

Also, you can get the original alphatst.shp here.

And the best part is this effect does not lag at all. See the LOOK DADDY, NO LAG! screenshot.

Credits

Blade - documented this effect and the way image data is rendered onto the map.

DCoder - lag stress test, screenshots.

NineBreakerFan - palette conversion to RA2 format.

gamemate - animated SHP & movable object test.