Kappes Buur wrote:.
HotWax wrote:You can also color the control sector for the TransferHeights special to set the color while underwater.  In fact, you can add fog and other effects (like sector-based damage) and they will copy over too.
Do you happen to have an example pwad for this? Or could someone whip one up, please?
 
Not offhand, no...  But it should be pretty easy to make one.  Just make two sectors, transfer heights to one of them, and set different fog/light values in each and it should work.  I'm fairly sure there have been levels that use such effects...
Graf Zahl wrote:...
Setting a blending value means: Display=Pixel*(1-BlendAlpha)+Blend*BlendAlpha.
...
What does that mean, in layman's terms?
.
 
AFAIK (Correct me if I'm wrong, Graf), Pixel*Color means to use the set sector color (Color) as a mask for each Pixel in the sector.  i.e:
Original color: 80 00 FF
Sector color: 40 FF C0 (which becomes 0.25 1.0 0.75 when normalized)
New color: 20 00 C0
(0x80 * 0.25 = 0x20, 0x00 * 1 = 0x00, 0xFF * 0.75 = 0xC0)
So the sector color controls how much of each original color remains without adding any.  Blue (00 00 FF) in a purple sector (FF 00 FF) remains blue, because it fits entirely within the mask.  Blue in a RED sector (FF 00 00) becomes black, not purple as you might expect; We're not mixing colors, we're masking them.  Because the blue gets eradicated completely, there's nothing left and the resulting color is (00 00 00) which is pure black.
On the other hand, the blend, which looks unnecessarily complex...
Display=Pixel*(1-BlendAlpha)+Blend*BlendAlpha
Let's look at this one piece at a time.  Pixel = The original color of the non-blended pixel, whether it comes from the floor, ceiling, a wall texture, or a sprite.  The BlendAlpha is the AA amount set using the RRGGBBAA method, normalized to a range of 0.0-1.0.  The Blend is the color specified in the RRGGBB part of that equation.
Now, if you break the equation down, you'll notice it is made up of two of what we just did.  Namely:
Pixel*Something
Blend*Something
So just as before, the "Something" (in this case, BlendAlpha and its inverse) mask the color it is multiplying.  The difference is that because we're using the inverse of BlendAlpha and adding it to the original, the result will always give us a full color.  (1-BlendAlpha+BlendAlpha = 1)  By taking 1-BlendAlpha, we get how much color we're NOT givinig to the Blend, and we put that much of the original color in.  We then use Blend*BlendAlpha to determine how much blend color to put in, and then add the two colors together.
Okay, that probably sounded confusing.  Maybe some examples will help:
Pixel=00 00 FF (Blue)
Blend=FF 00 00 (Red)
Alpha = 0.5
In this case, the inverse and the Alpha are both 0.5 (1 - 0.5 = 0.5), which means we're mixing equal parts source color and blend color.  Multiplying the source by 0.5 we get (00 00 80).  Multiplying the blend by 0.5 we get (80 00 00).  When we add them together, the result is (80 00 80).  Hey look!  Purple!  Now, if you wanted a weaker red light that wouldn't mix colors so evenly, all you'd do is reduce the alpha, like so:
Pixel = 00 00 FF (Blue)
Blend = FF 00 00 (Red)
Alpha = 0.25
The result in this case would be:
00 00 FF * (1 - 0.25 = 0.75) = 00 00 C0, plus:
FF 00 FF * (0.25) = 40 00 00
= 40 00 C0
Still purple, but now the blue is much stronger because not as much red is mixed in.
If you set the alpha value to one extreme or the other, you'll be saying not to blend any of one color or the other in.  For example:
Pixel = 8C 9F 10
Blend = FF FF FF
Alpha = 1.0
Full alpha means that we mix in the full Blend color, which is white in this case, and don't use any of the original color. (Pixel * (1 - 1) = 0)  The result is that everything in the sector will be pure white.  Not particularly useful perhaps...
The opposite would be an alpha of 0, which would be just as if the sector didn't have a blend.  It would use 100% of the source color and none of the blend color when rendering the pixel.