super-three 0.154.1 → 0.156.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.cjs +360 -160
- package/build/three.js +360 -160
- package/build/three.min.js +1 -1
- package/build/three.module.js +355 -161
- package/build/three.module.min.js +1 -1
- package/examples/jsm/controls/OrbitControls.js +155 -25
- package/examples/jsm/csm/CSMShader.js +35 -1
- package/examples/jsm/environments/RoomEnvironment.js +1 -1
- package/examples/jsm/exporters/USDZExporter.js +1 -0
- package/examples/jsm/interactive/SelectionHelper.js +7 -0
- package/examples/jsm/libs/tween.module.js +790 -735
- package/examples/jsm/libs/utif.module.js +1644 -1558
- package/examples/jsm/loaders/DDSLoader.js +46 -3
- package/examples/jsm/loaders/EXRLoader.js +4 -4
- package/examples/jsm/loaders/FBXLoader.js +3 -1
- package/examples/jsm/loaders/GLTFLoader.js +25 -10
- package/examples/jsm/loaders/KTX2Loader.js +128 -79
- package/examples/jsm/loaders/LDrawLoader.js +1 -1
- package/examples/jsm/loaders/LogLuvLoader.js +2 -2
- package/examples/jsm/loaders/MMDLoader.js +10 -7
- package/examples/jsm/loaders/NRRDLoader.js +3 -3
- package/examples/jsm/loaders/PLYLoader.js +1 -1
- package/examples/jsm/loaders/RGBELoader.js +48 -66
- package/examples/jsm/loaders/STLLoader.js +7 -0
- package/examples/jsm/loaders/TGALoader.js +10 -10
- package/examples/jsm/loaders/VRMLLoader.js +1 -1
- package/examples/jsm/misc/GPUComputationRenderer.js +0 -9
- package/examples/jsm/misc/Volume.js +4 -6
- package/examples/jsm/nodes/Nodes.js +8 -6
- package/examples/jsm/nodes/accessors/BufferAttributeNode.js +29 -3
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +20 -3
- package/examples/jsm/nodes/accessors/ExtendedMaterialNode.js +15 -4
- package/examples/jsm/nodes/accessors/InstanceNode.js +8 -8
- package/examples/jsm/nodes/accessors/LineMaterialNode.js +31 -0
- package/examples/jsm/nodes/accessors/MaterialNode.js +73 -61
- package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +3 -0
- package/examples/jsm/nodes/accessors/Object3DNode.js +2 -2
- package/examples/jsm/nodes/accessors/SceneNode.js +6 -0
- package/examples/jsm/nodes/accessors/TextureNode.js +54 -9
- package/examples/jsm/nodes/accessors/TextureStoreNode.js +29 -0
- package/examples/jsm/nodes/core/AttributeNode.js +2 -2
- package/examples/jsm/nodes/core/LightingModel.js +7 -9
- package/examples/jsm/nodes/core/Node.js +28 -3
- package/examples/jsm/nodes/core/NodeBuilder.js +94 -12
- package/examples/jsm/nodes/core/NodeUniform.js +1 -1
- package/examples/jsm/nodes/core/OutputStructNode.js +58 -0
- package/examples/jsm/nodes/core/PropertyNode.js +6 -0
- package/examples/jsm/nodes/core/StackNode.js +4 -4
- package/examples/jsm/nodes/core/StructTypeNode.js +24 -0
- package/examples/jsm/nodes/display/BumpMapNode.js +77 -0
- package/examples/jsm/nodes/display/NormalMapNode.js +2 -2
- package/examples/jsm/nodes/display/ViewportNode.js +19 -5
- package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +10 -2
- package/examples/jsm/nodes/functions/BSDF/Schlick_to_F0.js +13 -0
- package/examples/jsm/nodes/functions/PhongLightingModel.js +53 -14
- package/examples/jsm/nodes/functions/PhysicalLightingModel.js +236 -97
- package/examples/jsm/nodes/geometry/RangeNode.js +2 -2
- package/examples/jsm/nodes/gpgpu/ComputeNode.js +13 -0
- package/examples/jsm/nodes/lighting/AONode.js +1 -1
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +58 -20
- package/examples/jsm/nodes/lighting/DirectionalLightNode.js +7 -10
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +22 -12
- package/examples/jsm/nodes/lighting/HemisphereLightNode.js +1 -1
- package/examples/jsm/nodes/lighting/LightingContextNode.js +12 -9
- package/examples/jsm/nodes/lighting/PointLightNode.js +7 -10
- package/examples/jsm/nodes/lighting/SpotLightNode.js +7 -10
- package/examples/jsm/nodes/materials/LineDashedNodeMaterial.js +54 -0
- package/examples/jsm/nodes/materials/Materials.js +2 -0
- package/examples/jsm/nodes/materials/MeshLambertNodeMaterial.js +34 -0
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +2 -0
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +19 -2
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/NodeMaterial.js +61 -26
- package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +2 -2
- package/examples/jsm/nodes/math/HashNode.js +35 -0
- package/examples/jsm/nodes/shadernode/ShaderNode.js +6 -2
- package/examples/jsm/nodes/utils/SplitNode.js +1 -1
- package/examples/jsm/objects/Reflector.js +1 -9
- package/examples/jsm/objects/Refractor.js +0 -8
- package/examples/jsm/offscreen/scene.js +0 -1
- package/examples/jsm/postprocessing/FilmPass.js +3 -5
- package/examples/jsm/postprocessing/MaskPass.js +4 -1
- package/examples/jsm/postprocessing/OutputPass.js +33 -14
- package/examples/jsm/postprocessing/RenderPass.js +30 -12
- package/examples/jsm/postprocessing/SAOPass.js +23 -98
- package/examples/jsm/postprocessing/SSAOPass.js +10 -30
- package/examples/jsm/postprocessing/UnrealBloomPass.js +21 -17
- package/examples/jsm/renderers/common/Backend.js +11 -8
- package/examples/jsm/renderers/common/Background.js +22 -20
- package/examples/jsm/renderers/common/Binding.js +14 -0
- package/examples/jsm/renderers/common/Bindings.js +7 -10
- package/examples/jsm/renderers/common/Geometries.js +1 -1
- package/examples/jsm/renderers/common/Pipelines.js +96 -47
- package/examples/jsm/renderers/common/RenderContext.js +1 -0
- package/examples/jsm/renderers/common/RenderContexts.js +41 -5
- package/examples/jsm/renderers/common/RenderList.js +12 -4
- package/examples/jsm/renderers/common/RenderObject.js +26 -6
- package/examples/jsm/renderers/common/RenderObjects.js +10 -7
- package/examples/jsm/renderers/common/Renderer.js +82 -42
- package/examples/jsm/renderers/common/SampledTexture.js +2 -1
- package/examples/jsm/renderers/common/Sampler.js +1 -1
- package/examples/jsm/renderers/common/StorageBuffer.js +1 -1
- package/examples/jsm/renderers/common/Textures.js +172 -20
- package/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +2 -2
- package/examples/jsm/renderers/common/nodes/NodeSampler.js +1 -1
- package/examples/jsm/renderers/common/nodes/Nodes.js +58 -13
- package/examples/jsm/renderers/webgl/WebGLBackend.js +607 -0
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +118 -17
- package/examples/jsm/renderers/webgl/utils/WebGLAttributeUtils.js +84 -0
- package/examples/jsm/renderers/webgl/utils/WebGLExtensions.js +26 -0
- package/examples/jsm/renderers/webgl/utils/WebGLState.js +529 -0
- package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +199 -0
- package/examples/jsm/renderers/webgl/utils/WebGLUtils.js +242 -0
- package/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +340 -0
- package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/WebGLNodeBuilder.js +1 -1
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +320 -84
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +18 -2
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +120 -66
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +2 -2
- package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +55 -36
- package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +96 -5
- package/examples/jsm/renderers/webgpu/utils/WebGPUConstants.js +24 -22
- package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +117 -139
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +60 -142
- package/examples/jsm/renderers/webgpu/utils/WebGPUUtils.js +7 -6
- package/examples/jsm/shaders/FilmShader.js +11 -54
- package/examples/jsm/shaders/OutputShader.js +19 -2
- package/examples/jsm/shaders/SAOShader.js +0 -13
- package/examples/jsm/shaders/SSAOShader.js +33 -26
- package/examples/jsm/utils/BufferGeometryUtils.js +13 -4
- package/examples/jsm/webxr/OculusHandPointerModel.js +2 -2
- package/package.json +2 -2
- package/src/Three.js +3 -0
- package/src/animation/PropertyBinding.js +1 -1
- package/src/audio/Audio.js +6 -0
- package/src/cameras/CubeCamera.js +1 -4
- package/src/constants.js +4 -1
- package/src/core/BufferAttribute.js +20 -0
- package/src/core/Object3D.js +2 -15
- package/src/core/RenderTarget.js +122 -0
- package/src/core/UniformsGroup.js +2 -2
- package/src/geometries/CapsuleGeometry.js +1 -1
- package/src/loaders/DataTextureLoader.js +19 -2
- package/src/materials/Material.js +2 -2
- package/src/math/Vector2.js +2 -2
- package/src/math/Vector3.js +3 -3
- package/src/math/Vector4.js +4 -4
- package/src/objects/Line.js +1 -1
- package/src/objects/Mesh.js +1 -1
- package/src/objects/Points.js +1 -1
- package/src/renderers/WebGLMultipleRenderTargets.js +0 -2
- package/src/renderers/WebGLRenderTarget.js +3 -110
- package/src/renderers/WebGLRenderer.js +83 -57
- package/src/renderers/shaders/ShaderChunk/iridescence_fragment.glsl.js +1 -2
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +11 -1
- package/src/renderers/shaders/ShaderLib/background.glsl.js +8 -0
- package/src/renderers/webgl/WebGLBackground.js +5 -14
- package/src/renderers/webgl/WebGLGeometries.js +5 -1
- package/src/renderers/webgl/WebGLMaterials.js +1 -1
- package/src/renderers/webgl/WebGLProgram.js +2 -0
- package/src/renderers/webgl/WebGLPrograms.js +19 -3
- package/src/renderers/webgl/WebGLTextures.js +101 -16
- package/src/renderers/webgl/WebGLUtils.js +27 -20
- package/src/textures/CompressedCubeTexture.js +19 -0
- package/src/textures/Texture.js +2 -2
- package/src/utils.js +9 -1
- package/examples/jsm/nodes/functions/BSDF/BRDF_BlinnPhong.js +0 -30
- package/examples/jsm/renderers/common/RenderTarget.js +0 -15
- package/examples/jsm/renderers/common/nodes/NodeRender.js +0 -302
- /package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/SlotNode.js +0 -0
- /package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/WebGLNodes.js +0 -0
|
@@ -4,7 +4,9 @@ import {
|
|
|
4
4
|
RGBA_S3TC_DXT3_Format,
|
|
5
5
|
RGBA_S3TC_DXT5_Format,
|
|
6
6
|
RGB_ETC1_Format,
|
|
7
|
-
RGB_S3TC_DXT1_Format
|
|
7
|
+
RGB_S3TC_DXT1_Format,
|
|
8
|
+
RGB_BPTC_SIGNED_Format,
|
|
9
|
+
RGB_BPTC_UNSIGNED_Format
|
|
8
10
|
} from 'three';
|
|
9
11
|
|
|
10
12
|
class DDSLoader extends CompressedTextureLoader {
|
|
@@ -56,6 +58,9 @@ class DDSLoader extends CompressedTextureLoader {
|
|
|
56
58
|
// const DDPF_YUV = 0x200;
|
|
57
59
|
// const DDPF_LUMINANCE = 0x20000;
|
|
58
60
|
|
|
61
|
+
const DXGI_FORMAT_BC6H_UF16 = 95;
|
|
62
|
+
const DXGI_FORMAT_BC6H_SF16 = 96;
|
|
63
|
+
|
|
59
64
|
function fourCCToInt32( value ) {
|
|
60
65
|
|
|
61
66
|
return value.charCodeAt( 0 ) +
|
|
@@ -108,8 +113,10 @@ class DDSLoader extends CompressedTextureLoader {
|
|
|
108
113
|
const FOURCC_DXT3 = fourCCToInt32( 'DXT3' );
|
|
109
114
|
const FOURCC_DXT5 = fourCCToInt32( 'DXT5' );
|
|
110
115
|
const FOURCC_ETC1 = fourCCToInt32( 'ETC1' );
|
|
116
|
+
const FOURCC_DX10 = fourCCToInt32( 'DX10' );
|
|
111
117
|
|
|
112
118
|
const headerLengthInt = 31; // The header length in 32 bit ints
|
|
119
|
+
const extendedHeaderLengthInt = 5; // The extended header length in 32 bit ints
|
|
113
120
|
|
|
114
121
|
// Offsets into the header array
|
|
115
122
|
|
|
@@ -135,6 +142,9 @@ class DDSLoader extends CompressedTextureLoader {
|
|
|
135
142
|
// const off_caps3 = 29;
|
|
136
143
|
// const off_caps4 = 30;
|
|
137
144
|
|
|
145
|
+
// If fourCC = DX10, the extended header starts after 32
|
|
146
|
+
const off_dxgiFormat = 0;
|
|
147
|
+
|
|
138
148
|
// Parse header
|
|
139
149
|
|
|
140
150
|
const header = new Int32Array( buffer, 0, headerLengthInt );
|
|
@@ -152,6 +162,8 @@ class DDSLoader extends CompressedTextureLoader {
|
|
|
152
162
|
|
|
153
163
|
let isRGBAUncompressed = false;
|
|
154
164
|
|
|
165
|
+
let dataOffset = header[ off_size ] + 4;
|
|
166
|
+
|
|
155
167
|
switch ( fourCC ) {
|
|
156
168
|
|
|
157
169
|
case FOURCC_DXT1:
|
|
@@ -178,6 +190,39 @@ class DDSLoader extends CompressedTextureLoader {
|
|
|
178
190
|
dds.format = RGB_ETC1_Format;
|
|
179
191
|
break;
|
|
180
192
|
|
|
193
|
+
case FOURCC_DX10:
|
|
194
|
+
|
|
195
|
+
dataOffset += extendedHeaderLengthInt * 4;
|
|
196
|
+
const extendedHeader = new Int32Array( buffer, ( headerLengthInt + 1 ) * 4, extendedHeaderLengthInt );
|
|
197
|
+
const dxgiFormat = extendedHeader[ off_dxgiFormat ];
|
|
198
|
+
switch ( dxgiFormat ) {
|
|
199
|
+
|
|
200
|
+
case DXGI_FORMAT_BC6H_SF16: {
|
|
201
|
+
|
|
202
|
+
blockBytes = 16;
|
|
203
|
+
dds.format = RGB_BPTC_SIGNED_Format;
|
|
204
|
+
break;
|
|
205
|
+
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
case DXGI_FORMAT_BC6H_UF16: {
|
|
209
|
+
|
|
210
|
+
blockBytes = 16;
|
|
211
|
+
dds.format = RGB_BPTC_UNSIGNED_Format;
|
|
212
|
+
break;
|
|
213
|
+
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
default: {
|
|
217
|
+
|
|
218
|
+
console.error( 'THREE.DDSLoader.parse: Unsupported DXGI_FORMAT code ', dxgiFormat );
|
|
219
|
+
return dds;
|
|
220
|
+
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
}
|
|
224
|
+
break;
|
|
225
|
+
|
|
181
226
|
default:
|
|
182
227
|
|
|
183
228
|
if ( header[ off_RGBBitCount ] === 32
|
|
@@ -226,8 +271,6 @@ class DDSLoader extends CompressedTextureLoader {
|
|
|
226
271
|
dds.width = header[ off_width ];
|
|
227
272
|
dds.height = header[ off_height ];
|
|
228
273
|
|
|
229
|
-
let dataOffset = header[ off_size ] + 4;
|
|
230
|
-
|
|
231
274
|
// Extract mipmaps buffers
|
|
232
275
|
|
|
233
276
|
const faces = dds.isCubemap ? 6 : 1;
|
|
@@ -1996,7 +1996,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
1996
1996
|
|
|
1997
1997
|
if ( dataView.getUint32( 0, true ) != 20000630 ) { // magic
|
|
1998
1998
|
|
|
1999
|
-
throw new Error( 'THREE.EXRLoader:
|
|
1999
|
+
throw new Error( 'THREE.EXRLoader: Provided file doesn\'t appear to be in OpenEXR format.' );
|
|
2000
2000
|
|
|
2001
2001
|
}
|
|
2002
2002
|
|
|
@@ -2033,7 +2033,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2033
2033
|
|
|
2034
2034
|
if ( attributeValue === undefined ) {
|
|
2035
2035
|
|
|
2036
|
-
console.warn( `EXRLoader
|
|
2036
|
+
console.warn( `THREE.EXRLoader: Skipped unknown header attribute type \'${attributeType}\'.` );
|
|
2037
2037
|
|
|
2038
2038
|
} else {
|
|
2039
2039
|
|
|
@@ -2047,8 +2047,8 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2047
2047
|
|
|
2048
2048
|
if ( ( spec & ~ 0x04 ) != 0 ) { // unsupported tiled, deep-image, multi-part
|
|
2049
2049
|
|
|
2050
|
-
console.error( 'EXRHeader:', EXRHeader );
|
|
2051
|
-
throw new Error( 'THREE.EXRLoader:
|
|
2050
|
+
console.error( 'THREE.EXRHeader:', EXRHeader );
|
|
2051
|
+
throw new Error( 'THREE.EXRLoader: Provided file is currently unsupported.' );
|
|
2052
2052
|
|
|
2053
2053
|
}
|
|
2054
2054
|
|
|
@@ -961,6 +961,7 @@ class FBXTreeParser {
|
|
|
961
961
|
}
|
|
962
962
|
|
|
963
963
|
model.name = node.attrName ? PropertyBinding.sanitizeNodeName( node.attrName ) : '';
|
|
964
|
+
model.userData.originalName = node.attrName;
|
|
964
965
|
|
|
965
966
|
model.ID = id;
|
|
966
967
|
|
|
@@ -997,6 +998,7 @@ class FBXTreeParser {
|
|
|
997
998
|
// set name and id here - otherwise in cases where "subBone" is created it will not have a name / id
|
|
998
999
|
|
|
999
1000
|
bone.name = name ? PropertyBinding.sanitizeNodeName( name ) : '';
|
|
1001
|
+
bone.userData.originalName = name;
|
|
1000
1002
|
bone.ID = id;
|
|
1001
1003
|
|
|
1002
1004
|
skeleton.bones[ i ] = bone;
|
|
@@ -1270,7 +1272,7 @@ class FBXTreeParser {
|
|
|
1270
1272
|
|
|
1271
1273
|
} else {
|
|
1272
1274
|
|
|
1273
|
-
material = new MeshPhongMaterial( {
|
|
1275
|
+
material = new MeshPhongMaterial( {
|
|
1274
1276
|
name: Loader.DEFAULT_MATERIAL_NAME,
|
|
1275
1277
|
color: 0xcccccc
|
|
1276
1278
|
} );
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
BufferGeometry,
|
|
7
7
|
ClampToEdgeWrapping,
|
|
8
8
|
Color,
|
|
9
|
+
ColorManagement,
|
|
9
10
|
DirectionalLight,
|
|
10
11
|
DoubleSide,
|
|
11
12
|
FileLoader,
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
LinearFilter,
|
|
26
27
|
LinearMipmapLinearFilter,
|
|
27
28
|
LinearMipmapNearestFilter,
|
|
29
|
+
LinearSRGBColorSpace,
|
|
28
30
|
Loader,
|
|
29
31
|
LoaderUtils,
|
|
30
32
|
Material,
|
|
@@ -545,7 +547,7 @@ class GLTFLightsExtension {
|
|
|
545
547
|
|
|
546
548
|
const color = new Color( 0xffffff );
|
|
547
549
|
|
|
548
|
-
if ( lightDef.color !== undefined ) color.
|
|
550
|
+
if ( lightDef.color !== undefined ) color.setRGB( lightDef.color[ 0 ], lightDef.color[ 1 ], lightDef.color[ 2 ], LinearSRGBColorSpace );
|
|
549
551
|
|
|
550
552
|
const range = lightDef.range !== undefined ? lightDef.range : 0;
|
|
551
553
|
|
|
@@ -663,7 +665,7 @@ class GLTFMaterialsUnlitExtension {
|
|
|
663
665
|
|
|
664
666
|
const array = metallicRoughness.baseColorFactor;
|
|
665
667
|
|
|
666
|
-
materialParams.color.
|
|
668
|
+
materialParams.color.setRGB( array[ 0 ], array[ 1 ], array[ 2 ], LinearSRGBColorSpace );
|
|
667
669
|
materialParams.opacity = array[ 3 ];
|
|
668
670
|
|
|
669
671
|
}
|
|
@@ -939,7 +941,8 @@ class GLTFMaterialsSheenExtension {
|
|
|
939
941
|
|
|
940
942
|
if ( extension.sheenColorFactor !== undefined ) {
|
|
941
943
|
|
|
942
|
-
|
|
944
|
+
const colorFactor = extension.sheenColorFactor;
|
|
945
|
+
materialParams.sheenColor.setRGB( colorFactor[ 0 ], colorFactor[ 1 ], colorFactor [ 2 ], LinearSRGBColorSpace );
|
|
943
946
|
|
|
944
947
|
}
|
|
945
948
|
|
|
@@ -1077,7 +1080,7 @@ class GLTFMaterialsVolumeExtension {
|
|
|
1077
1080
|
materialParams.attenuationDistance = extension.attenuationDistance || Infinity;
|
|
1078
1081
|
|
|
1079
1082
|
const colorArray = extension.attenuationColor || [ 1, 1, 1 ];
|
|
1080
|
-
materialParams.attenuationColor = new Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] );
|
|
1083
|
+
materialParams.attenuationColor = new Color().setRGB( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ], LinearSRGBColorSpace );
|
|
1081
1084
|
|
|
1082
1085
|
return Promise.all( pending );
|
|
1083
1086
|
|
|
@@ -1180,7 +1183,7 @@ class GLTFMaterialsSpecularExtension {
|
|
|
1180
1183
|
}
|
|
1181
1184
|
|
|
1182
1185
|
const colorArray = extension.specularColorFactor || [ 1, 1, 1 ];
|
|
1183
|
-
materialParams.specularColor = new Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] );
|
|
1186
|
+
materialParams.specularColor = new Color().setRGB( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ], LinearSRGBColorSpace );
|
|
1184
1187
|
|
|
1185
1188
|
if ( extension.specularColorTexture !== undefined ) {
|
|
1186
1189
|
|
|
@@ -3386,7 +3389,7 @@ class GLTFParser {
|
|
|
3386
3389
|
|
|
3387
3390
|
const array = metallicRoughness.baseColorFactor;
|
|
3388
3391
|
|
|
3389
|
-
materialParams.color.
|
|
3392
|
+
materialParams.color.setRGB( array[ 0 ], array[ 1 ], array[ 2 ], LinearSRGBColorSpace );
|
|
3390
3393
|
materialParams.opacity = array[ 3 ];
|
|
3391
3394
|
|
|
3392
3395
|
}
|
|
@@ -3478,7 +3481,8 @@ class GLTFParser {
|
|
|
3478
3481
|
|
|
3479
3482
|
if ( materialDef.emissiveFactor !== undefined && materialType !== MeshBasicMaterial ) {
|
|
3480
3483
|
|
|
3481
|
-
|
|
3484
|
+
const emissiveFactor = materialDef.emissiveFactor;
|
|
3485
|
+
materialParams.emissive = new Color().setRGB( emissiveFactor[ 0 ], emissiveFactor[ 1 ], emissiveFactor[ 2 ], LinearSRGBColorSpace );
|
|
3482
3486
|
|
|
3483
3487
|
}
|
|
3484
3488
|
|
|
@@ -3918,7 +3922,6 @@ class GLTFParser {
|
|
|
3918
3922
|
if ( node.updateMatrix ) {
|
|
3919
3923
|
|
|
3920
3924
|
node.updateMatrix();
|
|
3921
|
-
node.matrixAutoUpdate = true;
|
|
3922
3925
|
|
|
3923
3926
|
}
|
|
3924
3927
|
|
|
@@ -4267,7 +4270,6 @@ class GLTFParser {
|
|
|
4267
4270
|
const tracks = [];
|
|
4268
4271
|
|
|
4269
4272
|
const targetName = node.name ? node.name : node.uuid;
|
|
4270
|
-
|
|
4271
4273
|
const targetNames = [];
|
|
4272
4274
|
|
|
4273
4275
|
if ( PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.weights ) {
|
|
@@ -4304,7 +4306,12 @@ class GLTFParser {
|
|
|
4304
4306
|
|
|
4305
4307
|
case PATH_PROPERTIES.position:
|
|
4306
4308
|
case PATH_PROPERTIES.scale:
|
|
4309
|
+
|
|
4310
|
+
TypedKeyframeTrack = VectorKeyframeTrack;
|
|
4311
|
+
break;
|
|
4312
|
+
|
|
4307
4313
|
default:
|
|
4314
|
+
|
|
4308
4315
|
switch ( outputAccessor.itemSize ) {
|
|
4309
4316
|
|
|
4310
4317
|
case 1:
|
|
@@ -4312,6 +4319,7 @@ class GLTFParser {
|
|
|
4312
4319
|
break;
|
|
4313
4320
|
case 2:
|
|
4314
4321
|
case 3:
|
|
4322
|
+
default:
|
|
4315
4323
|
TypedKeyframeTrack = VectorKeyframeTrack;
|
|
4316
4324
|
break;
|
|
4317
4325
|
|
|
@@ -4323,6 +4331,7 @@ class GLTFParser {
|
|
|
4323
4331
|
|
|
4324
4332
|
const interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : InterpolateLinear;
|
|
4325
4333
|
|
|
4334
|
+
|
|
4326
4335
|
const outputArray = this._getArrayFromAccessor( outputAccessor );
|
|
4327
4336
|
|
|
4328
4337
|
for ( let j = 0, jl = targetNames.length; j < jl; j ++ ) {
|
|
@@ -4335,7 +4344,7 @@ class GLTFParser {
|
|
|
4335
4344
|
);
|
|
4336
4345
|
|
|
4337
4346
|
// Override interpolation with custom factory method.
|
|
4338
|
-
if ( interpolation === 'CUBICSPLINE' ) {
|
|
4347
|
+
if ( sampler.interpolation === 'CUBICSPLINE' ) {
|
|
4339
4348
|
|
|
4340
4349
|
this._createCubicSplineTrackInterpolant( track );
|
|
4341
4350
|
|
|
@@ -4554,6 +4563,12 @@ function addPrimitiveAttributes( geometry, primitiveDef, parser ) {
|
|
|
4554
4563
|
|
|
4555
4564
|
}
|
|
4556
4565
|
|
|
4566
|
+
if ( ColorManagement.workingColorSpace !== LinearSRGBColorSpace && 'COLOR_0' in attributes ) {
|
|
4567
|
+
|
|
4568
|
+
console.warn( `THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${ColorManagement.workingColorSpace}" not supported.` );
|
|
4569
|
+
|
|
4570
|
+
}
|
|
4571
|
+
|
|
4557
4572
|
assignExtrasToUserData( geometry, primitiveDef );
|
|
4558
4573
|
|
|
4559
4574
|
computeBounds( geometry, primitiveDef, parser );
|
|
@@ -14,14 +14,18 @@
|
|
|
14
14
|
import {
|
|
15
15
|
CompressedTexture,
|
|
16
16
|
CompressedArrayTexture,
|
|
17
|
+
CompressedCubeTexture,
|
|
17
18
|
Data3DTexture,
|
|
18
19
|
DataTexture,
|
|
20
|
+
DisplayP3ColorSpace,
|
|
19
21
|
FileLoader,
|
|
20
22
|
FloatType,
|
|
21
23
|
HalfFloatType,
|
|
22
24
|
NoColorSpace,
|
|
23
25
|
LinearFilter,
|
|
24
26
|
LinearMipmapLinearFilter,
|
|
27
|
+
LinearDisplayP3ColorSpace,
|
|
28
|
+
LinearSRGBColorSpace,
|
|
25
29
|
Loader,
|
|
26
30
|
RedFormat,
|
|
27
31
|
RGB_ETC1_Format,
|
|
@@ -29,6 +33,7 @@ import {
|
|
|
29
33
|
RGB_PVRTC_4BPPV1_Format,
|
|
30
34
|
RGB_S3TC_DXT1_Format,
|
|
31
35
|
RGBA_ASTC_4x4_Format,
|
|
36
|
+
RGBA_ASTC_6x6_Format,
|
|
32
37
|
RGBA_BPTC_Format,
|
|
33
38
|
RGBA_ETC2_EAC_Format,
|
|
34
39
|
RGBA_PVRTC_4BPPV1_Format,
|
|
@@ -58,6 +63,11 @@ import {
|
|
|
58
63
|
VK_FORMAT_R8G8_UNORM,
|
|
59
64
|
VK_FORMAT_R8G8B8A8_SRGB,
|
|
60
65
|
VK_FORMAT_R8G8B8A8_UNORM,
|
|
66
|
+
VK_FORMAT_ASTC_6x6_SRGB_BLOCK,
|
|
67
|
+
VK_FORMAT_ASTC_6x6_UNORM_BLOCK,
|
|
68
|
+
KHR_DF_PRIMARIES_UNSPECIFIED,
|
|
69
|
+
KHR_DF_PRIMARIES_BT709,
|
|
70
|
+
KHR_DF_PRIMARIES_DISPLAYP3
|
|
61
71
|
} from '../libs/ktx-parse.module.js';
|
|
62
72
|
import { ZSTDDecoder } from '../libs/zstddec.module.js';
|
|
63
73
|
|
|
@@ -253,7 +263,7 @@ class KTX2Loader extends Loader {
|
|
|
253
263
|
|
|
254
264
|
_createTextureFrom( transcodeResult, container ) {
|
|
255
265
|
|
|
256
|
-
const { faces, width, height, format, type, error,
|
|
266
|
+
const { faces, width, height, format, type, error, dfdFlags } = transcodeResult;
|
|
257
267
|
|
|
258
268
|
if ( type === 'error' ) return Promise.reject( error );
|
|
259
269
|
|
|
@@ -261,10 +271,7 @@ class KTX2Loader extends Loader {
|
|
|
261
271
|
|
|
262
272
|
if ( container.faceCount === 6 ) {
|
|
263
273
|
|
|
264
|
-
texture = new
|
|
265
|
-
texture.image = faces;
|
|
266
|
-
texture.format = format;
|
|
267
|
-
texture.type = UnsignedByteType;
|
|
274
|
+
texture = new CompressedCubeTexture( faces, format, UnsignedByteType );
|
|
268
275
|
|
|
269
276
|
} else {
|
|
270
277
|
|
|
@@ -281,8 +288,7 @@ class KTX2Loader extends Loader {
|
|
|
281
288
|
texture.generateMipmaps = false;
|
|
282
289
|
|
|
283
290
|
texture.needsUpdate = true;
|
|
284
|
-
|
|
285
|
-
texture.colorSpace = dfdTransferFn === KHR_DF_TRANSFER_SRGB ? SRGBColorSpace : NoColorSpace;
|
|
291
|
+
texture.colorSpace = parseColorSpace( container );
|
|
286
292
|
texture.premultiplyAlpha = !! ( dfdFlags & KHR_DF_FLAG_ALPHA_PREMULTIPLIED );
|
|
287
293
|
|
|
288
294
|
return texture;
|
|
@@ -300,31 +306,7 @@ class KTX2Loader extends Loader {
|
|
|
300
306
|
|
|
301
307
|
if ( container.vkFormat !== VK_FORMAT_UNDEFINED ) {
|
|
302
308
|
|
|
303
|
-
|
|
304
|
-
const pendings = [];
|
|
305
|
-
|
|
306
|
-
for ( let levelIndex = 0; levelIndex < container.levels.length; levelIndex ++ ) {
|
|
307
|
-
|
|
308
|
-
pendings.push( createDataTexture( container, levelIndex ).then( function ( dataTexture ) {
|
|
309
|
-
|
|
310
|
-
mipmaps[ levelIndex ] = dataTexture;
|
|
311
|
-
|
|
312
|
-
} ) );
|
|
313
|
-
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
await Promise.all( pendings );
|
|
317
|
-
|
|
318
|
-
const texture = mipmaps[ 0 ];
|
|
319
|
-
texture.mipmaps = mipmaps.map( dt => {
|
|
320
|
-
return {
|
|
321
|
-
data: dt.source.data,
|
|
322
|
-
width: dt.source.data.width,
|
|
323
|
-
height: dt.source.data.height,
|
|
324
|
-
depth: dt.source.data.depth
|
|
325
|
-
};
|
|
326
|
-
} );
|
|
327
|
-
return texture;
|
|
309
|
+
return createRawTexture( container );
|
|
328
310
|
|
|
329
311
|
}
|
|
330
312
|
|
|
@@ -426,9 +408,9 @@ KTX2Loader.BasisWorker = function () {
|
|
|
426
408
|
|
|
427
409
|
try {
|
|
428
410
|
|
|
429
|
-
const { faces, buffers, width, height, hasAlpha, format,
|
|
411
|
+
const { faces, buffers, width, height, hasAlpha, format, dfdFlags } = transcode( message.buffer );
|
|
430
412
|
|
|
431
|
-
self.postMessage( { type: 'transcode', id: message.id, faces, width, height, hasAlpha, format,
|
|
413
|
+
self.postMessage( { type: 'transcode', id: message.id, faces, width, height, hasAlpha, format, dfdFlags }, buffers );
|
|
432
414
|
|
|
433
415
|
} catch ( error ) {
|
|
434
416
|
|
|
@@ -491,7 +473,6 @@ KTX2Loader.BasisWorker = function () {
|
|
|
491
473
|
const levelCount = ktx2File.getLevels();
|
|
492
474
|
const faceCount = ktx2File.getFaces();
|
|
493
475
|
const hasAlpha = ktx2File.getHasAlpha();
|
|
494
|
-
const dfdTransferFn = ktx2File.getDFDTransferFunc();
|
|
495
476
|
const dfdFlags = ktx2File.getDFDFlags();
|
|
496
477
|
|
|
497
478
|
const { transcoderFormat, engineFormat } = getTranscoderFormat( basisFormat, width, height, hasAlpha );
|
|
@@ -575,7 +556,7 @@ KTX2Loader.BasisWorker = function () {
|
|
|
575
556
|
|
|
576
557
|
cleanup();
|
|
577
558
|
|
|
578
|
-
return { faces, buffers, width, height, hasAlpha, format: engineFormat,
|
|
559
|
+
return { faces, buffers, width, height, hasAlpha, format: engineFormat, dfdFlags };
|
|
579
560
|
|
|
580
561
|
}
|
|
581
562
|
|
|
@@ -730,7 +711,10 @@ KTX2Loader.BasisWorker = function () {
|
|
|
730
711
|
};
|
|
731
712
|
|
|
732
713
|
//
|
|
733
|
-
//
|
|
714
|
+
// Parsing for non-Basis textures. These textures are may have supercompression
|
|
715
|
+
// like Zstd, but they do not require transcoding.
|
|
716
|
+
|
|
717
|
+
const UNCOMPRESSED_FORMATS = new Set( [ RGBAFormat, RGFormat, RedFormat ] );
|
|
734
718
|
|
|
735
719
|
const FORMAT_MAP = {
|
|
736
720
|
|
|
@@ -749,6 +733,9 @@ const FORMAT_MAP = {
|
|
|
749
733
|
[ VK_FORMAT_R8_SRGB ]: RedFormat,
|
|
750
734
|
[ VK_FORMAT_R8_UNORM ]: RedFormat,
|
|
751
735
|
|
|
736
|
+
[ VK_FORMAT_ASTC_6x6_SRGB_BLOCK ]: RGBA_ASTC_6x6_Format,
|
|
737
|
+
[ VK_FORMAT_ASTC_6x6_UNORM_BLOCK ]: RGBA_ASTC_6x6_Format,
|
|
738
|
+
|
|
752
739
|
};
|
|
753
740
|
|
|
754
741
|
const TYPE_MAP = {
|
|
@@ -768,22 +755,14 @@ const TYPE_MAP = {
|
|
|
768
755
|
[ VK_FORMAT_R8_SRGB ]: UnsignedByteType,
|
|
769
756
|
[ VK_FORMAT_R8_UNORM ]: UnsignedByteType,
|
|
770
757
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
const COLOR_SPACE_MAP = {
|
|
774
|
-
|
|
775
|
-
[ VK_FORMAT_R8G8B8A8_SRGB ]: SRGBColorSpace,
|
|
776
|
-
[ VK_FORMAT_R8G8_SRGB ]: SRGBColorSpace,
|
|
777
|
-
[ VK_FORMAT_R8_SRGB ]: SRGBColorSpace,
|
|
758
|
+
[ VK_FORMAT_ASTC_6x6_SRGB_BLOCK ]: UnsignedByteType,
|
|
759
|
+
[ VK_FORMAT_ASTC_6x6_UNORM_BLOCK ]: UnsignedByteType,
|
|
778
760
|
|
|
779
761
|
};
|
|
780
762
|
|
|
781
|
-
async function
|
|
763
|
+
async function createRawTexture( container ) {
|
|
782
764
|
|
|
783
765
|
const { vkFormat } = container;
|
|
784
|
-
const pixelWidth = Math.max( 1, container.pixelWidth >> levelIndex );
|
|
785
|
-
const pixelHeight = Math.max( 1, container.pixelHeight >> levelIndex );
|
|
786
|
-
const pixelDepth = Math.max( 1, container.pixelDepth >> levelIndex );
|
|
787
766
|
|
|
788
767
|
if ( FORMAT_MAP[ vkFormat ] === undefined ) {
|
|
789
768
|
|
|
@@ -791,16 +770,11 @@ async function createDataTexture( container, levelIndex = 0 ) {
|
|
|
791
770
|
|
|
792
771
|
}
|
|
793
772
|
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
let levelData;
|
|
797
|
-
let view;
|
|
798
|
-
|
|
799
|
-
if ( container.supercompressionScheme === KHR_SUPERCOMPRESSION_NONE ) {
|
|
773
|
+
//
|
|
800
774
|
|
|
801
|
-
|
|
775
|
+
let zstd;
|
|
802
776
|
|
|
803
|
-
|
|
777
|
+
if ( container.supercompressionScheme === KHR_SUPERCOMPRESSION_ZSTD ) {
|
|
804
778
|
|
|
805
779
|
if ( ! _zstd ) {
|
|
806
780
|
|
|
@@ -814,49 +788,99 @@ async function createDataTexture( container, levelIndex = 0 ) {
|
|
|
814
788
|
|
|
815
789
|
}
|
|
816
790
|
|
|
817
|
-
|
|
791
|
+
zstd = await _zstd;
|
|
818
792
|
|
|
819
|
-
}
|
|
793
|
+
}
|
|
820
794
|
|
|
821
|
-
|
|
795
|
+
//
|
|
822
796
|
|
|
823
|
-
|
|
797
|
+
const mipmaps = [];
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
for ( let levelIndex = 0; levelIndex < container.levels.length; levelIndex ++ ) {
|
|
801
|
+
|
|
802
|
+
const levelWidth = Math.max( 1, container.pixelWidth >> levelIndex );
|
|
803
|
+
const levelHeight = Math.max( 1, container.pixelHeight >> levelIndex );
|
|
804
|
+
const levelDepth = container.pixelDepth ? Math.max( 1, container.pixelDepth >> levelIndex ) : 0;
|
|
805
|
+
|
|
806
|
+
const level = container.levels[ levelIndex ];
|
|
807
|
+
|
|
808
|
+
let levelData;
|
|
824
809
|
|
|
825
|
-
|
|
810
|
+
if ( container.supercompressionScheme === KHR_SUPERCOMPRESSION_NONE ) {
|
|
826
811
|
|
|
827
|
-
|
|
812
|
+
levelData = level.levelData;
|
|
828
813
|
|
|
829
|
-
|
|
830
|
-
levelData.byteOffset,
|
|
831
|
-
levelData.byteLength / Float32Array.BYTES_PER_ELEMENT
|
|
814
|
+
} else if ( container.supercompressionScheme === KHR_SUPERCOMPRESSION_ZSTD ) {
|
|
832
815
|
|
|
833
|
-
|
|
816
|
+
levelData = zstd.decode( level.levelData, level.uncompressedByteLength );
|
|
834
817
|
|
|
835
|
-
|
|
818
|
+
} else {
|
|
819
|
+
|
|
820
|
+
throw new Error( 'THREE.KTX2Loader: Unsupported supercompressionScheme.' );
|
|
821
|
+
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
let data;
|
|
836
825
|
|
|
837
|
-
|
|
826
|
+
if ( TYPE_MAP[ vkFormat ] === FloatType ) {
|
|
827
|
+
|
|
828
|
+
data = new Float32Array(
|
|
829
|
+
|
|
830
|
+
levelData.buffer,
|
|
831
|
+
levelData.byteOffset,
|
|
832
|
+
levelData.byteLength / Float32Array.BYTES_PER_ELEMENT
|
|
833
|
+
|
|
834
|
+
);
|
|
838
835
|
|
|
839
|
-
|
|
840
|
-
levelData.byteOffset,
|
|
841
|
-
levelData.byteLength / Uint16Array.BYTES_PER_ELEMENT
|
|
836
|
+
} else if ( TYPE_MAP[ vkFormat ] === HalfFloatType ) {
|
|
842
837
|
|
|
843
|
-
|
|
838
|
+
data = new Uint16Array(
|
|
839
|
+
|
|
840
|
+
levelData.buffer,
|
|
841
|
+
levelData.byteOffset,
|
|
842
|
+
levelData.byteLength / Uint16Array.BYTES_PER_ELEMENT
|
|
843
|
+
|
|
844
|
+
);
|
|
845
|
+
|
|
846
|
+
} else {
|
|
847
|
+
|
|
848
|
+
data = levelData;
|
|
849
|
+
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
mipmaps.push( {
|
|
853
|
+
|
|
854
|
+
data: data,
|
|
855
|
+
width: levelWidth,
|
|
856
|
+
height: levelHeight,
|
|
857
|
+
depth: levelDepth,
|
|
858
|
+
|
|
859
|
+
} );
|
|
860
|
+
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
let texture;
|
|
864
|
+
|
|
865
|
+
if ( UNCOMPRESSED_FORMATS.has( FORMAT_MAP[ vkFormat ] ) ) {
|
|
866
|
+
|
|
867
|
+
texture = container.pixelDepth === 0
|
|
868
|
+
? new DataTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight )
|
|
869
|
+
: new Data3DTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight, container.pixelDepth );
|
|
844
870
|
|
|
845
871
|
} else {
|
|
846
872
|
|
|
847
|
-
|
|
873
|
+
if ( container.pixelDepth > 0 ) throw new Error( 'THREE.KTX2Loader: Unsupported pixelDepth.' );
|
|
874
|
+
|
|
875
|
+
texture = new CompressedTexture( mipmaps, container.pixelWidth, container.pixelHeight );
|
|
848
876
|
|
|
849
877
|
}
|
|
850
|
-
//
|
|
851
878
|
|
|
852
|
-
|
|
853
|
-
? new DataTexture( view, pixelWidth, pixelHeight )
|
|
854
|
-
: new Data3DTexture( view, pixelWidth, pixelHeight, pixelDepth );
|
|
879
|
+
texture.mipmaps = mipmaps;
|
|
855
880
|
|
|
856
881
|
texture.type = TYPE_MAP[ vkFormat ];
|
|
857
882
|
texture.format = FORMAT_MAP[ vkFormat ];
|
|
858
|
-
texture.colorSpace =
|
|
859
|
-
|
|
883
|
+
texture.colorSpace = parseColorSpace( container );
|
|
860
884
|
texture.needsUpdate = true;
|
|
861
885
|
|
|
862
886
|
//
|
|
@@ -865,4 +889,29 @@ async function createDataTexture( container, levelIndex = 0 ) {
|
|
|
865
889
|
|
|
866
890
|
}
|
|
867
891
|
|
|
892
|
+
function parseColorSpace( container ) {
|
|
893
|
+
|
|
894
|
+
const dfd = container.dataFormatDescriptor[ 0 ];
|
|
895
|
+
|
|
896
|
+
if ( dfd.colorPrimaries === KHR_DF_PRIMARIES_BT709 ) {
|
|
897
|
+
|
|
898
|
+
return dfd.transferFunction === KHR_DF_TRANSFER_SRGB ? SRGBColorSpace : LinearSRGBColorSpace;
|
|
899
|
+
|
|
900
|
+
} else if ( dfd.colorPrimaries === KHR_DF_PRIMARIES_DISPLAYP3 ) {
|
|
901
|
+
|
|
902
|
+
return dfd.transferFunction === KHR_DF_TRANSFER_SRGB ? DisplayP3ColorSpace : LinearDisplayP3ColorSpace;
|
|
903
|
+
|
|
904
|
+
} else if ( dfd.colorPrimaries === KHR_DF_PRIMARIES_UNSPECIFIED ) {
|
|
905
|
+
|
|
906
|
+
return NoColorSpace;
|
|
907
|
+
|
|
908
|
+
} else {
|
|
909
|
+
|
|
910
|
+
console.warn( `THREE.KTX2Loader: Unsupported color primaries, "${ dfd.colorPrimaries }"` );
|
|
911
|
+
return NoColorSpace;
|
|
912
|
+
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
}
|
|
916
|
+
|
|
868
917
|
export { KTX2Loader };
|
|
@@ -393,7 +393,7 @@ UTIF.toRGBA = function ( out, type ) {
|
|
|
393
393
|
break;
|
|
394
394
|
|
|
395
395
|
default:
|
|
396
|
-
|
|
396
|
+
throw new Error( 'THREE.LogLuvLoader: Unsupported texture data type: ' + type );
|
|
397
397
|
|
|
398
398
|
}
|
|
399
399
|
|
|
@@ -451,7 +451,7 @@ UTIF.toRGBA = function ( out, type ) {
|
|
|
451
451
|
|
|
452
452
|
} else {
|
|
453
453
|
|
|
454
|
-
|
|
454
|
+
throw new Error( 'THREE.LogLuvLoader: Unsupported Photometric interpretation: ' + intp );
|
|
455
455
|
|
|
456
456
|
}
|
|
457
457
|
|