AlphaImage: Difference between revisions
Correcting image markup, text... someone might want to retest since old tests are, well, old. |
cannis.net is gone. |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 38: | Line 38: | ||
==Using Alpha Images== | ==Using Alpha Images== | ||
Using an alpha image is fairly easy: First of all, you need the actual image. Create it, turn it into an SHP, and store it your expand(md)##.mix. Once you have that, just put {{ | Using an alpha image is fairly easy: First of all, you need the actual image. Create it, turn it into an SHP, and store it your expand(md)##.mix. Once you have that, just put {{f|AlphaImage|yourAlphaImageFileName|link}} (without the {{tt|.shp}} extension) on your object, and everything should be fine. | ||
The original, unused, lightpost alpha image ''should'' be called alphatst.shp, and is included in the game. It seems, however, to be wrongly named (sibmlr.shp). A correctly named alphatst.shp can be found at the bottom of this page. | The original, unused, lightpost alpha image ''should'' be called alphatst.shp, and is included in the game. It seems, however, to be wrongly named (sibmlr.shp). A correctly named alphatst.shp can be found at the bottom of this page. | ||
Line 61: | Line 61: | ||
|[[Image:Alphatst_ren2.gif|none|thumb|150px|Image used as SHP]] | |[[Image:Alphatst_ren2.gif|none|thumb|150px|Image used as SHP]] | ||
|[[Image:Alphatest2_ren1.jpg|none|thumb|150px|Ingame screenshot]] | |[[Image:Alphatest2_ren1.jpg|none|thumb|150px|Ingame screenshot]] | ||
[[File:Ero.png|none|thumb|250px|Everything can be used as AlphaImage!]] | |||
|[[Image:Alpha Proof.png|none|thumb|150px|Darkening works - have a look!]] | |[[Image:Alpha Proof.png|none|thumb|150px|Darkening works - have a look!]] | ||
[[File:Supershield.jpg|none|thumb|250px|download here http://www.ppmsite.com/forum/viewtopic.php?t=33068]] | |||
|} | |} | ||
:''This section is rather small and research-centered; if you have more, actual-mod-screenshots, please add them.'' | :''This section is rather small and research-centered; if you have more, actual-mod-screenshots, please add them.'' | ||
Line 67: | Line 69: | ||
==Related files== | ==Related files== | ||
*[[Media:alphatst.pal|Grey scale palette, JASC format]] | *[[Media:alphatst.pal|Grey scale palette, JASC format]] | ||
*[[Media: | *[[Media:Alphapalown.pal|Grey scale palette, RA2 format]] | ||
*[[Media:alphatst.shp|Original alphatst.shp, correctly named]] | *[[Media:alphatst.shp|Original alphatst.shp, correctly named]] | ||
==See also== | ==See also== | ||
*[http://www.cannis.net/forum/index.php?showtopic=5597&st=0 Thread on C-GEN including ecache*.mix problematic discovery] | *(dead link)[http://www.cannis.net/forum/index.php?showtopic=5597&st=0 Thread on C-GEN including ecache*.mix problematic discovery] | ||
''Tiled light specific flags:'' | ''Tiled light specific flags:'' | ||
*[[LightVisibility]] | *[[LightVisibility]] |
Latest revision as of 08:58, 22 April 2020
Flag: | AlphaImage |
File(s): | rules(md).ini |
Values: | Strings: Normal text. (Limited to: shp filenames) |
Default: | none |
Applicable to: | TechnoTypes: AircraftTypes, BuildingTypes, InfantryTypes and VehicleTypes as well as ObjectTypes: Animations, Projectiles, TMPTiles, OverlayTypes, ParticleSystems, Particles, SmudgeTypes, TerrainTypes and VoxelAnimTypes |
About Alpha Images
Alpha images are a very nice lighting feature used in Tiberian Sun, but left unused in Red Alert 2 and Yuri's Revenge. Alpha images are grayscale SHPs that are attached to, for example, a lightpost. If one is attached to an object, the object automatically starts emitting light, with the brightness of the light at a given pixel determined by the index number of the corresponding pixel of the alpha image. In other words: The light is modeled after the image and its brightness is defined by the brightness of the pixels. This allows a total customization of the light's shape.
Bugs/Side-Effects/Unexpected Limitations
Benefits | Drawbacks |
---|---|
No lag at all. "Tiled" lights cause lag when placing them down, overlapping, destroying, etc. Alpha images do not. | Only affects brightness, not coloring. |
Looks much better than the standard "tiled" light. | Remains active even when the owner object is powered down, or when 'Turn off building' map action is applied. |
Customizable shape/amount/area of effect. | Is known to cause building selection bracket discoloration, as well as discoloration of line trails.1 |
1 ↑ These are, however, barely visible, and usually don't affect your perception of the game.
Limitations
- This light does not follow around moving objects. So while it is possible to create shiny headlights for Grizzly Tanks, the light itself will be left behind where the Grizzly was spawned - while the Grizzly moves around the map just as always.
- Cannot be animated.
Using Alpha Images
Using an alpha image is fairly easy: First of all, you need the actual image. Create it, turn it into an SHP, and store it your expand(md)##.mix. Once you have that, just put AlphaImage=yourAlphaImageFileName (without the .shp extension) on your object, and everything should be fine.
The original, unused, lightpost alpha image should be called alphatst.shp, and is included in the game. It seems, however, to be wrongly named (sibmlr.shp). A correctly named alphatst.shp can be found at the bottom of this page.
Note: AlphaImages should be saved using Compression 1, like the mouse cursors, to work properly.
A note on XCC Mod Creator
Alpha images seem to get corrupted when read from an ecache*.mix. Since XMC automatically puts SHPs in that file, you have to abuse a category like Video to have your alpha image(s) placed directly in the game directory. As long as it doesn't end up in ecache*.mix, there's no problem using alpha images with XMC.
The Alpha Image Palette
Alpha images are normal SHPs, but they do not have an associated palette. Rather, their color index is mapped to brightness values, making index #127 neutral, i.e. no light change, and #128-#255 gradually becoming brighter, with #255 being the brightest. The best way to illustrate this is to use a greyscale palette from black (index 0) to white (index 255) (see here) - the brighter the color is, the brighter the light will be.
Using any color below #127 apparently requires Compression 1 to work properly, otherwise crashes and/or distortions will happen.
Examples
The most prominent example of alpha image usage is DCoder's "LOOK DADDY, NO LAG!" screenshot. Other screenshots to note are Renegade's alpha test screenshots, illustrating not only how good correct alphas can look ingame, but also what happens if you use index 126 and below (without using Compression 1). Important to note here is that the full-palette screenshot was taken on Arena, after the same image had crashed the game to desktop (just by scrolling to where it was) on Bay of Pigs.
- This section is rather small and research-centered; if you have more, actual-mod-screenshots, please add them.
Related files
- Grey scale palette, JASC format
- Grey scale palette, RA2 format
- Original alphatst.shp, correctly named
See also
Tiled light specific flags:
- Rules(md).ini Flags
- TechnoTypes Flags
- AircraftTypes Flags
- BuildingTypes Flags
- InfantryTypes Flags
- VehicleTypes Flags
- ObjectTypes Flags
- Animations Flags
- Projectile Flags
- TMPTiles Flags
- OverlayTypes Flags
- ParticleSystems Flags
- Particles Flags
- SmudgeTypes Flags
- TerrainTypes Flags
- VoxelAnimTypes Flags
- INI Flags
- Bugs and Errors
- General Editing Information
- General Tutorials