# Figuring out the blending between satmaps and ground _co's and where things go wrong

## Recommended Posts

To try and find out exactly how ARMA 2 blends sat maps with ground detail (co) textures I strategically added color bars to a test map (which being in New Mexico had a nice big flat area):

I then took screen grabs and took them into Mathematica to try and extract the blending functions:

I've managed to successfully derive the function and implement it as a few simple Photoshop adjustment layers, so that you can place a sat map sample in one layer, and a ground _co in another, and preview how they will appear together in A2. It reproduces the odd tints and color shifts, too; the following is what happens when you have a sat map that transitions from dark to light (left to right in the picture):

The above is a grab from Photoshop and closely matches the in-game blending. I'm more interested in deserts, but I presume the above is what happens any time someone tries to make a snow map with white on white. ;)

The mathematics of it lends a bit of insight too; for example, light green and red tints can be a lot brighter than blue tints before they start to produce artifacts.

My question is, would there be any interest in me writing up my findings (probably as a PDF and Photoshop action)? I haven't been able to find much on the subject (other than the standard advice of darkening the sat map and trying to match it to the detail textures better) but knowing me I've skimmed over some place it is all already documented. :eek:

Edited by IanBanks

##### Share on other sites

woah.... you amazing so and so... This will definitely come in handy, you deserve some kind of medal for this, how did you even come up with this idea?

D

##### Share on other sites

Extremely interesting info.

If i correctly interpret your fig (2) you have:

X Axis - Distance

Y Axis - Multiply Blend Amount for each:

Colored traces

Blue - Satellite

Gold - Surface A

Brick - Surface B

So could we say that at distance 100m Satelite = 100%, Gold/Brick ~= 60% each. I assume still these values would be normalized back after multiply (keeping luminosity similar at 300m where Sat ~= 30% SurfA/B ~=20%)?

fig (3)

Your final photoshop simulation of surface on sat transition according to distance from left to right?

Take a look at this gallery: (mind you this is Stratis - Arma 3 [not 2])

Here i was wrongly overlaying textures, i was not too sure of multiply despite being the best advice (ie. *mco), multiply was requiring me too much post processing which i did not like...

You shall notice that my interest is not so much the co + sat textures but the full blending along with the detail (mid range) texture and it's function of distance.

The exact study you did but for the latter would be extremely helpful in better informing, and objectivating the following ticket (again for A3):

0015758: Extend area where Detail Map+Surface Textures Blend together (at a specific level of best effect - 50%?)

If you do have the time documenting this information would be swell. In any case, much appreciated for this analysis, i'm already thinking of updating the ticket.

##### Share on other sites

Figure 2 was a white bar on the detail texture and a gradient from white (left) to black (right) on the satmap. Here's a better version of it showing the actual colours; note that while not only ramping up with the satmap gradient, the result is also being blue shifted:

I've given up on trying to extract the exact figures from screenshots (the texture interpolation was messing with it too much to give exact numbers) and gone for a far more direct approach. The function that combines satmaps, _co's and the middle ground _mco (for arma2oa at least) is:

(The graph shows _co and satmap mixing, with no _mco)

The function is applied to each colour channel. v1[w] controls the blending from detail _co to middle _mco and presumably ranges from 1 (near) to 0 (far).

You can see that mco is doubled and then multiplied with the satmap, which matches the rule that 0.5 (middle gray) is neutral. You can simulate the mco blending in photoshop by:

• Creating a bottom layer to simulate a part of your satmap (taking a small area and enlarging it by around 40 would be a good approximation).
• Adding a "curves" layer, and then moving the line to between (0, 0) and (255,128). The coordinates are in (input, output) order.
• Adding your _mco as a layer above the curves layer, and changing the blending mode from "Normal" to "Multiply".
• Adding another "curves" adjustment layer above the _mco layer, and then changing the line to between (0, 0) to (64, 255).

The function is 2 * _co * satmap, but since that would saturate in Photoshop you're doing (((satmap * 0.5) * _co) * 4) to get the same thing.

If you want to muck about with adding multiple layers (like adjustment layers) on the _mco layer, replace it with a new layer group, set the layer group mode to "Multiply" and then add your _mco (now set to normal blend) in there with whatever other layers you want. As long is it is in the group it'll compose all those layers and then multiply the entire group with the lower layers.

There's more to come (I still want to track down the cause of the blue tinting, and I'm close to figuring out how the satmask areas blend between each other).

##### Share on other sites

I'm trying to put aside a little time to take a look at your findings and turn it into some kind of system that I can use, some kind of photoshop template or something, but first I need to actually understand what it all means, I've re read this post about four times now and every time it makes a little more sense.

Props... really.

D

##### Share on other sites

Once again thanks for you input, the "post process" consisting of "Adding a "curves" layer, and then moving the line to between (0, 0) and (255,128)" is very useful, i had tried it but had inconsistent results.

But put simply for each multiply layer (discounting the base sat) we only need to halve the output, or in other words "stretch" back available image level data to 255. Since this will turn contrast down the effect should solve my saturation issues too.