AlphaImage: Difference between revisions
No edit summary |
merged with Alpha Image, turned into one text rather than a series of appendices, re-uploaded ra2-formatted palette |
||
Line 1: | Line 1: | ||
{{flag|name=AlphaImage|files=rules(md).ini|values=Strings, see below|special=None|default=none/null|types=InfantryTypes, VehicleTypes, AircraftTypes, BuildingTypes|games=TS, FS, RA2, YR}} | {{flag|name=AlphaImage|files=rules(md).ini|values=Strings, see below|special=None|default=none/null|types=InfantryTypes, VehicleTypes, AircraftTypes, BuildingTypes|games=TS, FS, RA2, YR}} | ||
== | ==About Alpha Images== | ||
[[Image:alphatst.jpg|thumb|250px|Simple lightpost test, using the original alphatst.shp]] | |||
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. | |||
Since alpha images can be defined per object (as opposed to globally) and there is no fixed file name, alpha images can be used to create custom lighting for every object you want; remember, however, that 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. Animated alpha images are not possible, either. | |||
{{clr}} | |||
{| align="center" cellspacing="2" cellpadding="4" style="border-collapse: collapse;background:#f07878;" width="80%;" | |||
!bgcolor="#30f030" style="border-bottom: 1px solid #000000;border-right: 1px solid #000000;" width="50%;"|Benefits | |||
!bgcolor="#f00808" style="border-bottom: 1px solid #000000;border-left: 1px solid #000000;"|Drawbacks | |||
|- | |||
|style="background:#78f078;"|'''No lag at all'''. "Tiled" lights cause lag when placing them down, overlapping, destroying, etc. Alpha images do not. | |||
|style="background:#f07878;"|Only affects brightness, not coloring. | |||
|- | |||
|style="background:#66cc66;"|Looks much better than the standard "tiled" light. | |||
|style="background:#cc6666;"|Can only increase brightness, not decrease it.{{sup|1}} | |||
|- | |||
|style="background:#78f078;"|Customizable shape/amount/area of effect. | |||
|style="background:#f07878;"|Remains active even when the owner object is powered down, or when 'Turn off building' map action is applied. | |||
|- | |||
|style="background:#66cc66;"| | |||
|style="background:#cc6666;"|Is known to cause building selection bracket discoloration, as well as discoloration of line trails.{{sup|2}} | |||
|}<br> | |||
<div align="right"><small>{{sup|1}}Meaning you cannot build negative lightposts with alpha images.</small><br> | |||
<small>{{sup|2}}These are, however, barely visible, and usually don't affect your perception of the game.</small></div> | |||
==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, store it in an appropriate .mix file. Once you have that, just put {{tt|AlphaImage=yourAlphaImageFileName.shp}} 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 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 [[#Related files|here]]) - the brighter the color is, the brighter the light will be.<br> | |||
Using any color below #127 will definately result in a distorted image, and probably in crashes. The reason for this is unknown. | |||
==Examples== | |||
[[Image:alpha_no_lag.jpg|thumb|150px|LOOK DADDY, NO LAG!]] | |||
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. 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.{{clr}} | |||
{| | |||
|[[Image:Alphatst_ren1.gif|none|thumb|150px|Image used as SHP]] | |||
|[[Image:Alphatest1_ren1.jpg|none|thumb|150px|Ingame screenshot]] | |||
|- | |||
|[[Image:Alphatst_ren2.gif|none|thumb|150px|Image used as SHP]] | |||
|[[Image:Alphatest2_ren1.jpg|none|thumb|150px|Ingame screenshot]] | |||
|} | |||
:''This section is rather small and research-centered; if you have more, actual-mod-screenshots, please add them.'' | |||
==Related files== | |||
*[[Media:alphatst.pal|Grey scale palette, JASC format]] | |||
*[[Media:ALPHATST_ra2.pal|Grey scale palette, RA2 format]] | |||
*[[Media:alphatst.shp|Original alphatst.shp, correctly named]] | |||
== | ==See also== | ||
''Tiled light specific flags:'' | |||
*[[LightVisibility]] | |||
*[[LightIntensity]] | |||
*[[LightRedTint]] | |||
*[[LightGreenTint]] | |||
*[[LightBlueTint]] | |||
[[ | |||
[[ | |||
[[ | |||
[[Category:INI_Flags]] | [[Category:INI_Flags]] | ||
Line 59: | Line 70: | ||
[[Category:AircraftTypes Flags]] | [[Category:AircraftTypes Flags]] | ||
[[Category:BuildingTypes Flags]] | [[Category:BuildingTypes Flags]] | ||
[[Category:General_Editing_Information]] | |||
[[Category:Tutorials]] |
Revision as of 14:57, 4 July 2006
Flag: | AlphaImage |
File(s): | rules(md).ini |
Values: | Strings, see below |
Special Values: | None |
Default: | none/null |
Applicable to: | InfantryTypes, VehicleTypes, AircraftTypes, BuildingTypes |
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.
Since alpha images can be defined per object (as opposed to globally) and there is no fixed file name, alpha images can be used to create custom lighting for every object you want; remember, however, that 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. Animated alpha images are not possible, either.
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. | Can only increase brightness, not decrease it.1 |
Customizable shape/amount/area of effect. | Remains active even when the owner object is powered down, or when 'Turn off building' map action is applied. |
Is known to cause building selection bracket discoloration, as well as discoloration of line trails.2 |
2These are, however, barely visible, and usually don't affect your perception of the game.
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, store it in an appropriate .mix file. Once you have that, just put AlphaImage=yourAlphaImageFileName.shp 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 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 will definately result in a distorted image, and probably in crashes. The reason for this is unknown.
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. 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: