Fix initial transparency of Web content layer#1811
Open
felipeerias wants to merge 1 commit into
Open
Conversation
0cdca2c to
c0a4aad
Compare
Collaborator
Author
|
The initialisation of the browser windows seems to conflict with some of the changes at #577 Specifically, the windows are not composited for a couple seconds after they have been created, which triggers this code: if (mCompositionLayerColorScaleBias != XR_NULL_HANDLE) {
vrb::Color tintColor = layer->GetTintColor();
if (!IsComposited() && (layer->GetClearColor().Alpha() > 0.0f)) {
tintColor = layer->GetClearColor();
tintColor.SetRGBA(tintColor.Red(), tintColor.Green(), tintColor.Blue(), tintColor.Alpha());
}
mCompositionLayerColorScaleBiasStruct.colorScale = {tintColor.Red(), tintColor.Green(), tintColor.Blue(), tintColor.Alpha()};
}Upon creation, the window layer has these attributes:
But with this code,
What this means is that the clear color is being multiplied by itself, which will make it look different than expected. |
Collaborator
Author
|
Another useful change would be to allow us to set the background color for a website, similar to Edit: implemented in PR #1827 |
c0a4aad to
4db7e12
Compare
c9100db to
55728f7
Compare
Collaborator
Author
|
Partial fix for #1766 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a first step towards fixing the problem that the window containing Web content appears transparent for a few seconds (issue #1766).
The problem seems to be related to the fact that we are enabling alpha blending for that layer even though it already has an opaque clear colour.
However, changing that XR flag is not enough to fully fix the issue: initially the layer appears completely black, followed by the expected clear color (but too bright).