super-three 0.173.2 → 0.173.3
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.
- package/build/three.cjs +64 -577
- package/build/three.core.js +0 -15
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +65 -563
- package/build/three.module.min.js +1 -1
- package/package.json +1 -1
package/build/three.cjs
CHANGED
|
@@ -29857,21 +29857,6 @@ class ObjectLoader extends Loader {
|
|
|
29857
29857
|
geometry = bufferGeometryLoader.parse( data );
|
|
29858
29858
|
break;
|
|
29859
29859
|
|
|
29860
|
-
case 'Geometry':
|
|
29861
|
-
|
|
29862
|
-
if ( 'THREE' in window && 'LegacyJSONLoader' in THREE ) {
|
|
29863
|
-
|
|
29864
|
-
var geometryLoader = new THREE.LegacyJSONLoader();
|
|
29865
|
-
geometry = geometryLoader.parse( data, this.resourcePath ).geometry;
|
|
29866
|
-
|
|
29867
|
-
|
|
29868
|
-
} else {
|
|
29869
|
-
|
|
29870
|
-
console.error( 'THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".' );
|
|
29871
|
-
|
|
29872
|
-
}
|
|
29873
|
-
break;
|
|
29874
|
-
|
|
29875
29860
|
default:
|
|
29876
29861
|
|
|
29877
29862
|
if ( data.type in Geometries ) {
|
|
@@ -38807,7 +38792,7 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
|
|
|
38807
38792
|
if ( boxMesh === undefined ) {
|
|
38808
38793
|
|
|
38809
38794
|
boxMesh = new Mesh(
|
|
38810
|
-
new BoxGeometry(
|
|
38795
|
+
new BoxGeometry( 1, 1, 1 ),
|
|
38811
38796
|
new ShaderMaterial( {
|
|
38812
38797
|
name: 'BackgroundCubeMaterial',
|
|
38813
38798
|
uniforms: cloneUniforms( ShaderLib.backgroundCube.uniforms ),
|
|
@@ -41718,103 +41703,6 @@ function WebGLMorphtargets( gl, capabilities, textures ) {
|
|
|
41718
41703
|
|
|
41719
41704
|
}
|
|
41720
41705
|
|
|
41721
|
-
/**
|
|
41722
|
-
* @author fernandojsg / http://fernandojsg.com
|
|
41723
|
-
* @author Takahiro https://github.com/takahirox
|
|
41724
|
-
*/
|
|
41725
|
-
|
|
41726
|
-
class WebGLMultiview {
|
|
41727
|
-
|
|
41728
|
-
constructor( renderer, extensions, gl ) {
|
|
41729
|
-
|
|
41730
|
-
this.renderer = renderer;
|
|
41731
|
-
|
|
41732
|
-
this.DEFAULT_NUMVIEWS = 2;
|
|
41733
|
-
this.maxNumViews = 0;
|
|
41734
|
-
this.gl = gl;
|
|
41735
|
-
|
|
41736
|
-
this.extensions = extensions;
|
|
41737
|
-
|
|
41738
|
-
this.available = this.extensions.has( 'OCULUS_multiview' );
|
|
41739
|
-
|
|
41740
|
-
if ( this.available ) {
|
|
41741
|
-
|
|
41742
|
-
const extension = this.extensions.get( 'OCULUS_multiview' );
|
|
41743
|
-
|
|
41744
|
-
this.maxNumViews = this.gl.getParameter( extension.MAX_VIEWS_OVR );
|
|
41745
|
-
|
|
41746
|
-
this.mat4 = [];
|
|
41747
|
-
this.mat3 = [];
|
|
41748
|
-
this.cameraArray = [];
|
|
41749
|
-
|
|
41750
|
-
for ( var i = 0; i < this.maxNumViews; i ++ ) {
|
|
41751
|
-
|
|
41752
|
-
this.mat4[ i ] = new Matrix4();
|
|
41753
|
-
this.mat3[ i ] = new Matrix3();
|
|
41754
|
-
|
|
41755
|
-
}
|
|
41756
|
-
|
|
41757
|
-
}
|
|
41758
|
-
|
|
41759
|
-
}
|
|
41760
|
-
|
|
41761
|
-
//
|
|
41762
|
-
getCameraArray( camera ) {
|
|
41763
|
-
|
|
41764
|
-
if ( camera.isArrayCamera ) return camera.cameras;
|
|
41765
|
-
|
|
41766
|
-
this.cameraArray[ 0 ] = camera;
|
|
41767
|
-
|
|
41768
|
-
return this.cameraArray;
|
|
41769
|
-
|
|
41770
|
-
}
|
|
41771
|
-
|
|
41772
|
-
updateCameraProjectionMatricesUniform( camera, uniforms ) {
|
|
41773
|
-
|
|
41774
|
-
var cameras = this.getCameraArray( camera );
|
|
41775
|
-
|
|
41776
|
-
for ( var i = 0; i < cameras.length; i ++ ) {
|
|
41777
|
-
|
|
41778
|
-
this.mat4[ i ].copy( cameras[ i ].projectionMatrix );
|
|
41779
|
-
|
|
41780
|
-
}
|
|
41781
|
-
|
|
41782
|
-
uniforms.setValue( this.gl, 'projectionMatrices', this.mat4 );
|
|
41783
|
-
|
|
41784
|
-
}
|
|
41785
|
-
|
|
41786
|
-
updateCameraViewMatricesUniform( camera, uniforms ) {
|
|
41787
|
-
|
|
41788
|
-
var cameras = this.getCameraArray( camera );
|
|
41789
|
-
|
|
41790
|
-
for ( var i = 0; i < cameras.length; i ++ ) {
|
|
41791
|
-
|
|
41792
|
-
this.mat4[ i ].copy( cameras[ i ].matrixWorldInverse );
|
|
41793
|
-
|
|
41794
|
-
}
|
|
41795
|
-
|
|
41796
|
-
uniforms.setValue( this.gl, 'viewMatrices', this.mat4 );
|
|
41797
|
-
|
|
41798
|
-
}
|
|
41799
|
-
|
|
41800
|
-
updateObjectMatricesUniforms( object, camera, uniforms ) {
|
|
41801
|
-
|
|
41802
|
-
var cameras = this.getCameraArray( camera );
|
|
41803
|
-
|
|
41804
|
-
for ( var i = 0; i < cameras.length; i ++ ) {
|
|
41805
|
-
|
|
41806
|
-
this.mat4[ i ].multiplyMatrices( cameras[ i ].matrixWorldInverse, object.matrixWorld );
|
|
41807
|
-
this.mat3[ i ].getNormalMatrix( this.mat4[ i ] );
|
|
41808
|
-
|
|
41809
|
-
}
|
|
41810
|
-
|
|
41811
|
-
uniforms.setValue( this.gl, 'modelViewMatrices', this.mat4 );
|
|
41812
|
-
uniforms.setValue( this.gl, 'normalMatrices', this.mat3 );
|
|
41813
|
-
|
|
41814
|
-
}
|
|
41815
|
-
|
|
41816
|
-
}
|
|
41817
|
-
|
|
41818
41706
|
function WebGLObjects( gl, geometries, attributes, info ) {
|
|
41819
41707
|
|
|
41820
41708
|
let updateMap = new WeakMap();
|
|
@@ -43566,8 +43454,6 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
43566
43454
|
let prefixVertex, prefixFragment;
|
|
43567
43455
|
let versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + '\n' : '';
|
|
43568
43456
|
|
|
43569
|
-
const numMultiviewViews = parameters.numMultiviewViews;
|
|
43570
|
-
|
|
43571
43457
|
if ( parameters.isRawShaderMaterial ) {
|
|
43572
43458
|
|
|
43573
43459
|
prefixVertex = [
|
|
@@ -43955,53 +43841,6 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
43955
43841
|
'#define textureCubeGradEXT textureGrad'
|
|
43956
43842
|
].join( '\n' ) + '\n' + prefixFragment;
|
|
43957
43843
|
|
|
43958
|
-
// Multiview
|
|
43959
|
-
|
|
43960
|
-
if ( numMultiviewViews > 0 ) {
|
|
43961
|
-
|
|
43962
|
-
// TODO: fix light transforms here?
|
|
43963
|
-
|
|
43964
|
-
prefixVertex = [
|
|
43965
|
-
'#extension GL_OVR_multiview : require',
|
|
43966
|
-
'layout(num_views = ' + numMultiviewViews + ') in;',
|
|
43967
|
-
'#define VIEW_ID gl_ViewID_OVR'
|
|
43968
|
-
].join( '\n' ) + '\n' + prefixVertex;
|
|
43969
|
-
|
|
43970
|
-
prefixVertex = prefixVertex.replace(
|
|
43971
|
-
[
|
|
43972
|
-
'uniform mat4 modelViewMatrix;',
|
|
43973
|
-
'uniform mat4 projectionMatrix;',
|
|
43974
|
-
'uniform mat4 viewMatrix;',
|
|
43975
|
-
'uniform mat3 normalMatrix;'
|
|
43976
|
-
].join( '\n' ),
|
|
43977
|
-
[
|
|
43978
|
-
'uniform mat4 modelViewMatrices[' + numMultiviewViews + '];',
|
|
43979
|
-
'uniform mat4 projectionMatrices[' + numMultiviewViews + '];',
|
|
43980
|
-
'uniform mat4 viewMatrices[' + numMultiviewViews + '];',
|
|
43981
|
-
'uniform mat3 normalMatrices[' + numMultiviewViews + '];',
|
|
43982
|
-
|
|
43983
|
-
'#define modelViewMatrix modelViewMatrices[VIEW_ID]',
|
|
43984
|
-
'#define projectionMatrix projectionMatrices[VIEW_ID]',
|
|
43985
|
-
'#define viewMatrix viewMatrices[VIEW_ID]',
|
|
43986
|
-
'#define normalMatrix normalMatrices[VIEW_ID]'
|
|
43987
|
-
].join( '\n' )
|
|
43988
|
-
);
|
|
43989
|
-
|
|
43990
|
-
prefixFragment = [
|
|
43991
|
-
'#extension GL_OVR_multiview : require',
|
|
43992
|
-
'#define VIEW_ID gl_ViewID_OVR'
|
|
43993
|
-
].join( '\n' ) + '\n' + prefixFragment;
|
|
43994
|
-
|
|
43995
|
-
prefixFragment = prefixFragment.replace(
|
|
43996
|
-
'uniform mat4 viewMatrix;',
|
|
43997
|
-
[
|
|
43998
|
-
'uniform mat4 viewMatrices[' + numMultiviewViews + '];',
|
|
43999
|
-
'#define viewMatrix viewMatrices[VIEW_ID]'
|
|
44000
|
-
].join( '\n' )
|
|
44001
|
-
);
|
|
44002
|
-
|
|
44003
|
-
}
|
|
44004
|
-
|
|
44005
43844
|
}
|
|
44006
43845
|
|
|
44007
43846
|
const vertexGlsl = versionString + prefixVertex + vertexShader;
|
|
@@ -44194,7 +44033,6 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
44194
44033
|
this.program = program;
|
|
44195
44034
|
this.vertexShader = glVertexShader;
|
|
44196
44035
|
this.fragmentShader = glFragmentShader;
|
|
44197
|
-
this.numMultiviewViews = numMultiviewViews;
|
|
44198
44036
|
|
|
44199
44037
|
return this;
|
|
44200
44038
|
|
|
@@ -44427,8 +44265,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
44427
44265
|
const currentRenderTarget = renderer.getRenderTarget();
|
|
44428
44266
|
const reverseDepthBuffer = renderer.state.buffers.depth.getReversed();
|
|
44429
44267
|
|
|
44430
|
-
const numMultiviewViews = currentRenderTarget && currentRenderTarget.isWebGLMultiviewRenderTarget ? currentRenderTarget.numViews : 0;
|
|
44431
|
-
|
|
44432
44268
|
const IS_INSTANCEDMESH = object.isInstancedMesh === true;
|
|
44433
44269
|
const IS_BATCHEDMESH = object.isBatchedMesh === true;
|
|
44434
44270
|
|
|
@@ -44518,7 +44354,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
44518
44354
|
instancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,
|
|
44519
44355
|
|
|
44520
44356
|
supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
|
|
44521
|
-
numMultiviewViews: numMultiviewViews,
|
|
44522
44357
|
outputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace ),
|
|
44523
44358
|
alphaToCoverage: !! material.alphaToCoverage,
|
|
44524
44359
|
|
|
@@ -44883,8 +44718,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
44883
44718
|
_programLayers.enable( 20 );
|
|
44884
44719
|
if ( parameters.alphaToCoverage )
|
|
44885
44720
|
_programLayers.enable( 21 );
|
|
44886
|
-
if ( parameters.numMultiviewViews )
|
|
44887
|
-
_programLayers.enable( 21 );
|
|
44888
44721
|
|
|
44889
44722
|
array.push( _programLayers.mask );
|
|
44890
44723
|
|
|
@@ -47682,7 +47515,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
47682
47515
|
|
|
47683
47516
|
const multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null;
|
|
47684
47517
|
const supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );
|
|
47685
|
-
const multiviewExt = extensions.has( 'OCULUS_multiview' ) ? extensions.get( 'OCULUS_multiview' ) : null;
|
|
47686
47518
|
|
|
47687
47519
|
const _imageDimensions = new Vector2();
|
|
47688
47520
|
const _videoTextures = new WeakMap();
|
|
@@ -47690,9 +47522,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
47690
47522
|
|
|
47691
47523
|
const _sources = new WeakMap(); // maps WebglTexture objects to instances of Source
|
|
47692
47524
|
|
|
47693
|
-
let _deferredUploads = [];
|
|
47694
|
-
let _deferTextureUploads = false;
|
|
47695
|
-
|
|
47696
47525
|
// cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas,
|
|
47697
47526
|
// also OffscreenCanvas.getContext("webgl"), but not OffscreenCanvas.getContext("2d")!
|
|
47698
47527
|
// Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d).
|
|
@@ -48207,11 +48036,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
48207
48036
|
|
|
48208
48037
|
} else {
|
|
48209
48038
|
|
|
48210
|
-
|
|
48211
|
-
|
|
48212
|
-
return;
|
|
48213
|
-
|
|
48214
|
-
}
|
|
48039
|
+
uploadTexture( textureProperties, texture, slot );
|
|
48040
|
+
return;
|
|
48215
48041
|
|
|
48216
48042
|
}
|
|
48217
48043
|
|
|
@@ -48420,45 +48246,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
48420
48246
|
|
|
48421
48247
|
}
|
|
48422
48248
|
|
|
48423
|
-
function setDeferTextureUploads( deferFlag ) {
|
|
48424
|
-
|
|
48425
|
-
_deferTextureUploads = deferFlag;
|
|
48426
|
-
|
|
48427
|
-
}
|
|
48428
|
-
|
|
48429
|
-
function runDeferredUploads() {
|
|
48430
|
-
|
|
48431
|
-
const previousDeferSetting = _deferTextureUploads;
|
|
48432
|
-
_deferTextureUploads = false;
|
|
48433
|
-
|
|
48434
|
-
for ( const upload of _deferredUploads ) {
|
|
48435
|
-
|
|
48436
|
-
uploadTexture( upload.textureProperties, upload.texture, upload.slot );
|
|
48437
|
-
upload.texture.isPendingDeferredUpload = false;
|
|
48438
|
-
|
|
48439
|
-
}
|
|
48440
|
-
|
|
48441
|
-
_deferredUploads = [];
|
|
48442
|
-
|
|
48443
|
-
_deferTextureUploads = previousDeferSetting;
|
|
48444
|
-
|
|
48445
|
-
}
|
|
48446
|
-
|
|
48447
48249
|
function uploadTexture( textureProperties, texture, slot ) {
|
|
48448
48250
|
|
|
48449
|
-
if ( _deferTextureUploads ) {
|
|
48450
|
-
|
|
48451
|
-
if ( ! texture.isPendingDeferredUpload ) {
|
|
48452
|
-
|
|
48453
|
-
texture.isPendingDeferredUpload = true;
|
|
48454
|
-
_deferredUploads.push( { textureProperties: textureProperties, texture: texture, slot: slot } );
|
|
48455
|
-
|
|
48456
|
-
}
|
|
48457
|
-
|
|
48458
|
-
return false;
|
|
48459
|
-
|
|
48460
|
-
}
|
|
48461
|
-
|
|
48462
48251
|
let textureType = _gl.TEXTURE_2D;
|
|
48463
48252
|
|
|
48464
48253
|
if ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) textureType = _gl.TEXTURE_2D_ARRAY;
|
|
@@ -48888,7 +48677,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
48888
48677
|
}
|
|
48889
48678
|
|
|
48890
48679
|
textureProperties.__version = texture.version;
|
|
48891
|
-
return true;
|
|
48892
48680
|
|
|
48893
48681
|
}
|
|
48894
48682
|
|
|
@@ -49147,11 +48935,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
49147
48935
|
const width = Math.max( 1, renderTarget.width >> level );
|
|
49148
48936
|
const height = Math.max( 1, renderTarget.height >> level );
|
|
49149
48937
|
|
|
49150
|
-
if (
|
|
49151
|
-
|
|
49152
|
-
state.texStorage3D( _gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.numViews );
|
|
49153
|
-
|
|
49154
|
-
} else if ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) {
|
|
48938
|
+
if ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) {
|
|
49155
48939
|
|
|
49156
48940
|
state.texImage3D( textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null );
|
|
49157
48941
|
|
|
@@ -49165,31 +48949,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
49165
48949
|
|
|
49166
48950
|
state.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
|
|
49167
48951
|
|
|
49168
|
-
|
|
49169
|
-
|
|
49170
|
-
if ( renderTarget.isWebGLMultiviewRenderTarget === true ) {
|
|
49171
|
-
|
|
49172
|
-
if ( multisampled ) {
|
|
48952
|
+
if ( useMultisampledRTT( renderTarget ) ) {
|
|
49173
48953
|
|
|
49174
|
-
|
|
49175
|
-
|
|
49176
|
-
} else {
|
|
49177
|
-
|
|
49178
|
-
multiviewExt.framebufferTextureMultiviewOVR( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, 0, 0, renderTarget.numViews );
|
|
49179
|
-
|
|
49180
|
-
}
|
|
48954
|
+
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, 0, getRenderTargetSamples( renderTarget ) );
|
|
49181
48955
|
|
|
49182
48956
|
} else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753
|
|
49183
48957
|
|
|
49184
|
-
|
|
49185
|
-
|
|
49186
|
-
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, 0, getRenderTargetSamples( renderTarget ) );
|
|
49187
|
-
|
|
49188
|
-
} else {
|
|
49189
|
-
|
|
49190
|
-
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, level );
|
|
49191
|
-
|
|
49192
|
-
}
|
|
48958
|
+
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, level );
|
|
49193
48959
|
|
|
49194
48960
|
}
|
|
49195
48961
|
|
|
@@ -49202,59 +48968,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
49202
48968
|
|
|
49203
48969
|
_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );
|
|
49204
48970
|
|
|
49205
|
-
if ( renderTarget.
|
|
49206
|
-
|
|
49207
|
-
const useMultisample = useMultisampledRTT( renderTarget );
|
|
49208
|
-
const numViews = renderTarget.numViews;
|
|
49209
|
-
|
|
49210
|
-
const depthTexture = renderTarget.depthTexture;
|
|
49211
|
-
let glInternalFormat = _gl.DEPTH_COMPONENT24;
|
|
49212
|
-
let glDepthAttachment = _gl.DEPTH_ATTACHMENT;
|
|
49213
|
-
|
|
49214
|
-
if ( depthTexture && depthTexture.isDepthTexture ) {
|
|
49215
|
-
|
|
49216
|
-
if ( depthTexture.type === FloatType ) {
|
|
49217
|
-
|
|
49218
|
-
glInternalFormat = _gl.DEPTH_COMPONENT32F;
|
|
49219
|
-
|
|
49220
|
-
} else if ( depthTexture.type === UnsignedInt248Type ) {
|
|
49221
|
-
|
|
49222
|
-
glInternalFormat = _gl.DEPTH24_STENCIL8;
|
|
49223
|
-
glDepthAttachment = _gl.DEPTH_STENCIL_ATTACHMENT;
|
|
49224
|
-
|
|
49225
|
-
}
|
|
49226
|
-
|
|
49227
|
-
// we're defaulting to _gl.DEPTH_COMPONENT24 so don't assign here
|
|
49228
|
-
// or else DeepScan will complain
|
|
49229
|
-
|
|
49230
|
-
// else if ( depthTexture.type === UnsignedIntType ) {
|
|
49231
|
-
|
|
49232
|
-
// glInternalFormat = _gl.DEPTH_COMPONENT24;
|
|
49233
|
-
|
|
49234
|
-
// }
|
|
49235
|
-
|
|
49236
|
-
}
|
|
49237
|
-
|
|
49238
|
-
let depthStencilTexture = properties.get( renderTarget.depthTexture ).__webglTexture;
|
|
49239
|
-
if ( depthStencilTexture === undefined ) {
|
|
49240
|
-
|
|
49241
|
-
depthStencilTexture = _gl.createTexture();
|
|
49242
|
-
_gl.bindTexture( _gl.TEXTURE_2D_ARRAY, depthStencilTexture );
|
|
49243
|
-
_gl.texStorage3D( _gl.TEXTURE_2D_ARRAY, 1, glInternalFormat, renderTarget.width, renderTarget.height, numViews );
|
|
49244
|
-
|
|
49245
|
-
}
|
|
49246
|
-
|
|
49247
|
-
if ( useMultisample ) {
|
|
49248
|
-
|
|
49249
|
-
multiviewExt.framebufferTextureMultisampleMultiviewOVR( _gl.FRAMEBUFFER, glDepthAttachment, depthStencilTexture, 0, getRenderTargetSamples( renderTarget ), 0, numViews );
|
|
49250
|
-
|
|
49251
|
-
} else {
|
|
49252
|
-
|
|
49253
|
-
multiviewExt.framebufferTextureMultiviewOVR( _gl.FRAMEBUFFER, glDepthAttachment, depthStencilTexture, 0, 0, numViews );
|
|
49254
|
-
|
|
49255
|
-
}
|
|
49256
|
-
|
|
49257
|
-
} else if ( renderTarget.depthBuffer ) {
|
|
48971
|
+
if ( renderTarget.depthBuffer ) {
|
|
49258
48972
|
|
|
49259
48973
|
// retrieve the depth attachment types
|
|
49260
48974
|
const depthTexture = renderTarget.depthTexture;
|
|
@@ -49344,85 +49058,38 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
49344
49058
|
|
|
49345
49059
|
}
|
|
49346
49060
|
|
|
49347
|
-
|
|
49348
|
-
|
|
49349
|
-
setTexture2DArray( renderTarget.depthTexture, 0 );
|
|
49350
|
-
|
|
49351
|
-
} else {
|
|
49352
|
-
|
|
49353
|
-
setTexture2D( renderTarget.depthTexture, 0 );
|
|
49354
|
-
|
|
49355
|
-
}
|
|
49061
|
+
setTexture2D( renderTarget.depthTexture, 0 );
|
|
49356
49062
|
|
|
49357
49063
|
const webglDepthTexture = textureProperties.__webglTexture;
|
|
49358
49064
|
const samples = getRenderTargetSamples( renderTarget );
|
|
49359
49065
|
|
|
49360
|
-
if ( renderTarget.
|
|
49361
|
-
|
|
49362
|
-
const useMultisample = useMultisampledRTT( renderTarget );
|
|
49363
|
-
const numViews = renderTarget.numViews;
|
|
49364
|
-
|
|
49365
|
-
if ( renderTarget.depthTexture.format === DepthFormat ) {
|
|
49366
|
-
|
|
49367
|
-
if ( useMultisample ) {
|
|
49368
|
-
|
|
49369
|
-
multiviewExt.framebufferTextureMultisampleMultiviewOVR( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, webglDepthTexture, 0, samples, 0, numViews );
|
|
49370
|
-
|
|
49371
|
-
} else {
|
|
49066
|
+
if ( renderTarget.depthTexture.format === DepthFormat ) {
|
|
49372
49067
|
|
|
49373
|
-
|
|
49068
|
+
if ( useMultisampledRTT( renderTarget ) ) {
|
|
49374
49069
|
|
|
49375
|
-
|
|
49070
|
+
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );
|
|
49376
49071
|
|
|
49377
|
-
} else
|
|
49072
|
+
} else {
|
|
49378
49073
|
|
|
49379
|
-
|
|
49074
|
+
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );
|
|
49380
49075
|
|
|
49381
|
-
|
|
49076
|
+
}
|
|
49382
49077
|
|
|
49383
|
-
|
|
49078
|
+
} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {
|
|
49384
49079
|
|
|
49385
|
-
|
|
49080
|
+
if ( useMultisampledRTT( renderTarget ) ) {
|
|
49386
49081
|
|
|
49387
|
-
|
|
49082
|
+
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );
|
|
49388
49083
|
|
|
49389
49084
|
} else {
|
|
49390
49085
|
|
|
49391
|
-
|
|
49086
|
+
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );
|
|
49392
49087
|
|
|
49393
49088
|
}
|
|
49394
49089
|
|
|
49395
49090
|
} else {
|
|
49396
49091
|
|
|
49397
|
-
|
|
49398
|
-
|
|
49399
|
-
if ( useMultisampledRTT( renderTarget ) ) {
|
|
49400
|
-
|
|
49401
|
-
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );
|
|
49402
|
-
|
|
49403
|
-
} else {
|
|
49404
|
-
|
|
49405
|
-
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );
|
|
49406
|
-
|
|
49407
|
-
}
|
|
49408
|
-
|
|
49409
|
-
} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {
|
|
49410
|
-
|
|
49411
|
-
if ( useMultisampledRTT( renderTarget ) ) {
|
|
49412
|
-
|
|
49413
|
-
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );
|
|
49414
|
-
|
|
49415
|
-
} else {
|
|
49416
|
-
|
|
49417
|
-
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );
|
|
49418
|
-
|
|
49419
|
-
}
|
|
49420
|
-
|
|
49421
|
-
} else {
|
|
49422
|
-
|
|
49423
|
-
throw new Error( 'Unknown depthTexture format' );
|
|
49424
|
-
|
|
49425
|
-
}
|
|
49092
|
+
throw new Error( 'Unknown depthTexture format' );
|
|
49426
49093
|
|
|
49427
49094
|
}
|
|
49428
49095
|
|
|
@@ -49737,12 +49404,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
49737
49404
|
|
|
49738
49405
|
}
|
|
49739
49406
|
|
|
49740
|
-
if ( renderTarget.isWebGLMultiviewRenderTarget === true ) {
|
|
49741
|
-
|
|
49742
|
-
glTextureType = _gl.TEXTURE_2D_ARRAY;
|
|
49743
|
-
|
|
49744
|
-
}
|
|
49745
|
-
|
|
49746
49407
|
state.bindTexture( glTextureType, textureProperties.__webglTexture );
|
|
49747
49408
|
setTextureParameters( glTextureType, texture );
|
|
49748
49409
|
|
|
@@ -49772,9 +49433,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
49772
49433
|
|
|
49773
49434
|
// Setup depth and stencil buffers
|
|
49774
49435
|
|
|
49775
|
-
if ( renderTarget.depthBuffer
|
|
49436
|
+
if ( renderTarget.depthBuffer ) {
|
|
49776
49437
|
|
|
49777
|
-
|
|
49438
|
+
setupDepthRenderbuffer( renderTarget );
|
|
49778
49439
|
|
|
49779
49440
|
}
|
|
49780
49441
|
|
|
@@ -50019,16 +49680,12 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
50019
49680
|
this.setTexture3D = setTexture3D;
|
|
50020
49681
|
this.setTextureCube = setTextureCube;
|
|
50021
49682
|
this.rebindTextures = rebindTextures;
|
|
50022
|
-
this.uploadTexture = uploadTexture;
|
|
50023
49683
|
this.setupRenderTarget = setupRenderTarget;
|
|
50024
49684
|
this.updateRenderTargetMipmap = updateRenderTargetMipmap;
|
|
50025
49685
|
this.updateMultisampleRenderTarget = updateMultisampleRenderTarget;
|
|
50026
|
-
this.setupDepthTexture = setupDepthTexture;
|
|
50027
49686
|
this.setupDepthRenderbuffer = setupDepthRenderbuffer;
|
|
50028
49687
|
this.setupFrameBufferTexture = setupFrameBufferTexture;
|
|
50029
49688
|
this.useMultisampledRTT = useMultisampledRTT;
|
|
50030
|
-
this.runDeferredUploads = runDeferredUploads;
|
|
50031
|
-
this.setDeferTextureUploads = setDeferTextureUploads;
|
|
50032
49689
|
|
|
50033
49690
|
}
|
|
50034
49691
|
|
|
@@ -50241,39 +49898,6 @@ function WebGLUtils( gl, extensions ) {
|
|
|
50241
49898
|
|
|
50242
49899
|
}
|
|
50243
49900
|
|
|
50244
|
-
/**
|
|
50245
|
-
* @author fernandojsg / http://fernandojsg.com
|
|
50246
|
-
* @author Takahiro https://github.com/takahirox
|
|
50247
|
-
*/
|
|
50248
|
-
|
|
50249
|
-
|
|
50250
|
-
class WebGLMultiviewRenderTarget extends WebGLRenderTarget {
|
|
50251
|
-
|
|
50252
|
-
constructor( width, height, numViews, options = {} ) {
|
|
50253
|
-
|
|
50254
|
-
super( width, height, options );
|
|
50255
|
-
|
|
50256
|
-
this.depthBuffer = false;
|
|
50257
|
-
this.stencilBuffer = false;
|
|
50258
|
-
|
|
50259
|
-
this.numViews = numViews;
|
|
50260
|
-
|
|
50261
|
-
}
|
|
50262
|
-
|
|
50263
|
-
copy( source ) {
|
|
50264
|
-
|
|
50265
|
-
super.copy( source );
|
|
50266
|
-
|
|
50267
|
-
this.numViews = source.numViews;
|
|
50268
|
-
|
|
50269
|
-
return this;
|
|
50270
|
-
|
|
50271
|
-
}
|
|
50272
|
-
|
|
50273
|
-
}
|
|
50274
|
-
|
|
50275
|
-
WebGLMultiviewRenderTarget.prototype.isWebGLMultiviewRenderTarget = true;
|
|
50276
|
-
|
|
50277
49901
|
const _occlusion_vertex = `
|
|
50278
49902
|
void main() {
|
|
50279
49903
|
|
|
@@ -50380,7 +50004,7 @@ class WebXRDepthSensing {
|
|
|
50380
50004
|
|
|
50381
50005
|
class WebXRManager extends EventDispatcher {
|
|
50382
50006
|
|
|
50383
|
-
constructor( renderer, gl
|
|
50007
|
+
constructor( renderer, gl ) {
|
|
50384
50008
|
|
|
50385
50009
|
super();
|
|
50386
50010
|
|
|
@@ -50389,7 +50013,6 @@ class WebXRManager extends EventDispatcher {
|
|
|
50389
50013
|
let session = null;
|
|
50390
50014
|
|
|
50391
50015
|
let framebufferScaleFactor = 1.0;
|
|
50392
|
-
var poseTarget = null;
|
|
50393
50016
|
|
|
50394
50017
|
let referenceSpace = null;
|
|
50395
50018
|
let referenceSpaceType = 'local-floor';
|
|
@@ -50398,8 +50021,6 @@ class WebXRManager extends EventDispatcher {
|
|
|
50398
50021
|
let customReferenceSpace = null;
|
|
50399
50022
|
|
|
50400
50023
|
let pose = null;
|
|
50401
|
-
var layers = [];
|
|
50402
|
-
|
|
50403
50024
|
let glBinding = null;
|
|
50404
50025
|
let glProjLayer = null;
|
|
50405
50026
|
let glBaseLayer = null;
|
|
@@ -50433,18 +50054,11 @@ class WebXRManager extends EventDispatcher {
|
|
|
50433
50054
|
let _currentDepthFar = null;
|
|
50434
50055
|
|
|
50435
50056
|
//
|
|
50057
|
+
|
|
50436
50058
|
this.cameraAutoUpdate = true;
|
|
50437
|
-
this.layersEnabled = false;
|
|
50438
50059
|
this.enabled = false;
|
|
50439
50060
|
|
|
50440
50061
|
this.isPresenting = false;
|
|
50441
|
-
this.isMultiview = false;
|
|
50442
|
-
|
|
50443
|
-
this.getCameraPose = function ( ) {
|
|
50444
|
-
|
|
50445
|
-
return pose;
|
|
50446
|
-
|
|
50447
|
-
};
|
|
50448
50062
|
|
|
50449
50063
|
this.getController = function ( index ) {
|
|
50450
50064
|
|
|
@@ -50613,12 +50227,6 @@ class WebXRManager extends EventDispatcher {
|
|
|
50613
50227
|
|
|
50614
50228
|
};
|
|
50615
50229
|
|
|
50616
|
-
this.getRenderTarget = function () {
|
|
50617
|
-
|
|
50618
|
-
return newRenderTarget;
|
|
50619
|
-
|
|
50620
|
-
};
|
|
50621
|
-
|
|
50622
50230
|
this.getFrame = function () {
|
|
50623
50231
|
|
|
50624
50232
|
return xrFrame;
|
|
@@ -50703,20 +50311,12 @@ class WebXRManager extends EventDispatcher {
|
|
|
50703
50311
|
|
|
50704
50312
|
}
|
|
50705
50313
|
|
|
50706
|
-
scope.isMultiview = useMultiview && extensions.has( 'OCULUS_multiview' );
|
|
50707
|
-
|
|
50708
50314
|
const projectionlayerInit = {
|
|
50709
50315
|
colorFormat: gl.RGBA8,
|
|
50710
50316
|
depthFormat: glDepthFormat,
|
|
50711
50317
|
scaleFactor: framebufferScaleFactor
|
|
50712
50318
|
};
|
|
50713
50319
|
|
|
50714
|
-
if ( scope.isMultiview ) {
|
|
50715
|
-
|
|
50716
|
-
projectionlayerInit.textureType = 'texture-array';
|
|
50717
|
-
|
|
50718
|
-
}
|
|
50719
|
-
|
|
50720
50320
|
glBinding = new XRWebGLBinding( session, gl );
|
|
50721
50321
|
|
|
50722
50322
|
glProjLayer = glBinding.createProjectionLayer( projectionlayerInit );
|
|
@@ -50726,32 +50326,18 @@ class WebXRManager extends EventDispatcher {
|
|
|
50726
50326
|
renderer.setPixelRatio( 1 );
|
|
50727
50327
|
renderer.setSize( glProjLayer.textureWidth, glProjLayer.textureHeight, false );
|
|
50728
50328
|
|
|
50729
|
-
|
|
50730
|
-
|
|
50731
|
-
|
|
50732
|
-
|
|
50733
|
-
|
|
50734
|
-
|
|
50735
|
-
|
|
50736
|
-
|
|
50737
|
-
|
|
50738
|
-
|
|
50739
|
-
|
|
50740
|
-
|
|
50741
|
-
const extension = extensions.get( 'OCULUS_multiview' );
|
|
50742
|
-
|
|
50743
|
-
this.maxNumViews = gl.getParameter( extension.MAX_VIEWS_OVR );
|
|
50744
|
-
|
|
50745
|
-
newRenderTarget = new WebGLMultiviewRenderTarget( glProjLayer.textureWidth, glProjLayer.textureHeight, 2, renderTargetOptions );
|
|
50746
|
-
|
|
50747
|
-
} else {
|
|
50748
|
-
|
|
50749
|
-
newRenderTarget = new WebGLRenderTarget(
|
|
50750
|
-
glProjLayer.textureWidth,
|
|
50751
|
-
glProjLayer.textureHeight,
|
|
50752
|
-
renderTargetOptions );
|
|
50753
|
-
|
|
50754
|
-
}
|
|
50329
|
+
newRenderTarget = new WebGLRenderTarget(
|
|
50330
|
+
glProjLayer.textureWidth,
|
|
50331
|
+
glProjLayer.textureHeight,
|
|
50332
|
+
{
|
|
50333
|
+
format: RGBAFormat,
|
|
50334
|
+
type: UnsignedByteType,
|
|
50335
|
+
depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
|
|
50336
|
+
stencilBuffer: attributes.stencil,
|
|
50337
|
+
colorSpace: renderer.outputColorSpace,
|
|
50338
|
+
samples: attributes.antialias ? 4 : 0,
|
|
50339
|
+
resolveDepthBuffer: ( glProjLayer.ignoreDepthValues === false )
|
|
50340
|
+
} );
|
|
50755
50341
|
|
|
50756
50342
|
}
|
|
50757
50343
|
|
|
@@ -50780,28 +50366,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
50780
50366
|
return session.environmentBlendMode;
|
|
50781
50367
|
|
|
50782
50368
|
}
|
|
50783
|
-
};
|
|
50784
|
-
|
|
50785
|
-
this.addLayer = function(layer) {
|
|
50786
|
-
if (!window.XRWebGLBinding || !this.layersEnabled || !session) { return; }
|
|
50787
|
-
|
|
50788
|
-
layers.push( layer );
|
|
50789
|
-
this.updateLayers();
|
|
50790
|
-
};
|
|
50791
|
-
|
|
50792
|
-
this.removeLayer = function(layer) {
|
|
50793
|
-
|
|
50794
|
-
layers.splice( layers.indexOf(layer), 1 );
|
|
50795
|
-
if (!window.XRWebGLBinding || !this.layersEnabled || !session) { return; }
|
|
50796
|
-
|
|
50797
|
-
this.updateLayers();
|
|
50798
|
-
};
|
|
50799
|
-
|
|
50800
|
-
this.updateLayers = function() {
|
|
50801
|
-
var layersCopy = layers.map(function (x) { return x; });
|
|
50802
50369
|
|
|
50803
|
-
layersCopy.unshift( session.renderState.layers[0] );
|
|
50804
|
-
session.updateRenderState( { layers: layersCopy } );
|
|
50805
50370
|
};
|
|
50806
50371
|
|
|
50807
50372
|
this.getDepthTexture = function () {
|
|
@@ -50970,12 +50535,6 @@ class WebXRManager extends EventDispatcher {
|
|
|
50970
50535
|
|
|
50971
50536
|
}
|
|
50972
50537
|
|
|
50973
|
-
this.setPoseTarget = function ( object ) {
|
|
50974
|
-
|
|
50975
|
-
if ( object !== undefined ) poseTarget = object;
|
|
50976
|
-
|
|
50977
|
-
};
|
|
50978
|
-
|
|
50979
50538
|
this.updateCamera = function ( camera ) {
|
|
50980
50539
|
|
|
50981
50540
|
if ( session === null ) return;
|
|
@@ -51011,9 +50570,8 @@ class WebXRManager extends EventDispatcher {
|
|
|
51011
50570
|
cameraR.layers.mask = camera.layers.mask | 0b100;
|
|
51012
50571
|
cameraXR.layers.mask = cameraL.layers.mask | cameraR.layers.mask;
|
|
51013
50572
|
|
|
50573
|
+
const parent = camera.parent;
|
|
51014
50574
|
const cameras = cameraXR.cameras;
|
|
51015
|
-
var object = poseTarget || camera;
|
|
51016
|
-
const parent = object.parent;
|
|
51017
50575
|
|
|
51018
50576
|
updateCamera( cameraXR, parent );
|
|
51019
50577
|
|
|
@@ -51037,28 +50595,28 @@ class WebXRManager extends EventDispatcher {
|
|
|
51037
50595
|
|
|
51038
50596
|
}
|
|
51039
50597
|
|
|
51040
|
-
|
|
50598
|
+
// update user camera and its children
|
|
51041
50599
|
|
|
51042
|
-
|
|
50600
|
+
updateUserCamera( camera, cameraXR, parent );
|
|
51043
50601
|
|
|
51044
|
-
|
|
50602
|
+
};
|
|
51045
50603
|
|
|
51046
|
-
|
|
50604
|
+
function updateUserCamera( camera, cameraXR, parent ) {
|
|
51047
50605
|
|
|
51048
|
-
if (
|
|
50606
|
+
if ( parent === null ) {
|
|
51049
50607
|
|
|
51050
|
-
|
|
50608
|
+
camera.matrix.copy( cameraXR.matrixWorld );
|
|
51051
50609
|
|
|
51052
50610
|
} else {
|
|
51053
50611
|
|
|
51054
|
-
|
|
51055
|
-
|
|
51056
|
-
|
|
50612
|
+
camera.matrix.copy( parent.matrixWorld );
|
|
50613
|
+
camera.matrix.invert();
|
|
50614
|
+
camera.matrix.multiply( cameraXR.matrixWorld );
|
|
51057
50615
|
|
|
51058
50616
|
}
|
|
51059
50617
|
|
|
51060
|
-
|
|
51061
|
-
|
|
50618
|
+
camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
|
|
50619
|
+
camera.updateMatrixWorld( true );
|
|
51062
50620
|
|
|
51063
50621
|
camera.projectionMatrix.copy( cameraXR.projectionMatrix );
|
|
51064
50622
|
camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );
|
|
@@ -52270,7 +51828,6 @@ class WebGLRenderer {
|
|
|
52270
51828
|
powerPreference = 'default',
|
|
52271
51829
|
failIfMajorPerformanceCaveat = false,
|
|
52272
51830
|
reverseDepthBuffer = false,
|
|
52273
|
-
multiviewStereo = false,
|
|
52274
51831
|
} = parameters;
|
|
52275
51832
|
|
|
52276
51833
|
this.isWebGLRenderer = true;
|
|
@@ -52478,7 +52035,6 @@ class WebGLRenderer {
|
|
|
52478
52035
|
let extensions, capabilities, state, info;
|
|
52479
52036
|
let properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects;
|
|
52480
52037
|
let programCache, materials, renderLists, renderStates, clipping, shadowMap;
|
|
52481
|
-
let multiview;
|
|
52482
52038
|
|
|
52483
52039
|
let background, morphtargets, bufferRenderer, indexedBufferRenderer;
|
|
52484
52040
|
|
|
@@ -52517,7 +52073,6 @@ class WebGLRenderer {
|
|
|
52517
52073
|
renderLists = new WebGLRenderLists();
|
|
52518
52074
|
renderStates = new WebGLRenderStates( extensions );
|
|
52519
52075
|
background = new WebGLBackground( _this, cubemaps, cubeuvmaps, state, objects, _alpha, premultipliedAlpha );
|
|
52520
|
-
multiview = new WebGLMultiview( _this, extensions, _gl );
|
|
52521
52076
|
shadowMap = new WebGLShadowMap( _this, objects, capabilities );
|
|
52522
52077
|
uniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state );
|
|
52523
52078
|
|
|
@@ -53454,21 +53009,11 @@ class WebGLRenderer {
|
|
|
53454
53009
|
|
|
53455
53010
|
if ( _renderBackground ) background.render( scene );
|
|
53456
53011
|
|
|
53457
|
-
|
|
53012
|
+
for ( let i = 0, l = cameras.length; i < l; i ++ ) {
|
|
53458
53013
|
|
|
53459
|
-
|
|
53014
|
+
const camera2 = cameras[ i ];
|
|
53460
53015
|
|
|
53461
|
-
renderScene( currentRenderList, scene,
|
|
53462
|
-
|
|
53463
|
-
} else {
|
|
53464
|
-
|
|
53465
|
-
for ( let i = 0, l = cameras.length; i < l; i ++ ) {
|
|
53466
|
-
|
|
53467
|
-
const camera2 = cameras[ i ];
|
|
53468
|
-
|
|
53469
|
-
renderScene( currentRenderList, scene, camera2, camera2.viewport );
|
|
53470
|
-
|
|
53471
|
-
}
|
|
53016
|
+
renderScene( currentRenderList, scene, camera2, camera2.viewport );
|
|
53472
53017
|
|
|
53473
53018
|
}
|
|
53474
53019
|
|
|
@@ -53994,7 +53539,6 @@ class WebGLRenderer {
|
|
|
53994
53539
|
materialProperties.vertexAlphas = parameters.vertexAlphas;
|
|
53995
53540
|
materialProperties.vertexTangents = parameters.vertexTangents;
|
|
53996
53541
|
materialProperties.toneMapping = parameters.toneMapping;
|
|
53997
|
-
materialProperties.numMultiviewViews = parameters.numMultiviewViews;
|
|
53998
53542
|
|
|
53999
53543
|
}
|
|
54000
53544
|
|
|
@@ -54026,8 +53570,6 @@ class WebGLRenderer {
|
|
|
54026
53570
|
|
|
54027
53571
|
}
|
|
54028
53572
|
|
|
54029
|
-
const numMultiviewViews = _currentRenderTarget && _currentRenderTarget.isWebGLMultiviewRenderTarget ? _currentRenderTarget.numViews : 0;
|
|
54030
|
-
|
|
54031
53573
|
const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
|
|
54032
53574
|
const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;
|
|
54033
53575
|
|
|
@@ -54155,10 +53697,6 @@ class WebGLRenderer {
|
|
|
54155
53697
|
|
|
54156
53698
|
needsProgramChange = true;
|
|
54157
53699
|
|
|
54158
|
-
} else if ( materialProperties.numMultiviewViews !== numMultiviewViews ) {
|
|
54159
|
-
|
|
54160
|
-
needsProgramChange = true;
|
|
54161
|
-
|
|
54162
53700
|
}
|
|
54163
53701
|
|
|
54164
53702
|
} else {
|
|
@@ -54205,34 +53743,25 @@ class WebGLRenderer {
|
|
|
54205
53743
|
|
|
54206
53744
|
// common camera uniforms
|
|
54207
53745
|
|
|
54208
|
-
|
|
54209
|
-
|
|
54210
|
-
multiview.updateCameraProjectionMatricesUniform( camera, p_uniforms );
|
|
54211
|
-
multiview.updateCameraViewMatricesUniform( camera, p_uniforms );
|
|
54212
|
-
|
|
54213
|
-
} else {
|
|
54214
|
-
|
|
54215
|
-
const reverseDepthBuffer = state.buffers.depth.getReversed();
|
|
53746
|
+
const reverseDepthBuffer = state.buffers.depth.getReversed();
|
|
54216
53747
|
|
|
54217
|
-
|
|
53748
|
+
if ( reverseDepthBuffer ) {
|
|
54218
53749
|
|
|
54219
|
-
|
|
53750
|
+
_currentProjectionMatrix.copy( camera.projectionMatrix );
|
|
54220
53751
|
|
|
54221
|
-
|
|
54222
|
-
|
|
53752
|
+
toNormalizedProjectionMatrix( _currentProjectionMatrix );
|
|
53753
|
+
toReversedProjectionMatrix( _currentProjectionMatrix );
|
|
54223
53754
|
|
|
54224
|
-
|
|
53755
|
+
p_uniforms.setValue( _gl, 'projectionMatrix', _currentProjectionMatrix );
|
|
54225
53756
|
|
|
54226
|
-
|
|
54227
|
-
|
|
54228
|
-
p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
|
|
54229
|
-
|
|
54230
|
-
}
|
|
53757
|
+
} else {
|
|
54231
53758
|
|
|
54232
|
-
p_uniforms.setValue( _gl, '
|
|
53759
|
+
p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
|
|
54233
53760
|
|
|
54234
53761
|
}
|
|
54235
53762
|
|
|
53763
|
+
p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );
|
|
53764
|
+
|
|
54236
53765
|
const uCamPos = p_uniforms.map.cameraPosition;
|
|
54237
53766
|
|
|
54238
53767
|
if ( uCamPos !== undefined ) {
|
|
@@ -54393,17 +53922,8 @@ class WebGLRenderer {
|
|
|
54393
53922
|
|
|
54394
53923
|
// common matrices
|
|
54395
53924
|
|
|
54396
|
-
|
|
54397
|
-
|
|
54398
|
-
multiview.updateObjectMatricesUniforms( object, camera, p_uniforms );
|
|
54399
|
-
|
|
54400
|
-
} else {
|
|
54401
|
-
|
|
54402
|
-
p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix );
|
|
54403
|
-
p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );
|
|
54404
|
-
|
|
54405
|
-
}
|
|
54406
|
-
|
|
53925
|
+
p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix );
|
|
53926
|
+
p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );
|
|
54407
53927
|
p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld );
|
|
54408
53928
|
|
|
54409
53929
|
// UBOs
|
|
@@ -54453,32 +53973,6 @@ class WebGLRenderer {
|
|
|
54453
53973
|
|
|
54454
53974
|
}
|
|
54455
53975
|
|
|
54456
|
-
this.setTexture2D = ( function () {
|
|
54457
|
-
|
|
54458
|
-
var warned = false;
|
|
54459
|
-
|
|
54460
|
-
// backwards compatibility: peel texture.texture
|
|
54461
|
-
return function setTexture2D( texture, slot ) {
|
|
54462
|
-
|
|
54463
|
-
if ( texture && texture.isWebGLRenderTarget ) {
|
|
54464
|
-
|
|
54465
|
-
if ( ! warned ) {
|
|
54466
|
-
|
|
54467
|
-
console.warn( "THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead." );
|
|
54468
|
-
warned = true;
|
|
54469
|
-
|
|
54470
|
-
}
|
|
54471
|
-
|
|
54472
|
-
texture = texture.texture;
|
|
54473
|
-
|
|
54474
|
-
}
|
|
54475
|
-
|
|
54476
|
-
textures.setTexture2D( texture, slot );
|
|
54477
|
-
|
|
54478
|
-
};
|
|
54479
|
-
|
|
54480
|
-
}() );
|
|
54481
|
-
|
|
54482
53976
|
this.getActiveCubeFace = function () {
|
|
54483
53977
|
|
|
54484
53978
|
return _currentActiveCubeFace;
|
|
@@ -54507,7 +54001,7 @@ class WebGLRenderer {
|
|
|
54507
54001
|
|
|
54508
54002
|
renderTargetProperties.__autoAllocateDepthBuffer = depthTexture === undefined;
|
|
54509
54003
|
|
|
54510
|
-
if ( ! renderTargetProperties.__autoAllocateDepthBuffer
|
|
54004
|
+
if ( ! renderTargetProperties.__autoAllocateDepthBuffer ) {
|
|
54511
54005
|
|
|
54512
54006
|
// The multisample_render_to_texture extension doesn't work properly if there
|
|
54513
54007
|
// are midframe flushes and an external depth buffer. Disable use of the extension.
|
|
@@ -54533,13 +54027,6 @@ class WebGLRenderer {
|
|
|
54533
54027
|
const _scratchFrameBuffer = _gl.createFramebuffer();
|
|
54534
54028
|
this.setRenderTarget = function ( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) {
|
|
54535
54029
|
|
|
54536
|
-
// Render to base layer instead of canvas in WebXR
|
|
54537
|
-
if ( renderTarget === null && this.xr.isPresenting ) {
|
|
54538
|
-
|
|
54539
|
-
renderTarget = this.xr.getRenderTarget();
|
|
54540
|
-
|
|
54541
|
-
}
|
|
54542
|
-
|
|
54543
54030
|
_currentRenderTarget = renderTarget;
|
|
54544
54031
|
_currentActiveCubeFace = activeCubeFace;
|
|
54545
54032
|
_currentActiveMipmapLevel = activeMipmapLevel;
|