2013-12-08 17:36:39 +00:00
|
|
|
#include "AtmosphereResult.h"
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
AtmosphereResult::AtmosphereResult() {
|
2013-12-08 17:36:39 +00:00
|
|
|
base = COLOR_BLACK;
|
|
|
|
inscattering = COLOR_BLACK;
|
|
|
|
attenuation = COLOR_WHITE;
|
|
|
|
mask = COLOR_TRANSPARENT;
|
|
|
|
distance = 0.0;
|
|
|
|
final = COLOR_BLACK;
|
|
|
|
}
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
void AtmosphereResult::updateFinal() {
|
2013-12-08 17:36:39 +00:00
|
|
|
final.r = base.r * attenuation.r + inscattering.r;
|
|
|
|
final.g = base.g * attenuation.g + inscattering.g;
|
|
|
|
final.b = base.b * attenuation.b + inscattering.b;
|
|
|
|
final.a = 1.0;
|
|
|
|
|
2013-12-11 09:24:35 +00:00
|
|
|
final.mask(mask);
|
2013-12-08 17:36:39 +00:00
|
|
|
}
|