|
309 | 309 | };
|
310 | 310 |
|
311 | 311 | // bindFramebuffer frameBufferObject null in XRSession should use XRWebGLLayer FBO instead
|
312 |
| - this.ctx.bindFramebuffer = (oldBindFramebuffer => function bindFramebuffer(target, fbo) { |
| 312 | + /*this.ctx.bindFramebuffer = (oldBindFramebuffer => function bindFramebuffer(target, fbo) { |
313 | 313 | if (!fbo) {
|
314 | 314 | if (thisXRMananger.arSession && thisXRMananger.arSession.isInSession) {
|
315 | 315 | if (thisXRMananger.arSession.renderState.baseLayer) {
|
|
325 | 325 | }
|
326 | 326 | }
|
327 | 327 | return oldBindFramebuffer.call(this, target, fbo);
|
328 |
| - })(this.ctx.bindFramebuffer); |
| 328 | + })(this.ctx.bindFramebuffer);*/ |
329 | 329 | }
|
330 | 330 | }
|
331 | 331 |
|
|
532 | 532 | var onSessionEnded = this.onEndSession.bind(this);
|
533 | 533 | session.addEventListener('end', onSessionEnded);
|
534 | 534 |
|
535 |
| - this.canvas.width = glLayer.framebufferWidth * 2; |
| 535 | + this.canvas.width = glLayer.framebufferWidth; |
536 | 536 | this.canvas.height = glLayer.framebufferHeight;
|
537 | 537 |
|
538 | 538 | session.addEventListener('select', this.onInputEvent);
|
|
561 | 561 |
|
562 | 562 | let glLayer = session.renderState.baseLayer;
|
563 | 563 |
|
564 |
| - if (this.canvas.width != glLayer.framebufferWidth * 2 || |
| 564 | + if (this.canvas.width != glLayer.framebufferWidth || |
565 | 565 | this.canvas.height != glLayer.framebufferHeight)
|
566 | 566 | {
|
567 |
| - this.canvas.width = glLayer.framebufferWidth * 2; |
| 567 | + this.canvas.width = glLayer.framebufferWidth; |
568 | 568 | this.canvas.height = glLayer.framebufferHeight;
|
569 | 569 | }
|
570 | 570 |
|
|
629 | 629 | let leftRect = {
|
630 | 630 | x:0,
|
631 | 631 | y:0,
|
632 |
| - w:0.5, |
| 632 | + w:1, |
633 | 633 | h:1
|
634 | 634 | }
|
635 | 635 | let rightRect = {
|
|
641 | 641 | for (let view of pose.views) {
|
642 | 642 | let viewport = session.renderState.baseLayer.getViewport(view);
|
643 | 643 | if (view.eye === 'left') {
|
644 |
| - /*if (viewport) { |
| 644 | + if (viewport) { |
645 | 645 | leftRect.x = viewport.x / glLayer.framebufferWidth;
|
646 | 646 | leftRect.y = viewport.y / glLayer.framebufferHeight;
|
647 | 647 | leftRect.w = viewport.width / glLayer.framebufferWidth;
|
648 | 648 | leftRect.h = viewport.height / glLayer.framebufferHeight;
|
649 |
| - }*/ |
| 649 | + } |
650 | 650 | } else if (view.eye === 'right') {
|
651 | 651 | eyeCount = 2;
|
652 |
| - /*if (viewport) { |
| 652 | + if (viewport) { |
653 | 653 | rightRect.x = viewport.x / glLayer.framebufferWidth;
|
654 | 654 | rightRect.y = viewport.y / glLayer.framebufferHeight;
|
655 | 655 | rightRect.w = viewport.width / glLayer.framebufferWidth;
|
656 | 656 | rightRect.h = viewport.height / glLayer.framebufferHeight;
|
657 |
| - }*/ |
| 657 | + } |
658 | 658 | }
|
659 | 659 | }
|
660 | 660 | this.gameInstance.Module.WebXR.OnStartAR(eyeCount, leftRect, rightRect);
|
|
0 commit comments