mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 07:03:41 +02:00
Working background blend on haze
This commit is contained in:
parent
4b7b14f4d3
commit
d2763841be
2 changed files with 4 additions and 4 deletions
|
@ -177,9 +177,9 @@ void Haze::setHazeBaseReference(const float hazeBaseReference) {
|
||||||
|
|
||||||
void Haze::setHazeBackgroundBlend(const float hazeBackgroundBlend) {
|
void Haze::setHazeBackgroundBlend(const float hazeBackgroundBlend) {
|
||||||
auto& params = _hazeParametersBuffer.get<Parameters>();
|
auto& params = _hazeParametersBuffer.get<Parameters>();
|
||||||
|
auto newBlend = 1.0f - hazeBackgroundBlend;
|
||||||
if (params.hazeBackgroundBlend != hazeBackgroundBlend) {
|
if (params.hazeBackgroundBlend != newBlend) {
|
||||||
_hazeParametersBuffer.edit<Parameters>().hazeBackgroundBlend = hazeBackgroundBlend;
|
_hazeParametersBuffer.edit<Parameters>().hazeBackgroundBlend = newBlend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ vec4 computeHazeColor(vec3 fragPositionES, vec3 fragPositionWS, vec3 eyePosition
|
||||||
const float BLEND_DISTANCE = 27000.0f;
|
const float BLEND_DISTANCE = 27000.0f;
|
||||||
vec4 outFragColor = potentialFragColor;
|
vec4 outFragColor = potentialFragColor;
|
||||||
if (distance > BLEND_DISTANCE) {
|
if (distance > BLEND_DISTANCE) {
|
||||||
outFragColor.a = 1.0 - hazeParams.backgroundBlend;
|
outFragColor.a *= hazeParams.backgroundBlend;
|
||||||
}
|
}
|
||||||
|
|
||||||
return outFragColor;
|
return outFragColor;
|
||||||
|
|
Loading…
Reference in a new issue