# Blending question

This topic is 3874 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I want to apply aerial perspective to my terrain (desaturation and blue shifting of far distanced mountains). I have these 2 formulas: 1) Ie * Fatt + Iv 2) Ie * Fatt + Iv * (1 - Fatt) Ie is the color of the terrain (from a texture), Fatt an attenuation factor in [0,1] (Fatt becomes smaller as the distance increases) and Iv the inscattered light (blue at day). The problem is: the first question is physically accurate, but makes my terrain to bright/bluish. The second formula produces nice results. Does anybody have an idea why formula 2) produces better results even though forumla 1) is physically more accurate?

##### Share on other sites
Quote:
 Original post by schupfHello,I want to apply aerial perspective to my terrain (desaturation and blue shifting of far distanced mountains).I have these 2 formulas:1) Ie * Fatt + Iv2) Ie * Fatt + Iv * (1 - Fatt)Ie is the color of the terrain (from a texture), Fatt an attenuation factor in [0,1] (Fatt becomes smaller as the distance increases) and Iv the inscattered light (blue at day).The problem is: the first question is physically accurate, but makes my terrain to bright/bluish. The second formula produces nice results.Does anybody have an idea why formula 2) produces better results even though forumla 1) is physically more accurate?

Are you using high dynamic range lighting, or do you consider any result outside the range [0, 1] to be invalid?

Assuming you're not using HDR:

Without digressing into colourspaces, the human eye, nonlinearity etc. the first formula isn't guaranteed to produce a result in the range [0, 1] even if Ie and Iv are. The hardware will either clamp the result to [0, 1], or normalize it somehow, either of which will be noticeably nonlinear for certain values of Ie and Iv.

The second formula is linear interpolation where Fatt is the parameter. So it guarantees a result in the range [0, 1] (assuming that Ie and Iv are also in the range [0, 1]) and therefore looks "nice".

I think you have a few choices:

1. Use formula 2.

2. Convert to HSV colourspace, do whatever desaturation or hue modifications you want, and convert back to RGB colourspace.

3. Use high dynamic range lighting.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013599
×