{"action":"created","comment":{"url":"https://api.github.com/repos/immersive-web/webxr/pulls/comments/188398656","pull_request_review_id":120369087,"id":188398656,"diff_hunk":"@@ -706,19 +706,33 @@ function drawMultiviewScene(views, pose) {\n }\n ```\n \n-### High quality rendering\n+### Controlling rendering quality\n \n While in exclusive sessions, the UA is responsible for providing a framebuffer that is correctly optimized for presentation to the `XRSession` in each `XRPresentationFrame`. Developers can optionally request either the buffer size or viewport size be scaled, though the UA may not respect the request. Even when the UA honors the scaling requests, the result is not guaranteed to be the exact percentage requested.\n \n-The first scaling mechanism is done by specifying a `framebufferScaleFactor` at `XRWebGLLayer` creation time. In response, the UA may create a framebuffer that is based on the requested percentage of the maximum size supported by the `XRDevice`. On some platforms such as Daydream, the UA may set the default value of `framebufferScaleFactor` to be less 1.0 for performance reasons. Developers explicitly wishing to use the full resolution on these devices can do so by requesting the `framebufferScaleFactor` be set to 1.0.\n+The first scaling mechanism is done by specifying a `framebufferScaleFactor` at `XRWebGLLayer` creation time. Each `XRDevice` has a default framebuffer size, which corresponds to a `framebufferScaleFactor` of `1.0`. This default size is determined by the UA and should represent a reasonable balance between rendering quality and performance. It may not be the 'native' size for the device (that is, a buffer which would match the native screen resolution 1:1 at point of highest magnification). For example, mobile platforms such as GearVR or Daydream frequently suggest using lower resolutions than their screens are capable of to ensure consistent performance.\n+\n+If the `framebufferScaleFactor` is set to a number higher or lower than `1.0` the UA should create a framebuffer that is the default resolution multiplied by the given scale factor. So a `framebufferScaleFactor` of `0.5` would specify a framebuffer with 50% the default height and width, and so on. The UA may clamp the scale factor however it sees fit, or may round it to a desired increment if needed (for example, fitting the buffer dimensions to powers of two if that is known to increase performance.)\n \n ```js\n function setupWebGLLayer() {\n   return gl.setCompatibleXRDevice(xrDevice).then(() => {\n+    // Create a WebGL layer with a slightly lower than default resolution.\n     xrSession.baseLayer = new XRWebGLLayer(xrSession, gl, { framebufferScaleFactor: 0.8 });\n   });\n ```\n \n+In some cases the developer may want to ensure that their application is rendering at the 'native' size for the device. To do this the developer can query the scale factor that should be passed during layer creation with the `XRWebGLLayer.getNativeFramebufferScaleFactor()` function.","path":"explainer.md","position":null,"original_position":22,"commit_id":"0da333cde779f06050709b3e3c5a21cf90185f0e","original_commit_id":"cc6621f8d696343a28a51433b64df400396c8f83","user":{"login":"thetuvix","id":1209982,"avatar_url":"https://avatars3.githubusercontent.com/u/1209982?v=4","gravatar_id":"","url":"https://api.github.com/users/thetuvix","html_url":"https://github.com/thetuvix","followers_url":"https://api.github.com/users/thetuvix/followers","following_url":"https://api.github.com/users/thetuvix/following{/other_user}","gists_url":"https://api.github.com/users/thetuvix/gists{/gist_id}","starred_url":"https://api.github.com/users/thetuvix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thetuvix/subscriptions","organizations_url":"https://api.github.com/users/thetuvix/orgs","repos_url":"https://api.github.com/users/thetuvix/repos","events_url":"https://api.github.com/users/thetuvix/events{/privacy}","received_events_url":"https://api.github.com/users/thetuvix/received_events","type":"User","site_admin":false},"body":"Alternatively, we should consider what we expect apps to do with the native scale factor here.  Some compositors constrain the maximum buffer size an app can request on weaker GPUs, for example when the card does not have enough video memory to support a larger buffer.  That maximum buffer size is primarily a function of the GPU moreso than the headset display - depending on the GPU and headset, the maximum buffer size could end up bigger or smaller than the native buffer size.  As displays scale up, this will ensnare more powerful GPUs as well.\r\n\r\nTherefore, even if an app wants to render at native size regardless of the hit to render time, it still may not be able to on a given compositor and a given GPU.  We should confirm whether we have a strong enough motivation for getNativeFramebufferScaleFactor in WebXR 1.0 - with the rest of your change here, we can always add it in later if we find apps that both need it and can live with the limitations above.","created_at":"2018-05-15T18:54:09Z","updated_at":"2018-05-15T18:54:09Z","html_url":"https://github.com/immersive-web/webxr/pull/353#discussion_r188398656","pull_request_url":"https://api.github.com/repos/immersive-web/webxr/pulls/353","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/immersive-web/webxr/pulls/comments/188398656"},"html":{"href":"https://github.com/immersive-web/webxr/pull/353#discussion_r188398656"},"pull_request":{"href":"https://api.github.com/repos/immersive-web/webxr/pulls/353"}}},"pull_request":{"url":"https://api.github.com/repos/immersive-web/webxr/pulls/353","id":188013349,"html_url":"https://github.com/immersive-web/webxr/pull/353","diff_url":"https://github.com/immersive-web/webxr/pull/353.diff","patch_url":"https://github.com/immersive-web/webxr/pull/353.patch","issue_url":"https://api.github.com/repos/immersive-web/webxr/issues/353","number":353,"state":"open","locked":false,"title":"Change how framebufferScaleFactor is interpreted.","user":{"login":"toji","id":805273,"avatar_url":"https://avatars2.githubusercontent.com/u/805273?v=4","gravatar_id":"","url":"https://api.github.com/users/toji","html_url":"https://github.com/toji","followers_url":"https://api.github.com/users/toji/followers","following_url":"https://api.github.com/users/toji/following{/other_user}","gists_url":"https://api.github.com/users/toji/gists{/gist_id}","starred_url":"https://api.github.com/users/toji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toji/subscriptions","organizations_url":"https://api.github.com/users/toji/orgs","repos_url":"https://api.github.com/users/toji/repos","events_url":"https://api.github.com/users/toji/events{/privacy}","received_events_url":"https://api.github.com/users/toji/received_events","type":"User","site_admin":false},"body":"Addresses #349.\r\n\r\nChanges `framebufferScaleFactor` so that a value of 1.0 corresponds to the \"default\" framebuffer size and exposes a new static `XRWebGLLayer.getNativeFramebufferScaleFactor(xrSession)` function that reports the scale that should be used to get a 1:1 pixel ratio.","created_at":"2018-05-15T04:51:42Z","updated_at":"2018-05-15T18:54:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9674d94ef766327baba0ad322c91110ca8d42600","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/immersive-web/webxr/pulls/353/commits","review_comments_url":"https://api.github.com/repos/immersive-web/webxr/pulls/353/comments","review_comment_url":"https://api.github.com/repos/immersive-web/webxr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/immersive-web/webxr/issues/353/comments","statuses_url":"https://api.github.com/repos/immersive-web/webxr/statuses/0da333cde779f06050709b3e3c5a21cf90185f0e","head":{"label":"immersive-web:framebuffer-scale","ref":"framebuffer-scale","sha":"0da333cde779f06050709b3e3c5a21cf90185f0e","user":{"login":"immersive-web","id":34385910,"avatar_url":"https://avatars3.githubusercontent.com/u/34385910?v=4","gravatar_id":"","url":"https://api.github.com/users/immersive-web","html_url":"https://github.com/immersive-web","followers_url":"https://api.github.com/users/immersive-web/followers","following_url":"https://api.github.com/users/immersive-web/following{/other_user}","gists_url":"https://api.github.com/users/immersive-web/gists{/gist_id}","starred_url":"https://api.github.com/users/immersive-web/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immersive-web/subscriptions","organizations_url":"https://api.github.com/users/immersive-web/orgs","repos_url":"https://api.github.com/users/immersive-web/repos","events_url":"https://api.github.com/users/immersive-web/events{/privacy}","received_events_url":"https://api.github.com/users/immersive-web/received_events","type":"Organization","site_admin":false},"repo":{"id":53899485,"name":"webxr","full_name":"immersive-web/webxr","owner":{"login":"immersive-web","id":34385910,"avatar_url":"https://avatars3.githubusercontent.com/u/34385910?v=4","gravatar_id":"","url":"https://api.github.com/users/immersive-web","html_url":"https://github.com/immersive-web","followers_url":"https://api.github.com/users/immersive-web/followers","following_url":"https://api.github.com/users/immersive-web/following{/other_user}","gists_url":"https://api.github.com/users/immersive-web/gists{/gist_id}","starred_url":"https://api.github.com/users/immersive-web/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immersive-web/subscriptions","organizations_url":"https://api.github.com/users/immersive-web/orgs","repos_url":"https://api.github.com/users/immersive-web/repos","events_url":"https://api.github.com/users/immersive-web/events{/privacy}","received_events_url":"https://api.github.com/users/immersive-web/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/immersive-web/webxr","description":"Repository for the WebXR Device API Specification.","fork":false,"url":"https://api.github.com/repos/immersive-web/webxr","forks_url":"https://api.github.com/repos/immersive-web/webxr/forks","keys_url":"https://api.github.com/repos/immersive-web/webxr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/immersive-web/webxr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/immersive-web/webxr/teams","hooks_url":"https://api.github.com/repos/immersive-web/webxr/hooks","issue_events_url":"https://api.github.com/repos/immersive-web/webxr/issues/events{/number}","events_url":"https://api.github.com/repos/immersive-web/webxr/events","assignees_url":"https://api.github.com/repos/immersive-web/webxr/assignees{/user}","branches_url":"https://api.github.com/repos/immersive-web/webxr/branches{/branch}","tags_url":"https://api.github.com/repos/immersive-web/webxr/tags","blobs_url":"https://api.github.com/repos/immersive-web/webxr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/immersive-web/webxr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/immersive-web/webxr/git/refs{/sha}","trees_url":"https://api.github.com/repos/immersive-web/webxr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/immersive-web/webxr/statuses/{sha}","languages_url":"https://api.github.com/repos/immersive-web/webxr/languages","stargazers_url":"https://api.github.com/repos/immersive-web/webxr/stargazers","contributors_url":"https://api.github.com/repos/immersive-web/webxr/contributors","subscribers_url":"https://api.github.com/repos/immersive-web/webxr/subscribers","subscription_url":"https://api.github.com/repos/immersive-web/webxr/subscription","commits_url":"https://api.github.com/repos/immersive-web/webxr/commits{/sha}","git_commits_url":"https://api.github.com/repos/immersive-web/webxr/git/commits{/sha}","comments_url":"https://api.github.com/repos/immersive-web/webxr/comments{/number}","issue_comment_url":"https://api.github.com/repos/immersive-web/webxr/issues/comments{/number}","contents_url":"https://api.github.com/repos/immersive-web/webxr/contents/{+path}","compare_url":"https://api.github.com/repos/immersive-web/webxr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/immersive-web/webxr/merges","archive_url":"https://api.github.com/repos/immersive-web/webxr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/immersive-web/webxr/downloads","issues_url":"https://api.github.com/repos/immersive-web/webxr/issues{/number}","pulls_url":"https://api.github.com/repos/immersive-web/webxr/pulls{/number}","milestones_url":"https://api.github.com/repos/immersive-web/webxr/milestones{/number}","notifications_url":"https://api.github.com/repos/immersive-web/webxr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/immersive-web/webxr/labels{/name}","releases_url":"https://api.github.com/repos/immersive-web/webxr/releases{/id}","deployments_url":"https://api.github.com/repos/immersive-web/webxr/deployments","created_at":"2016-03-14T23:30:00Z","updated_at":"2018-05-15T16:08:36Z","pushed_at":"2018-05-15T17:31:19Z","git_url":"git://github.com/immersive-web/webxr.git","ssh_url":"git@github.com:immersive-web/webxr.git","clone_url":"https://github.com/immersive-web/webxr.git","svn_url":"https://github.com/immersive-web/webxr","homepage":"https://immersive-web.github.io/webxr/","size":1615,"stargazers_count":820,"watchers_count":820,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":124,"mirror_url":null,"archived":false,"open_issues_count":106,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":124,"open_issues":106,"watchers":820,"default_branch":"master"}},"base":{"label":"immersive-web:master","ref":"master","sha":"e25417e1885c6bc0d89250ca06082bd1d9dbf9f2","user":{"login":"immersive-web","id":34385910,"avatar_url":"https://avatars3.githubusercontent.com/u/34385910?v=4","gravatar_id":"","url":"https://api.github.com/users/immersive-web","html_url":"https://github.com/immersive-web","followers_url":"https://api.github.com/users/immersive-web/followers","following_url":"https://api.github.com/users/immersive-web/following{/other_user}","gists_url":"https://api.github.com/users/immersive-web/gists{/gist_id}","starred_url":"https://api.github.com/users/immersive-web/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immersive-web/subscriptions","organizations_url":"https://api.github.com/users/immersive-web/orgs","repos_url":"https://api.github.com/users/immersive-web/repos","events_url":"https://api.github.com/users/immersive-web/events{/privacy}","received_events_url":"https://api.github.com/users/immersive-web/received_events","type":"Organization","site_admin":false},"repo":{"id":53899485,"name":"webxr","full_name":"immersive-web/webxr","owner":{"login":"immersive-web","id":34385910,"avatar_url":"https://avatars3.githubusercontent.com/u/34385910?v=4","gravatar_id":"","url":"https://api.github.com/users/immersive-web","html_url":"https://github.com/immersive-web","followers_url":"https://api.github.com/users/immersive-web/followers","following_url":"https://api.github.com/users/immersive-web/following{/other_user}","gists_url":"https://api.github.com/users/immersive-web/gists{/gist_id}","starred_url":"https://api.github.com/users/immersive-web/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immersive-web/subscriptions","organizations_url":"https://api.github.com/users/immersive-web/orgs","repos_url":"https://api.github.com/users/immersive-web/repos","events_url":"https://api.github.com/users/immersive-web/events{/privacy}","received_events_url":"https://api.github.com/users/immersive-web/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/immersive-web/webxr","description":"Repository for the WebXR Device API Specification.","fork":false,"url":"https://api.github.com/repos/immersive-web/webxr","forks_url":"https://api.github.com/repos/immersive-web/webxr/forks","keys_url":"https://api.github.com/repos/immersive-web/webxr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/immersive-web/webxr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/immersive-web/webxr/teams","hooks_url":"https://api.github.com/repos/immersive-web/webxr/hooks","issue_events_url":"https://api.github.com/repos/immersive-web/webxr/issues/events{/number}","events_url":"https://api.github.com/repos/immersive-web/webxr/events","assignees_url":"https://api.github.com/repos/immersive-web/webxr/assignees{/user}","branches_url":"https://api.github.com/repos/immersive-web/webxr/branches{/branch}","tags_url":"https://api.github.com/repos/immersive-web/webxr/tags","blobs_url":"https://api.github.com/repos/immersive-web/webxr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/immersive-web/webxr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/immersive-web/webxr/git/refs{/sha}","trees_url":"https://api.github.com/repos/immersive-web/webxr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/immersive-web/webxr/statuses/{sha}","languages_url":"https://api.github.com/repos/immersive-web/webxr/languages","stargazers_url":"https://api.github.com/repos/immersive-web/webxr/stargazers","contributors_url":"https://api.github.com/repos/immersive-web/webxr/contributors","subscribers_url":"https://api.github.com/repos/immersive-web/webxr/subscribers","subscription_url":"https://api.github.com/repos/immersive-web/webxr/subscription","commits_url":"https://api.github.com/repos/immersive-web/webxr/commits{/sha}","git_commits_url":"https://api.github.com/repos/immersive-web/webxr/git/commits{/sha}","comments_url":"https://api.github.com/repos/immersive-web/webxr/comments{/number}","issue_comment_url":"https://api.github.com/repos/immersive-web/webxr/issues/comments{/number}","contents_url":"https://api.github.com/repos/immersive-web/webxr/contents/{+path}","compare_url":"https://api.github.com/repos/immersive-web/webxr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/immersive-web/webxr/merges","archive_url":"https://api.github.com/repos/immersive-web/webxr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/immersive-web/webxr/downloads","issues_url":"https://api.github.com/repos/immersive-web/webxr/issues{/number}","pulls_url":"https://api.github.com/repos/immersive-web/webxr/pulls{/number}","milestones_url":"https://api.github.com/repos/immersive-web/webxr/milestones{/number}","notifications_url":"https://api.github.com/repos/immersive-web/webxr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/immersive-web/webxr/labels{/name}","releases_url":"https://api.github.com/repos/immersive-web/webxr/releases{/id}","deployments_url":"https://api.github.com/repos/immersive-web/webxr/deployments","created_at":"2016-03-14T23:30:00Z","updated_at":"2018-05-15T16:08:36Z","pushed_at":"2018-05-15T17:31:19Z","git_url":"git://github.com/immersive-web/webxr.git","ssh_url":"git@github.com:immersive-web/webxr.git","clone_url":"https://github.com/immersive-web/webxr.git","svn_url":"https://github.com/immersive-web/webxr","homepage":"https://immersive-web.github.io/webxr/","size":1615,"stargazers_count":820,"watchers_count":820,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":124,"mirror_url":null,"archived":false,"open_issues_count":106,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":124,"open_issues":106,"watchers":820,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/immersive-web/webxr/pulls/353"},"html":{"href":"https://github.com/immersive-web/webxr/pull/353"},"issue":{"href":"https://api.github.com/repos/immersive-web/webxr/issues/353"},"comments":{"href":"https://api.github.com/repos/immersive-web/webxr/issues/353/comments"},"review_comments":{"href":"https://api.github.com/repos/immersive-web/webxr/pulls/353/comments"},"review_comment":{"href":"https://api.github.com/repos/immersive-web/webxr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/immersive-web/webxr/pulls/353/commits"},"statuses":{"href":"https://api.github.com/repos/immersive-web/webxr/statuses/0da333cde779f06050709b3e3c5a21cf90185f0e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"thetuvix"}}