Skip to content

Commit

Permalink
Wiki update for blending mode specifier change (#10429) (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibetiroka authored Aug 24, 2024
1 parent ab2a55e commit 22e0ba6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wiki/BlendingModes.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ That is, we're adding somewhere between 50% and 100% of the background to the ob

One problem with all of this: depending on your graphics program, it can be really hard to save a PNG files where all the alpha values are zero, and yet the color values are perfectly preserved. What's more, even if you are able to save such a file, opening it in most image viewers will show you a transparent image, rather than the colors that you want to see.

For this reason, Endless Sky is designed to do the premultiplication after loading the image, based on the image name. Each image can (optionally) include a blending mode specifier right before the frame index number: `-` for alpha blending, `+` for additive blending, or `~` for half-additive blending. When each image is read, the alpha premultiplication is done, and then the alpha channel is set to 0 if it is an additive image, or divided by 2 if it is half-additive. This makes it very easy to create input images without any special software tools.
For this reason, Endless Sky is designed to do the premultiplication after loading the image, based on the image name. Each image can (optionally) include a blending mode specifier right before the frame index number: `-` for alpha blending, `+` for additive blending, or `^` for half-additive blending. (Before **v0.10.9**, half-additive blending used `~`, but that is now deprecated.) When each image is read, the alpha premultiplication is done, and then the alpha channel is set to 0 if it is an additive image, or divided by 2 if it is half-additive. This makes it very easy to create input images without any special software tools.

For images that are drawn in additive mode, you can supply them as a completely opaque image drawn over a black background. Or, you can just supply an image with transparency, and the additive image will be generated by adding a black background to the image.

Expand Down

0 comments on commit 22e0ba6

Please sign in to comment.