mirror of
https://github.com/phit/video2webxr.git
synced 2026-10-17 13:01:16 +02:00
fix: antialias the headset's image
three.js passes the renderer's antialias setting on to the XR layer, so this turns on multisampling in VR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca98a5ed16
commit
0d0a2b33ba
1 file changed
+3
-2
+3
-2
@@ -184,7 +184,6 @@ function eacStereoMeshes(material) {
|
||||
// screen group, 3m in front of the viewer to start with.
|
||||
const SCREEN_DISTANCE = 3;
|
||||
const BACKGROUND = 0x101010;
|
||||
|
||||
function flatScreenMesh(material) {
|
||||
const video = material.map.image;
|
||||
const aspect = video.videoWidth && video.videoHeight ? video.videoWidth / video.videoHeight : 16 / 9;
|
||||
@@ -233,7 +232,9 @@ export class VRPlayer {
|
||||
this.onVideoResize = () => this.setProjection(this.projection);
|
||||
video.addEventListener('resize', this.onVideoResize);
|
||||
|
||||
this.renderer = new THREE.WebGLRenderer();
|
||||
// antialias also turns on multisampling for the headset's image (three.js passes it on
|
||||
// to the XR layer), which smooths the edges of the screen, panel and lasers
|
||||
this.renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
this.renderer.setPixelRatio(window.devicePixelRatio);
|
||||
this.renderer.setSize(window.innerWidth, window.innerHeight);
|
||||
this.renderer.xr.enabled = true;
|
||||
|
||||
Reference in new issue
Block a user