-
Notifications
You must be signed in to change notification settings - Fork 401
Single-canvas inline, drop XRPresentationContext #656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b7a1a8f
Single-canvas inline, drop XRPresentationContext
toji 771b48a
Updated the explainer
toji 2dbf9f1
Addressing some feedback
toji bed660f
Move direct output flag to render state
toji 9b65d29
Comment about the WebGLRenderingContext's attributes taking precedenc…
toji 458034b
Changed option to compositionDisabled
toji 41c03e6
Fixed up explainer
toji 006f5a1
Fixed a broken link to an outdated product
toji dfbc4bb
Change composition disabled to be implicit based on session type
toji a0a5310
Fixing a few loose ends
toji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Move direct output flag to render state
- Loading branch information
commit bed660f1b4292035c5dc6c15a51a78d5d18fcdf1
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -490,6 +490,13 @@ When requested, the {{XRSession}} MUST <dfn>apply pending render states</dfn> by | |
<dt> Otherwise | ||
<dd> Set |activeState|'s [=XRRenderState/output canvas=] to <code>null</code>. | ||
</dl> | ||
1. Set |activeState|'s [=XRRenderState/direct output=] boolean based on the following: | ||
<dl class="switch"> | ||
<dt> If |session|'s [=XRSession/mode=] is {{XRSessionMode/inline}} and |baseLayer| is an instance of an {{XRWebGLLayer}} with [=XRWebGLLayer/use default framebuffer=] set to <code>true</code> | ||
<dd> Set |activeState|'s [=XRRenderState/direct output=] to <code>true</code> | ||
<dt> Otherwise | ||
<dd> Set |activeState|'s [=XRRenderState/direct output=] boolean to <code>false</code>. | ||
</dl> | ||
|
||
</div> | ||
|
||
|
@@ -567,20 +574,7 @@ The <dfn attribute for="XRSession">environmentBlendMode</dfn> attribute returns | |
|
||
NOTE: Most Virtual Reality devices exhibit {{XREnvironmentBlendMode/opaque}} blending behavior. Augmented Reality devices that use transparent optical elements frequently exhibit {{XREnvironmentBlendMode/additive}} blending behavior, and Augmented Reality devices that use passthrough cameras frequently exhibit {{XREnvironmentBlendMode/alpha-blend}} blending behavior. | ||
|
||
An {{XRSessionMode/inline}} {{XRSession}} is considered a <dfn for="XRSession">direct output session</dfn> if rendering commands performed for the {{XRSession}} are executed in such a way that they are directly displayed on the page, rather than being processed by the [=XR Compositor=]. | ||
|
||
<div class="algorithm" data-algorithm="determine-direct-output-session"> | ||
|
||
To determine if an {{XRSession}} |session| is a [=direct output session=], the user agent MUST run the following steps: | ||
|
||
1. If |session|'s [=XRSession/mode=] is not {{XRSessionMode/inline}}, return <code>false</code>. | ||
1. Let |baseLayer| be |session|'s {{XRSession/renderState}}'s {{XRRenderState/baseLayer}}. | ||
1. If |baseLayer| is an instance of an {{XRWebGLLayer}} with a [=XRWebGLLayer/use default framebuffer=] boolean set to <code>true</code>, return <code>true</code>. | ||
1. return <code>false</code>. | ||
|
||
</div> | ||
|
||
Each {{XRSession}} has a <dfn for="XRSession">viewer reference space</dfn>, which is an {{XRReferenceSpace}} of type {{XRReferenceSpaceType/viewer}} with an [=identity transform=] [=XRSpace/origin offset=]. The [=XRSession/viewer reference space=] has a <dfn for="XRSession/viewer reference space">list of views</dfn>, which is a [=/list=] of [=view=]s corresponding to the views provided by the [=/XR device=]. If the {{XRSession}} is a [=direct output session=] the [=list of views=] MUST contain a single [=view=]. | ||
Each {{XRSession}} has a <dfn for="XRSession">viewer reference space</dfn>, which is an {{XRReferenceSpace}} of type {{XRReferenceSpaceType/viewer}} with an [=identity transform=] [=XRSpace/origin offset=]. The [=XRSession/viewer reference space=] has a <dfn for="XRSession/viewer reference space">list of views</dfn>, which is a [=/list=] of [=view=]s corresponding to the views provided by the [=/XR device=]. If the {{XRSession}}'s {{XRSession/renderState}} is in [=XRRenderState/direct output=] mode the [=list of views=] MUST contain a single [=view=]. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: not your PR, but perhaps we want to call [=XRSession/viewer reference space=] something like [=XRSession/default viewer reference space=] or [=XRSession/primary viewer reference space=] to distinguish it from other viewer reference spaces that can be created?
toji marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<section class="unstable"> | ||
The <dfn attribute for="XRSession">onblur</dfn> attribute is an [=Event handler IDL attribute=] for the {{blur}} event type. | ||
|
@@ -625,7 +619,11 @@ dictionary XRRenderStateInit { | |
}; | ||
</pre> | ||
|
||
Each {{XRRenderState}} has a <dfn for="XRRenderState">output canvas</dfn>, which is an {{HTMLCanvasElement}}. The [=XRRenderState/output canvas=] is the DOM element that will display any content rendered for an {{XRSessionMode/inline}} {{XRSession}}. | ||
Each {{XRRenderState}} has a <dfn for="XRRenderState">output canvas</dfn>, which is an {{HTMLCanvasElement}} initially set to <code>null</code>. The [=XRRenderState/output canvas=] is the DOM element that will display any content rendered for an {{XRSessionMode/inline}} {{XRSession}}. | ||
|
||
Each {{XRRenderState}} also has <dfn for="XRRenderState">direct output</dfn> boolean, which is initially <code>false</code>. The {{XRRenderState}} is considered to be in [=XRRenderState/direct output=] mode if rendering commands performed for an {{XRSessionMode/inline}} {{XRSession}} are executed in such a way that they are directly displayed on the page, rather than being processed by the [=XR Compositor=]. | ||
toji marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Note: At this point the {{XRRenderState}} will only have an [=XRRenderState/output canvas=] if it is in [=XRRenderState/direct output=] mode, but future versions of the specification are likely to introduce methods for setting [=XRRenderState/output canvas=]' that support more advanced uses like mirroring and layer compositing that will not be [=XRRenderState/direct output=]. | ||
|
||
<div class="algorithm" data-algorithm="initialize-renderstate"> | ||
|
||
|
@@ -642,7 +640,6 @@ When an {{XRRenderState}} object is created for an {{XRSession}} |session|, the | |
<dd> Initialize |state|'s {{XRRenderState/inlineVerticalFieldOfView}} to <code>PI * 0.5</code>. | ||
</dl> | ||
1. Initialize |state|'s {{XRRenderState/baseLayer}} to <code>null</code>. | ||
1. Initialize |state|'s [=XRRenderState/output canvas=] to <code>null</code>. | ||
|
||
</div> | ||
|
||
|
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.
Uh oh!
There was an error while loading. Please reload this page.