super-three 0.135.0 → 0.136.0
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.js +527 -332
- package/build/three.min.js +1 -1
- package/build/three.module.js +752 -370
- package/examples/fonts/tabler-icons/fonts/tabler-icons.svg +3966 -0
- package/examples/js/animation/CCDIKSolver.js +0 -1
- package/examples/js/animation/MMDPhysics.js +1 -3
- package/examples/js/controls/ArcballControls.js +38 -52
- package/examples/js/controls/TransformControls.js +24 -1
- package/examples/js/curves/CurveExtras.js +0 -2
- package/examples/js/effects/AsciiEffect.js +2 -9
- package/examples/js/exporters/GLTFExporter.js +1 -1
- package/examples/js/geometries/TeapotGeometry.js +0 -1
- package/examples/js/interactive/SelectionBox.js +2 -0
- package/examples/js/interactive/SelectionHelper.js +22 -7
- package/examples/js/lights/RectAreaLightUniformsLib.js +4 -0
- package/examples/js/loaders/AMFLoader.js +0 -2
- package/examples/js/loaders/ColladaLoader.js +1 -2
- package/examples/js/loaders/EXRLoader.js +185 -262
- package/examples/js/loaders/FBXLoader.js +3 -4
- package/examples/js/loaders/GLTFLoader.js +2 -2
- package/examples/js/loaders/HDRCubeTextureLoader.js +0 -8
- package/examples/js/loaders/KTX2Loader.js +11 -2
- package/examples/js/loaders/KTXLoader.js +1 -1
- package/examples/js/loaders/LDrawLoader.js +26 -30
- package/examples/js/loaders/LUT3dlLoader.js +2 -0
- package/examples/js/loaders/LUTCubeLoader.js +2 -0
- package/examples/js/loaders/MMDLoader.js +0 -1
- package/examples/js/loaders/NRRDLoader.js +9 -2
- package/examples/js/loaders/OBJLoader.js +0 -2
- package/examples/js/loaders/PLYLoader.js +1 -1
- package/examples/js/loaders/RGBELoader.js +0 -15
- package/examples/js/loaders/RGBMLoader.js +55 -5
- package/examples/js/loaders/SVGLoader.js +2 -2
- package/examples/js/loaders/VOXLoader.js +1 -0
- package/examples/js/loaders/VRMLLoader.js +2 -1
- package/examples/js/math/ImprovedNoise.js +1 -1
- package/examples/js/misc/GPUComputationRenderer.js +3 -1
- package/examples/js/objects/Lensflare.js +2 -10
- package/examples/js/objects/Reflector.js +7 -0
- package/examples/js/objects/Refractor.js +7 -0
- package/examples/js/objects/Sky.js +1 -1
- package/examples/js/objects/Water.js +2 -2
- package/examples/js/objects/Water2.js +4 -7
- package/examples/js/postprocessing/GlitchPass.js +3 -1
- package/examples/js/postprocessing/SSAOPass.js +1 -0
- package/examples/js/shaders/ConvolutionShader.js +0 -1
- package/examples/js/shaders/FXAAShader.js +1 -1
- package/examples/js/shaders/FilmShader.js +1 -1
- package/examples/js/shaders/GammaCorrectionShader.js +1 -1
- package/examples/js/shaders/HorizontalBlurShader.js +1 -2
- package/examples/js/shaders/SSRShader.js +1 -1
- package/examples/js/shaders/SSRrShader.js +1 -1
- package/examples/js/shaders/VerticalBlurShader.js +1 -2
- package/examples/js/utils/GeometryUtils.js +1 -1
- package/examples/js/utils/RoughnessMipmapper.js +18 -29
- package/examples/jsm/animation/CCDIKSolver.js +0 -1
- package/examples/jsm/animation/MMDPhysics.js +0 -2
- package/examples/jsm/controls/ArcballControls.js +27 -56
- package/examples/jsm/controls/TransformControls.js +24 -1
- package/examples/jsm/curves/CurveExtras.js +0 -2
- package/examples/jsm/effects/AsciiEffect.js +2 -9
- package/examples/jsm/exporters/GLTFExporter.js +1 -1
- package/examples/jsm/geometries/TeapotGeometry.js +0 -1
- package/examples/jsm/interactive/SelectionBox.js +1 -0
- package/examples/jsm/interactive/SelectionHelper.js +19 -7
- package/examples/jsm/libs/flow.module.js +256 -136
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +7 -0
- package/examples/jsm/loaders/AMFLoader.js +0 -2
- package/examples/jsm/loaders/ColladaLoader.js +1 -2
- package/examples/jsm/loaders/EXRLoader.js +184 -293
- package/examples/jsm/loaders/FBXLoader.js +3 -4
- package/examples/jsm/loaders/GLTFLoader.js +2 -2
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +1 -14
- package/examples/jsm/loaders/KTX2Loader.js +13 -4
- package/examples/jsm/loaders/KTXLoader.js +1 -1
- package/examples/jsm/loaders/LDrawLoader.js +23 -24
- package/examples/jsm/loaders/LUT3dlLoader.js +2 -0
- package/examples/jsm/loaders/LUTCubeLoader.js +2 -0
- package/examples/jsm/loaders/MMDLoader.js +0 -1
- package/examples/jsm/loaders/NRRDLoader.js +10 -2
- package/examples/jsm/loaders/OBJLoader.js +0 -2
- package/examples/jsm/loaders/PLYLoader.js +1 -1
- package/examples/jsm/loaders/RGBELoader.js +0 -20
- package/examples/jsm/loaders/RGBMLoader.js +61 -7
- package/examples/jsm/loaders/SVGLoader.js +2 -2
- package/examples/jsm/loaders/TDSLoader.js +30 -9
- package/examples/jsm/loaders/VOXLoader.js +1 -0
- package/examples/jsm/loaders/VRMLLoader.js +2 -1
- package/examples/jsm/math/ImprovedNoise.js +1 -1
- package/examples/jsm/misc/GPUComputationRenderer.js +3 -1
- package/examples/jsm/node-editor/NodeEditor.js +23 -22
- package/examples/jsm/node-editor/examples/rim.json +1 -1
- package/examples/jsm/node-editor/materials/StandardMaterialEditor.js +48 -9
- package/examples/jsm/node-editor/utils/OscillatorEditor.js +1 -1
- package/examples/jsm/nodes/core/NodeBuilder.js +2 -2
- package/examples/jsm/nodes/materials/nodes/StandardNode.js +1 -0
- package/examples/jsm/nodes/math/MathNode.js +12 -0
- package/examples/jsm/nodes/misc/BumpMapNode.js +1 -1
- package/examples/jsm/nodes/misc/TextureCubeUVNode.js +1 -4
- package/examples/jsm/nodes/utils/ColorSpaceNode.js +1 -116
- package/examples/jsm/objects/Lensflare.js +3 -14
- package/examples/jsm/objects/Reflector.js +7 -0
- package/examples/jsm/objects/Refractor.js +7 -0
- package/examples/jsm/objects/Sky.js +1 -1
- package/examples/jsm/objects/Water.js +2 -2
- package/examples/jsm/objects/Water2.js +4 -8
- package/examples/jsm/postprocessing/GlitchPass.js +3 -1
- package/examples/jsm/postprocessing/SAOPass.js +1 -1
- package/examples/jsm/postprocessing/SSAOPass.js +1 -0
- package/examples/jsm/renderers/nodes/Nodes.js +1 -0
- package/examples/jsm/renderers/nodes/ShaderNode.js +7 -6
- package/examples/jsm/renderers/nodes/core/InputNode.js +1 -1
- package/examples/jsm/renderers/nodes/core/NodeBuilder.js +1 -1
- package/examples/jsm/renderers/nodes/display/ColorSpaceNode.js +26 -31
- package/examples/jsm/renderers/nodes/functions/BSDFs.js +2 -2
- package/examples/jsm/renderers/nodes/functions/PhysicalMaterialFunctions.js +27 -0
- package/examples/jsm/renderers/nodes/inputs/TextureNode.js +1 -1
- package/examples/jsm/renderers/nodes/math/MathNode.js +5 -3
- package/examples/jsm/renderers/nodes/math/OperatorNode.js +2 -2
- package/examples/jsm/renderers/nodes/utils/TimerNode.js +1 -1
- package/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +14 -14
- package/examples/jsm/renderers/webgpu/WebGPUBindings.js +7 -6
- package/examples/jsm/renderers/webgpu/WebGPURenderPipeline.js +1 -1
- package/examples/jsm/renderers/webgpu/WebGPURenderPipelines.js +42 -61
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +2 -2
- package/examples/jsm/renderers/webgpu/WebGPUTextureUtils.js +0 -1
- package/examples/jsm/renderers/webgpu/nodes/WebGPUNodeBuilder.js +30 -4
- package/examples/jsm/shaders/ConvolutionShader.js +0 -1
- package/examples/jsm/shaders/FXAAShader.js +1 -1
- package/examples/jsm/shaders/FilmShader.js +1 -1
- package/examples/jsm/shaders/GammaCorrectionShader.js +1 -1
- package/examples/jsm/shaders/HorizontalBlurShader.js +1 -2
- package/examples/jsm/shaders/SSRShader.js +1 -1
- package/examples/jsm/shaders/SSRrShader.js +1 -1
- package/examples/jsm/shaders/VerticalBlurShader.js +1 -2
- package/examples/jsm/utils/GeometryUtils.js +1 -1
- package/examples/jsm/utils/RoughnessMipmapper.js +19 -32
- package/examples/jsm/utils/WorkerPool.js +11 -11
- package/package.json +15 -9
- package/src/Three.Legacy.js +12 -0
- package/src/Three.js +1 -2
- package/src/constants.js +1 -7
- package/src/core/Object3D.js +1 -1
- package/src/extras/PMREMGenerator.js +19 -110
- package/src/extras/core/Interpolations.js +1 -1
- package/src/geometries/LatheGeometry.js +70 -47
- package/src/helpers/CameraHelper.js +1 -1
- package/src/loaders/FileLoader.js +23 -6
- package/src/math/Color.js +0 -38
- package/src/math/Ray.js +2 -2
- package/src/math/Sphere.js +10 -1
- package/src/objects/Skeleton.js +1 -0
- package/src/renderers/WebGLRenderer.js +23 -16
- package/src/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js +2 -24
- package/src/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js +0 -47
- package/src/renderers/shaders/ShaderChunk/gradientmap_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +27 -1
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +10 -0
- package/src/renderers/webgl/WebGLCapabilities.js +0 -2
- package/src/renderers/webgl/WebGLMorphtargets.js +1 -0
- package/src/renderers/webgl/WebGLProgram.js +2 -19
- package/src/renderers/webgl/WebGLPrograms.js +191 -35
- package/src/renderers/webgl/WebGLRenderLists.js +4 -14
- package/src/renderers/webgl/WebGLShaderCache.js +120 -0
- package/src/renderers/webgl/WebGLState.js +45 -0
- package/src/renderers/webgl/WebGLTextures.js +195 -26
- package/src/renderers/webxr/WebXRManager.js +10 -3
- package/src/scenes/Scene.js +1 -1
- package/src/textures/DataTexture.js +0 -2
- package/src/textures/DataTexture2DArray.js +0 -2
- package/src/textures/DataTexture3D.js +0 -2
- package/src/textures/FramebufferTexture.js +25 -0
- package/src/utils.js +1 -37
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Two pass Gaussian blur filter (horizontal and vertical blur shaders)
|
|
3
|
-
* -
|
|
4
|
-
* and used in http://www.cake23.de/traveling-wavefronts-lit-up.html
|
|
3
|
+
* - see http://www.cake23.de/traveling-wavefronts-lit-up.html
|
|
5
4
|
*
|
|
6
5
|
* - 9 samples per pass
|
|
7
6
|
* - standard deviation 2.7
|
|
@@ -59,7 +59,7 @@ function hilbert2D( center = new Vector3( 0, 0, 0 ), size = 10, iterations = 1,
|
|
|
59
59
|
* Generates 3D-Coordinates in a very fast way.
|
|
60
60
|
*
|
|
61
61
|
* Based on work by:
|
|
62
|
-
* @link
|
|
62
|
+
* @link https://openprocessing.org/user/5654
|
|
63
63
|
*
|
|
64
64
|
* @param center Center of Hilbert curve.
|
|
65
65
|
* @param size Total width of Hilbert curve.
|
|
@@ -14,7 +14,8 @@ import {
|
|
|
14
14
|
PlaneGeometry,
|
|
15
15
|
RawShaderMaterial,
|
|
16
16
|
Vector2,
|
|
17
|
-
WebGLRenderTarget
|
|
17
|
+
WebGLRenderTarget,
|
|
18
|
+
FramebufferTexture
|
|
18
19
|
} from 'three';
|
|
19
20
|
|
|
20
21
|
const _mipmapMaterial = _getMipmapMaterial();
|
|
@@ -68,42 +69,28 @@ class RoughnessMipmapper {
|
|
|
68
69
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
const newRoughnessTexture = new FramebufferTexture( width, height, roughnessMap.format );
|
|
73
|
+
newRoughnessTexture.wrapS = roughnessMap.wrapS;
|
|
74
|
+
newRoughnessTexture.wrapT = roughnessMap.wrapT;
|
|
75
|
+
newRoughnessTexture.minFilter = roughnessMap.minFilter;
|
|
76
|
+
newRoughnessTexture.magFilter = roughnessMap.magFilter;
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
wrapS: roughnessMap.wrapS,
|
|
75
|
-
wrapT: roughnessMap.wrapT,
|
|
76
|
-
magFilter: roughnessMap.magFilter,
|
|
77
|
-
minFilter: roughnessMap.minFilter,
|
|
78
|
-
depthBuffer: false
|
|
79
|
-
};
|
|
78
|
+
material.roughnessMap = newRoughnessTexture;
|
|
80
79
|
|
|
81
|
-
|
|
80
|
+
if ( material.metalnessMap == roughnessMap ) material.metalnessMap = material.roughnessMap;
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
if ( material.aoMap == roughnessMap ) material.aoMap = material.roughnessMap;
|
|
84
83
|
|
|
85
|
-
|
|
84
|
+
// Copy UV transform parameters
|
|
86
85
|
|
|
87
|
-
|
|
86
|
+
material.roughnessMap.offset.copy( roughnessMap.offset );
|
|
87
|
+
material.roughnessMap.repeat.copy( roughnessMap.repeat );
|
|
88
|
+
material.roughnessMap.center.copy( roughnessMap.center );
|
|
89
|
+
material.roughnessMap.rotation = roughnessMap.rotation;
|
|
90
|
+
material.roughnessMap.image = roughnessMap.image; // required for USDZExporter, see #22741
|
|
88
91
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if ( material.metalnessMap == roughnessMap ) material.metalnessMap = material.roughnessMap;
|
|
92
|
-
|
|
93
|
-
if ( material.aoMap == roughnessMap ) material.aoMap = material.roughnessMap;
|
|
94
|
-
|
|
95
|
-
// Copy UV transform parameters
|
|
96
|
-
|
|
97
|
-
material.roughnessMap.offset.copy( roughnessMap.offset );
|
|
98
|
-
material.roughnessMap.repeat.copy( roughnessMap.repeat );
|
|
99
|
-
material.roughnessMap.center.copy( roughnessMap.center );
|
|
100
|
-
material.roughnessMap.rotation = roughnessMap.rotation;
|
|
101
|
-
material.roughnessMap.image = roughnessMap.image;
|
|
102
|
-
|
|
103
|
-
material.roughnessMap.matrixAutoUpdate = roughnessMap.matrixAutoUpdate;
|
|
104
|
-
material.roughnessMap.matrix.copy( roughnessMap.matrix );
|
|
105
|
-
|
|
106
|
-
}
|
|
92
|
+
material.roughnessMap.matrixAutoUpdate = roughnessMap.matrixAutoUpdate;
|
|
93
|
+
material.roughnessMap.matrix.copy( roughnessMap.matrix );
|
|
107
94
|
|
|
108
95
|
_mipmapMaterial.uniforms.roughnessMap.value = roughnessMap;
|
|
109
96
|
|
|
@@ -137,7 +124,7 @@ class RoughnessMipmapper {
|
|
|
137
124
|
|
|
138
125
|
}
|
|
139
126
|
|
|
140
|
-
|
|
127
|
+
roughnessMap.dispose();
|
|
141
128
|
|
|
142
129
|
_renderer.setRenderTarget( oldTarget );
|
|
143
130
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
export class WorkerPool {
|
|
6
6
|
|
|
7
|
-
constructor
|
|
7
|
+
constructor( pool = 4 ) {
|
|
8
8
|
|
|
9
9
|
this.pool = pool;
|
|
10
10
|
this.queue = [];
|
|
@@ -14,9 +14,9 @@ export class WorkerPool {
|
|
|
14
14
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
_initWorker
|
|
17
|
+
_initWorker( workerId ) {
|
|
18
18
|
|
|
19
|
-
if ( !this.workers[ workerId ] ) {
|
|
19
|
+
if ( ! this.workers[ workerId ] ) {
|
|
20
20
|
|
|
21
21
|
const worker = this.workerCreator();
|
|
22
22
|
worker.addEventListener( 'message', this._onMessage.bind( this, workerId ) );
|
|
@@ -26,12 +26,12 @@ export class WorkerPool {
|
|
|
26
26
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
_getIdleWorker
|
|
29
|
+
_getIdleWorker() {
|
|
30
30
|
|
|
31
|
-
for ( let i = 0
|
|
31
|
+
for ( let i = 0; i < this.pool; i ++ )
|
|
32
32
|
if ( ! ( this.workerStatus & ( 1 << i ) ) ) return i;
|
|
33
33
|
|
|
34
|
-
return -1;
|
|
34
|
+
return - 1;
|
|
35
35
|
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -54,25 +54,25 @@ export class WorkerPool {
|
|
|
54
54
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
setWorkerCreator
|
|
57
|
+
setWorkerCreator( workerCreator ) {
|
|
58
58
|
|
|
59
59
|
this.workerCreator = workerCreator;
|
|
60
60
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
setWorkerLimit
|
|
63
|
+
setWorkerLimit( pool ) {
|
|
64
64
|
|
|
65
65
|
this.pool = pool;
|
|
66
66
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
postMessage
|
|
69
|
+
postMessage( msg, transfer ) {
|
|
70
70
|
|
|
71
71
|
return new Promise( ( resolve ) => {
|
|
72
72
|
|
|
73
73
|
const workerId = this._getIdleWorker();
|
|
74
74
|
|
|
75
|
-
if ( workerId !== -1 ) {
|
|
75
|
+
if ( workerId !== - 1 ) {
|
|
76
76
|
|
|
77
77
|
this._initWorker( workerId );
|
|
78
78
|
this.workerStatus |= 1 << workerId;
|
|
@@ -89,7 +89,7 @@ export class WorkerPool {
|
|
|
89
89
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
dispose
|
|
92
|
+
dispose() {
|
|
93
93
|
|
|
94
94
|
this.workers.forEach( ( worker ) => worker.terminate() );
|
|
95
95
|
this.workersResolve.length = 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.136.0",
|
|
4
4
|
"description": "JavaScript 3D library",
|
|
5
5
|
"main": "build/three.js",
|
|
6
6
|
"module": "build/three.module.js",
|
|
@@ -39,14 +39,20 @@
|
|
|
39
39
|
"html"
|
|
40
40
|
],
|
|
41
41
|
"globals": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
42
|
+
"__THREE_DEVTOOLS__": "readonly",
|
|
43
|
+
"WebGL2ComputeRenderingContext": "readonly",
|
|
44
|
+
|
|
45
|
+
"potpack": "readonly",
|
|
46
|
+
"fflate": "readonly",
|
|
47
|
+
"bodymovin": "readonly",
|
|
48
|
+
"OIMO": "readonly",
|
|
49
|
+
"Stats": "readonly",
|
|
50
|
+
"XRWebGLBinding": "readonly",
|
|
51
|
+
"XRWebGLLayer": "readonly",
|
|
52
|
+
|
|
53
|
+
"GPUShaderStage": "readonly",
|
|
54
|
+
"GPUBufferUsage": "readonly",
|
|
55
|
+
"GPUTextureUsage": "readonly"
|
|
50
56
|
},
|
|
51
57
|
"rules": {
|
|
52
58
|
"quotes": [
|
package/src/Three.Legacy.js
CHANGED
|
@@ -1585,7 +1585,19 @@ Object.defineProperties( WebGLRenderer.prototype, {
|
|
|
1585
1585
|
|
|
1586
1586
|
}
|
|
1587
1587
|
},
|
|
1588
|
+
gammaFactor: {
|
|
1589
|
+
get: function () {
|
|
1590
|
+
|
|
1591
|
+
console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );
|
|
1592
|
+
return 2;
|
|
1593
|
+
|
|
1594
|
+
},
|
|
1595
|
+
set: function () {
|
|
1596
|
+
|
|
1597
|
+
console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );
|
|
1588
1598
|
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1589
1601
|
} );
|
|
1590
1602
|
|
|
1591
1603
|
Object.defineProperties( WebGLShadowMap.prototype, {
|
package/src/Three.js
CHANGED
|
@@ -26,6 +26,7 @@ export { Line } from './objects/Line.js';
|
|
|
26
26
|
export { Points } from './objects/Points.js';
|
|
27
27
|
export { Group } from './objects/Group.js';
|
|
28
28
|
export { VideoTexture } from './textures/VideoTexture.js';
|
|
29
|
+
export { FramebufferTexture } from './textures/FramebufferTexture.js';
|
|
29
30
|
export { DataTexture } from './textures/DataTexture.js';
|
|
30
31
|
export { DataTexture2DArray } from './textures/DataTexture2DArray.js';
|
|
31
32
|
export { DataTexture3D } from './textures/DataTexture3D.js';
|
|
@@ -154,11 +155,9 @@ export * from './Three.Legacy.js';
|
|
|
154
155
|
|
|
155
156
|
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
|
|
156
157
|
|
|
157
|
-
/* eslint-disable no-undef */
|
|
158
158
|
__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
|
|
159
159
|
revision: REVISION,
|
|
160
160
|
} } ) );
|
|
161
|
-
/* eslint-enable no-undef */
|
|
162
161
|
|
|
163
162
|
}
|
|
164
163
|
|
package/src/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const REVISION = '
|
|
1
|
+
export const REVISION = '136';
|
|
2
2
|
export const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
3
3
|
export const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
4
4
|
export const CullFaceNone = 0;
|
|
@@ -91,7 +91,6 @@ export const RGBFormat = 1022;
|
|
|
91
91
|
export const RGBAFormat = 1023;
|
|
92
92
|
export const LuminanceFormat = 1024;
|
|
93
93
|
export const LuminanceAlphaFormat = 1025;
|
|
94
|
-
export const RGBEFormat = RGBAFormat;
|
|
95
94
|
export const DepthFormat = 1026;
|
|
96
95
|
export const DepthStencilFormat = 1027;
|
|
97
96
|
export const RedFormat = 1028;
|
|
@@ -157,11 +156,6 @@ export const TriangleStripDrawMode = 1;
|
|
|
157
156
|
export const TriangleFanDrawMode = 2;
|
|
158
157
|
export const LinearEncoding = 3000;
|
|
159
158
|
export const sRGBEncoding = 3001;
|
|
160
|
-
export const GammaEncoding = 3007;
|
|
161
|
-
export const RGBEEncoding = 3002;
|
|
162
|
-
export const RGBM7Encoding = 3004;
|
|
163
|
-
export const RGBM16Encoding = 3005;
|
|
164
|
-
export const RGBDEncoding = 3006;
|
|
165
159
|
export const BasicDepthPacking = 3200;
|
|
166
160
|
export const RGBADepthPacking = 3201;
|
|
167
161
|
export const TangentSpaceNormalMap = 0;
|
package/src/core/Object3D.js
CHANGED
|
@@ -2,18 +2,14 @@ import {
|
|
|
2
2
|
CubeReflectionMapping,
|
|
3
3
|
CubeRefractionMapping,
|
|
4
4
|
CubeUVReflectionMapping,
|
|
5
|
-
GammaEncoding,
|
|
6
5
|
LinearEncoding,
|
|
6
|
+
LinearFilter,
|
|
7
7
|
NoToneMapping,
|
|
8
|
-
NearestFilter,
|
|
9
8
|
NoBlending,
|
|
10
|
-
|
|
11
|
-
RGBEEncoding,
|
|
12
|
-
RGBEFormat,
|
|
13
|
-
RGBM16Encoding,
|
|
14
|
-
RGBM7Encoding,
|
|
9
|
+
RGBAFormat,
|
|
15
10
|
UnsignedByteType,
|
|
16
|
-
sRGBEncoding
|
|
11
|
+
sRGBEncoding,
|
|
12
|
+
HalfFloatType
|
|
17
13
|
} from '../constants.js';
|
|
18
14
|
|
|
19
15
|
import { BufferAttribute } from '../core/BufferAttribute.js';
|
|
@@ -48,12 +44,7 @@ const MAX_SAMPLES = 20;
|
|
|
48
44
|
|
|
49
45
|
const ENCODINGS = {
|
|
50
46
|
[ LinearEncoding ]: 0,
|
|
51
|
-
[ sRGBEncoding ]: 1
|
|
52
|
-
[ RGBEEncoding ]: 2,
|
|
53
|
-
[ RGBM7Encoding ]: 3,
|
|
54
|
-
[ RGBM16Encoding ]: 4,
|
|
55
|
-
[ RGBDEncoding ]: 5,
|
|
56
|
-
[ GammaEncoding ]: 6
|
|
47
|
+
[ sRGBEncoding ]: 1
|
|
57
48
|
};
|
|
58
49
|
|
|
59
50
|
const _flatCamera = /*@__PURE__*/ new OrthographicCamera();
|
|
@@ -137,7 +128,7 @@ class PMREMGenerator {
|
|
|
137
128
|
|
|
138
129
|
/**
|
|
139
130
|
* Generates a PMREM from an equirectangular texture, which can be either LDR
|
|
140
|
-
*
|
|
131
|
+
* or HDR. The ideal input image size is 1k (1024 x 512),
|
|
141
132
|
* as this matches best with the 256 x 256 cubemap output.
|
|
142
133
|
*/
|
|
143
134
|
fromEquirectangular( equirectangular ) {
|
|
@@ -148,7 +139,7 @@ class PMREMGenerator {
|
|
|
148
139
|
|
|
149
140
|
/**
|
|
150
141
|
* Generates a PMREM from an cubemap texture, which can be either LDR
|
|
151
|
-
*
|
|
142
|
+
* or HDR. The ideal input cube size is 256 x 256,
|
|
152
143
|
* as this matches best with the 256 x 256 cubemap output.
|
|
153
144
|
*/
|
|
154
145
|
fromCubemap( cubemap ) {
|
|
@@ -233,12 +224,12 @@ class PMREMGenerator {
|
|
|
233
224
|
_allocateTargets( texture ) { // warning: null texture is valid
|
|
234
225
|
|
|
235
226
|
const params = {
|
|
236
|
-
magFilter:
|
|
237
|
-
minFilter:
|
|
227
|
+
magFilter: LinearFilter,
|
|
228
|
+
minFilter: LinearFilter,
|
|
238
229
|
generateMipmaps: false,
|
|
239
|
-
type:
|
|
240
|
-
format:
|
|
241
|
-
encoding:
|
|
230
|
+
type: HalfFloatType,
|
|
231
|
+
format: RGBAFormat,
|
|
232
|
+
encoding: LinearEncoding,
|
|
242
233
|
depthBuffer: false
|
|
243
234
|
};
|
|
244
235
|
|
|
@@ -266,12 +257,10 @@ class PMREMGenerator {
|
|
|
266
257
|
const renderer = this._renderer;
|
|
267
258
|
|
|
268
259
|
const originalAutoClear = renderer.autoClear;
|
|
269
|
-
const outputEncoding = renderer.outputEncoding;
|
|
270
260
|
const toneMapping = renderer.toneMapping;
|
|
271
261
|
renderer.getClearColor( _clearColor );
|
|
272
262
|
|
|
273
263
|
renderer.toneMapping = NoToneMapping;
|
|
274
|
-
renderer.outputEncoding = LinearEncoding;
|
|
275
264
|
renderer.autoClear = false;
|
|
276
265
|
|
|
277
266
|
const backgroundMaterial = new MeshBasicMaterial( {
|
|
@@ -341,7 +330,6 @@ class PMREMGenerator {
|
|
|
341
330
|
backgroundBox.material.dispose();
|
|
342
331
|
|
|
343
332
|
renderer.toneMapping = toneMapping;
|
|
344
|
-
renderer.outputEncoding = outputEncoding;
|
|
345
333
|
renderer.autoClear = originalAutoClear;
|
|
346
334
|
scene.background = background;
|
|
347
335
|
|
|
@@ -349,7 +337,7 @@ class PMREMGenerator {
|
|
|
349
337
|
|
|
350
338
|
_setEncoding( uniform, texture ) {
|
|
351
339
|
|
|
352
|
-
|
|
340
|
+
if ( this._renderer.capabilities.isWebGL2 === true && texture.format === RGBAFormat && texture.type === UnsignedByteType && texture.encoding === sRGBEncoding ) {
|
|
353
341
|
|
|
354
342
|
uniform.value = ENCODINGS[ LinearEncoding ];
|
|
355
343
|
|
|
@@ -357,9 +345,7 @@ class PMREMGenerator {
|
|
|
357
345
|
|
|
358
346
|
uniform.value = ENCODINGS[ texture.encoding ];
|
|
359
347
|
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
uniform.value = ENCODINGS[ texture.encoding ];
|
|
348
|
+
}
|
|
363
349
|
|
|
364
350
|
}
|
|
365
351
|
|
|
@@ -401,7 +387,6 @@ class PMREMGenerator {
|
|
|
401
387
|
}
|
|
402
388
|
|
|
403
389
|
this._setEncoding( uniforms[ 'inputEncoding' ], texture );
|
|
404
|
-
this._setEncoding( uniforms[ 'outputEncoding' ], cubeUVRenderTarget.texture );
|
|
405
390
|
|
|
406
391
|
_setViewport( cubeUVRenderTarget, 0, 0, 3 * SIZE_MAX, 2 * SIZE_MAX );
|
|
407
392
|
|
|
@@ -533,9 +518,6 @@ class PMREMGenerator {
|
|
|
533
518
|
blurUniforms[ 'dTheta' ].value = radiansPerPixel;
|
|
534
519
|
blurUniforms[ 'mipInt' ].value = LOD_MAX - lodIn;
|
|
535
520
|
|
|
536
|
-
this._setEncoding( blurUniforms[ 'inputEncoding' ], targetIn.texture );
|
|
537
|
-
this._setEncoding( blurUniforms[ 'outputEncoding' ], targetIn.texture );
|
|
538
|
-
|
|
539
521
|
const outputSize = _sizeLods[ lodOut ];
|
|
540
522
|
const x = 3 * Math.max( 0, SIZE_MAX - 2 * outputSize );
|
|
541
523
|
const y = ( lodOut === 0 ? 0 : 2 * SIZE_MAX ) + 2 * outputSize * ( lodOut > LOD_MAX - LOD_MIN ? lodOut - LOD_MAX + LOD_MIN : 0 );
|
|
@@ -548,14 +530,6 @@ class PMREMGenerator {
|
|
|
548
530
|
|
|
549
531
|
}
|
|
550
532
|
|
|
551
|
-
function _isLDR( texture ) {
|
|
552
|
-
|
|
553
|
-
if ( texture === undefined || texture.type !== UnsignedByteType ) return false;
|
|
554
|
-
|
|
555
|
-
return texture.encoding === LinearEncoding || texture.encoding === sRGBEncoding || texture.encoding === GammaEncoding;
|
|
556
|
-
|
|
557
|
-
}
|
|
558
|
-
|
|
559
533
|
function _createPlanes() {
|
|
560
534
|
|
|
561
535
|
const _lodPlanes = [];
|
|
@@ -668,9 +642,7 @@ function _getBlurShader( maxSamples ) {
|
|
|
668
642
|
'latitudinal': { value: false },
|
|
669
643
|
'dTheta': { value: 0 },
|
|
670
644
|
'mipInt': { value: 0 },
|
|
671
|
-
'poleAxis': { value: poleAxis }
|
|
672
|
-
'inputEncoding': { value: ENCODINGS[ LinearEncoding ] },
|
|
673
|
-
'outputEncoding': { value: ENCODINGS[ LinearEncoding ] }
|
|
645
|
+
'poleAxis': { value: poleAxis }
|
|
674
646
|
},
|
|
675
647
|
|
|
676
648
|
vertexShader: _getCommonVertexShader(),
|
|
@@ -736,8 +708,6 @@ function _getBlurShader( maxSamples ) {
|
|
|
736
708
|
|
|
737
709
|
}
|
|
738
710
|
|
|
739
|
-
gl_FragColor = linearToOutputTexel( gl_FragColor );
|
|
740
|
-
|
|
741
711
|
}
|
|
742
712
|
`,
|
|
743
713
|
|
|
@@ -761,8 +731,7 @@ function _getEquirectShader() {
|
|
|
761
731
|
uniforms: {
|
|
762
732
|
'envMap': { value: null },
|
|
763
733
|
'texelSize': { value: texelSize },
|
|
764
|
-
'inputEncoding': { value: ENCODINGS[ LinearEncoding ] }
|
|
765
|
-
'outputEncoding': { value: ENCODINGS[ LinearEncoding ] }
|
|
734
|
+
'inputEncoding': { value: ENCODINGS[ LinearEncoding ] }
|
|
766
735
|
},
|
|
767
736
|
|
|
768
737
|
vertexShader: _getCommonVertexShader(),
|
|
@@ -802,8 +771,6 @@ function _getEquirectShader() {
|
|
|
802
771
|
vec3 bm = mix( bl, br, f.x );
|
|
803
772
|
gl_FragColor.rgb = mix( tm, bm, f.y );
|
|
804
773
|
|
|
805
|
-
gl_FragColor = linearToOutputTexel( gl_FragColor );
|
|
806
|
-
|
|
807
774
|
}
|
|
808
775
|
`,
|
|
809
776
|
|
|
@@ -825,8 +792,7 @@ function _getCubemapShader() {
|
|
|
825
792
|
|
|
826
793
|
uniforms: {
|
|
827
794
|
'envMap': { value: null },
|
|
828
|
-
'inputEncoding': { value: ENCODINGS[ LinearEncoding ] }
|
|
829
|
-
'outputEncoding': { value: ENCODINGS[ LinearEncoding ] }
|
|
795
|
+
'inputEncoding': { value: ENCODINGS[ LinearEncoding ] }
|
|
830
796
|
},
|
|
831
797
|
|
|
832
798
|
vertexShader: _getCommonVertexShader(),
|
|
@@ -844,9 +810,7 @@ function _getCubemapShader() {
|
|
|
844
810
|
|
|
845
811
|
void main() {
|
|
846
812
|
|
|
847
|
-
gl_FragColor =
|
|
848
|
-
gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;
|
|
849
|
-
gl_FragColor = linearToOutputTexel( gl_FragColor );
|
|
813
|
+
gl_FragColor = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) );
|
|
850
814
|
|
|
851
815
|
}
|
|
852
816
|
`,
|
|
@@ -929,7 +893,6 @@ function _getEncodings() {
|
|
|
929
893
|
return /* glsl */`
|
|
930
894
|
|
|
931
895
|
uniform int inputEncoding;
|
|
932
|
-
uniform int outputEncoding;
|
|
933
896
|
|
|
934
897
|
#include <encodings_pars_fragment>
|
|
935
898
|
|
|
@@ -939,63 +902,9 @@ function _getEncodings() {
|
|
|
939
902
|
|
|
940
903
|
return value;
|
|
941
904
|
|
|
942
|
-
} else if ( inputEncoding == 1 ) {
|
|
943
|
-
|
|
944
|
-
return sRGBToLinear( value );
|
|
945
|
-
|
|
946
|
-
} else if ( inputEncoding == 2 ) {
|
|
947
|
-
|
|
948
|
-
return RGBEToLinear( value );
|
|
949
|
-
|
|
950
|
-
} else if ( inputEncoding == 3 ) {
|
|
951
|
-
|
|
952
|
-
return RGBMToLinear( value, 7.0 );
|
|
953
|
-
|
|
954
|
-
} else if ( inputEncoding == 4 ) {
|
|
955
|
-
|
|
956
|
-
return RGBMToLinear( value, 16.0 );
|
|
957
|
-
|
|
958
|
-
} else if ( inputEncoding == 5 ) {
|
|
959
|
-
|
|
960
|
-
return RGBDToLinear( value, 256.0 );
|
|
961
|
-
|
|
962
|
-
} else {
|
|
963
|
-
|
|
964
|
-
return GammaToLinear( value, 2.2 );
|
|
965
|
-
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
vec4 linearToOutputTexel( vec4 value ) {
|
|
971
|
-
|
|
972
|
-
if ( outputEncoding == 0 ) {
|
|
973
|
-
|
|
974
|
-
return value;
|
|
975
|
-
|
|
976
|
-
} else if ( outputEncoding == 1 ) {
|
|
977
|
-
|
|
978
|
-
return LinearTosRGB( value );
|
|
979
|
-
|
|
980
|
-
} else if ( outputEncoding == 2 ) {
|
|
981
|
-
|
|
982
|
-
return LinearToRGBE( value );
|
|
983
|
-
|
|
984
|
-
} else if ( outputEncoding == 3 ) {
|
|
985
|
-
|
|
986
|
-
return LinearToRGBM( value, 7.0 );
|
|
987
|
-
|
|
988
|
-
} else if ( outputEncoding == 4 ) {
|
|
989
|
-
|
|
990
|
-
return LinearToRGBM( value, 16.0 );
|
|
991
|
-
|
|
992
|
-
} else if ( outputEncoding == 5 ) {
|
|
993
|
-
|
|
994
|
-
return LinearToRGBD( value, 256.0 );
|
|
995
|
-
|
|
996
905
|
} else {
|
|
997
906
|
|
|
998
|
-
return
|
|
907
|
+
return sRGBToLinear( value );
|
|
999
908
|
|
|
1000
909
|
}
|
|
1001
910
|
|