super-three 0.173.0 → 0.173.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,6 +9,8 @@ import { CopyShader } from '../shaders/CopyShader.js';
|
|
|
9
9
|
import { ShaderPass } from './ShaderPass.js';
|
|
10
10
|
import { ClearMaskPass, MaskPass } from './MaskPass.js';
|
|
11
11
|
|
|
12
|
+
const size = /* @__PURE__ */ new Vector2();
|
|
13
|
+
|
|
12
14
|
class EffectComposer {
|
|
13
15
|
|
|
14
16
|
constructor( renderer, renderTarget ) {
|
|
@@ -19,7 +21,7 @@ class EffectComposer {
|
|
|
19
21
|
|
|
20
22
|
if ( renderTarget === undefined ) {
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
renderer.getSize( size );
|
|
23
25
|
this._width = size.width;
|
|
24
26
|
this._height = size.height;
|
|
25
27
|
|
|
@@ -48,6 +50,22 @@ class EffectComposer {
|
|
|
48
50
|
this.copyPass.material.blending = NoBlending;
|
|
49
51
|
|
|
50
52
|
this.clock = new Clock();
|
|
53
|
+
|
|
54
|
+
this.onSessionStateChange = this.onSessionStateChange.bind( this );
|
|
55
|
+
this.renderer.xr.addEventListener( 'sessionstart', this.onSessionStateChange );
|
|
56
|
+
this.renderer.xr.addEventListener( 'sessionend', this.onSessionStateChange );
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
onSessionStateChange() {
|
|
61
|
+
|
|
62
|
+
this.renderer.getSize( size );
|
|
63
|
+
this._width = size.width;
|
|
64
|
+
this._height = size.height;
|
|
65
|
+
|
|
66
|
+
this._pixelRatio = this.renderer.xr.isPresenting ? 1 : this.renderer.getPixelRatio();
|
|
67
|
+
|
|
68
|
+
this.setSize( this._width, this._height );
|
|
51
69
|
|
|
52
70
|
}
|
|
53
71
|
|
|
@@ -169,7 +187,7 @@ class EffectComposer {
|
|
|
169
187
|
|
|
170
188
|
if ( renderTarget === undefined ) {
|
|
171
189
|
|
|
172
|
-
|
|
190
|
+
this.renderer.getSize( size );
|
|
173
191
|
this._pixelRatio = this.renderer.getPixelRatio();
|
|
174
192
|
this._width = size.width;
|
|
175
193
|
this._height = size.height;
|
|
@@ -223,6 +241,9 @@ class EffectComposer {
|
|
|
223
241
|
|
|
224
242
|
this.copyPass.dispose();
|
|
225
243
|
|
|
244
|
+
this.renderer.xr.removeEventListener( 'sessionstart', this.onSessionStateChange );
|
|
245
|
+
this.renderer.xr.removeEventListener( 'sessionend', this.onSessionStateChange );
|
|
246
|
+
|
|
226
247
|
}
|
|
227
248
|
|
|
228
249
|
}
|
|
@@ -74,8 +74,13 @@ class FullScreenQuad {
|
|
|
74
74
|
|
|
75
75
|
render( renderer ) {
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
// Disable XR projection for fullscreen effects
|
|
78
|
+
// https://github.com/mrdoob/three.js/pull/18846
|
|
79
|
+
const xrEnabled = renderer.xr.enabled;
|
|
78
80
|
|
|
81
|
+
renderer.xr.enabled = false;
|
|
82
|
+
renderer.render( this._mesh, _camera );
|
|
83
|
+
renderer.xr.enabled = xrEnabled;
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
get material() {
|
package/package.json
CHANGED
|
@@ -1580,7 +1580,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
1580
1580
|
|
|
1581
1581
|
}
|
|
1582
1582
|
|
|
1583
|
-
} else if ( renderTarget.depthBuffer
|
|
1583
|
+
} else if ( renderTarget.depthBuffer ) {
|
|
1584
1584
|
|
|
1585
1585
|
// retrieve the depth attachment types
|
|
1586
1586
|
const depthTexture = renderTarget.depthTexture;
|
|
@@ -1670,7 +1670,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
1670
1670
|
|
|
1671
1671
|
}
|
|
1672
1672
|
|
|
1673
|
-
setTexture2D( renderTarget.depthTexture, 0 );
|
|
1674
1673
|
if ( renderTarget.depthTexture.image.depth != 1 ) {
|
|
1675
1674
|
|
|
1676
1675
|
setTexture2DArray( renderTarget.depthTexture, 0 );
|