-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix alpha composing of horizon blend with sky gradient (#10640)
Make sure to un/post multiply alpha before/after applying sky gradient contribution, as color ramps are premultiplied-alpha colors. This prevents washed out colors when using transparency.
- Loading branch information
1 parent
693e96e
commit a55a4c9
Showing
5 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+41.6 KB
test/integration/render-tests/fog/horizon-blend/atmosphere/opacity/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions
36
test/integration/render-tests/fog/horizon-blend/atmosphere/opacity/style.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"height": 100, | ||
"width": 512 | ||
} | ||
}, | ||
"sources": {}, | ||
"zoom": 16, | ||
"pitch": 85, | ||
"fog": { | ||
"range": [200, 1200], | ||
"color": "rgba(255, 255, 255, 0.8)", | ||
"horizon-blend": 0.2 | ||
}, | ||
"layers": [ | ||
{ | ||
"id": "sky", | ||
"type": "sky", | ||
"paint": { | ||
"sky-type": "atmosphere", | ||
"sky-atmosphere-sun": [0, 0], | ||
"sky-atmosphere-sun-intensity": 15, | ||
"sky-opacity": 0.5 | ||
} | ||
}, | ||
{ | ||
"id": "background", | ||
"type": "background", | ||
"paint": { | ||
"background-color": "beige" | ||
} | ||
} | ||
] | ||
} |
Binary file added
BIN
+42.5 KB
test/integration/render-tests/fog/horizon-blend/gradient/opacity/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions
36
test/integration/render-tests/fog/horizon-blend/gradient/opacity/style.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"height": 100, | ||
"width": 512 | ||
} | ||
}, | ||
"sources": {}, | ||
"zoom": 16, | ||
"pitch": 85, | ||
"fog": { | ||
"range": [200, 1200], | ||
"color": "rgba(255, 255, 255, 1.0)", | ||
"horizon-blend": 0.2 | ||
}, | ||
"layers": [ | ||
{ | ||
"id": "sky", | ||
"type": "sky", | ||
"paint": { | ||
"sky-type": "gradient", | ||
"sky-gradient-center": [0, 0], | ||
"sky-gradient-radius": 90, | ||
"sky-opacity": 0.5 | ||
} | ||
}, | ||
{ | ||
"id": "background", | ||
"type": "background", | ||
"paint": { | ||
"background-color": "beige" | ||
} | ||
} | ||
] | ||
} |