mirror of
https://github.com/lubosz/overte.git
synced 2025-04-09 12:12:30 +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) {
|
||||
auto& params = _hazeParametersBuffer.get<Parameters>();
|
||||
|
||||
if (params.hazeBackgroundBlend != hazeBackgroundBlend) {
|
||||
_hazeParametersBuffer.edit<Parameters>().hazeBackgroundBlend = hazeBackgroundBlend;
|
||||
auto newBlend = 1.0f - hazeBackgroundBlend;
|
||||
if (params.hazeBackgroundBlend != newBlend) {
|
||||
_hazeParametersBuffer.edit<Parameters>().hazeBackgroundBlend = newBlend;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ vec4 computeHazeColor(vec3 fragPositionES, vec3 fragPositionWS, vec3 eyePosition
|
|||
const float BLEND_DISTANCE = 27000.0f;
|
||||
vec4 outFragColor = potentialFragColor;
|
||||
if (distance > BLEND_DISTANCE) {
|
||||
outFragColor.a = 1.0 - hazeParams.backgroundBlend;
|
||||
outFragColor.a *= hazeParams.backgroundBlend;
|
||||
}
|
||||
|
||||
return outFragColor;
|
||||
|
|
Loading…
Reference in a new issue