super-three 0.163.0 → 0.165.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/README.md +3 -3
- package/build/three.cjs +1127 -452
- package/build/three.module.js +1127 -452
- package/build/three.module.min.js +2 -2
- package/examples/jsm/animation/CCDIKSolver.js +4 -2
- package/examples/jsm/controls/TransformControls.js +1 -1
- package/examples/jsm/environments/RoomEnvironment.js +1 -5
- package/examples/jsm/exporters/GLTFExporter.js +45 -1
- package/examples/jsm/exporters/USDZExporter.js +13 -5
- package/examples/jsm/helpers/ViewHelper.js +32 -67
- package/examples/jsm/libs/draco/README.md +2 -2
- package/examples/jsm/libs/tween.module.js +75 -64
- package/examples/jsm/lines/LineMaterial.js +1 -15
- package/examples/jsm/lines/LineSegments2.js +15 -0
- package/examples/jsm/lines/Wireframe.js +16 -1
- package/examples/jsm/loaders/DRACOLoader.js +1 -1
- package/examples/jsm/loaders/EXRLoader.js +283 -99
- package/examples/jsm/loaders/FBXLoader.js +24 -13
- package/examples/jsm/loaders/GLTFLoader.js +55 -0
- package/examples/jsm/loaders/KTX2Loader.js +3 -6
- package/examples/jsm/loaders/LDrawLoader.js +3 -2
- package/examples/jsm/loaders/MMDLoader.js +31 -12
- package/examples/jsm/loaders/VRMLLoader.js +1 -1
- package/examples/jsm/loaders/lwo/IFFParser.js +8 -5
- package/examples/jsm/materials/MeshGouraudMaterial.js +7 -1
- package/examples/jsm/math/Octree.js +26 -20
- package/examples/jsm/modifiers/CurveModifier.js +11 -9
- package/examples/jsm/nodes/Nodes.js +15 -13
- package/examples/jsm/nodes/accessors/AccessorsUtils.js +16 -1
- package/examples/jsm/nodes/accessors/BitangentNode.js +7 -83
- package/examples/jsm/nodes/accessors/BufferNode.js +6 -0
- package/examples/jsm/nodes/accessors/CameraNode.js +12 -119
- package/examples/jsm/nodes/accessors/ClippingNode.js +3 -2
- package/examples/jsm/nodes/accessors/MaterialNode.js +109 -3
- package/examples/jsm/nodes/accessors/ModelNode.js +3 -0
- package/examples/jsm/nodes/accessors/NormalNode.js +9 -101
- package/examples/jsm/nodes/accessors/PositionNode.js +6 -100
- package/examples/jsm/nodes/accessors/ReferenceNode.js +6 -0
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +2 -31
- package/examples/jsm/nodes/accessors/StorageBufferNode.js +9 -0
- package/examples/jsm/nodes/accessors/{TextureStoreNode.js → StorageTextureNode.js} +19 -6
- package/examples/jsm/nodes/accessors/TangentNode.js +11 -97
- package/examples/jsm/nodes/accessors/Texture3DNode.js +100 -0
- package/examples/jsm/nodes/accessors/TextureNode.js +21 -3
- package/examples/jsm/nodes/accessors/TextureSizeNode.js +1 -1
- package/examples/jsm/nodes/accessors/UVNode.js +2 -46
- package/examples/jsm/nodes/code/FunctionNode.js +0 -8
- package/examples/jsm/nodes/core/AttributeNode.js +15 -3
- package/examples/jsm/nodes/core/ContextNode.js +6 -0
- package/examples/jsm/nodes/core/Node.js +23 -2
- package/examples/jsm/nodes/core/NodeBuilder.js +25 -18
- package/examples/jsm/nodes/core/NodeKeywords.js +1 -1
- package/examples/jsm/nodes/core/OutputStructNode.js +3 -6
- package/examples/jsm/nodes/core/PropertyNode.js +11 -0
- package/examples/jsm/nodes/core/VaryingNode.js +40 -9
- package/examples/jsm/nodes/display/AfterImageNode.js +14 -2
- package/examples/jsm/nodes/display/BumpMapNode.js +7 -26
- package/examples/jsm/nodes/display/FrontFacingNode.js +13 -0
- package/examples/jsm/nodes/display/PassNode.js +3 -1
- package/examples/jsm/nodes/display/ViewportDepthNode.js +1 -1
- package/examples/jsm/nodes/display/ViewportNode.js +5 -3
- package/examples/jsm/nodes/display/ViewportTextureNode.js +4 -1
- package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +26 -7
- package/examples/jsm/nodes/functions/BSDF/D_GGX_Anisotropic.js +28 -0
- package/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +1 -3
- package/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +29 -0
- package/examples/jsm/nodes/functions/PhongLightingModel.js +1 -1
- package/examples/jsm/nodes/functions/PhysicalLightingModel.js +210 -12
- package/examples/jsm/nodes/functions/ShadowMaskModel.js +31 -0
- package/examples/jsm/nodes/functions/ToonLightingModel.js +49 -0
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +20 -5
- package/examples/jsm/nodes/lighting/DirectionalLightNode.js +2 -1
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +11 -2
- package/examples/jsm/nodes/lighting/IrradianceNode.js +24 -0
- package/examples/jsm/nodes/lighting/LightsNode.js +28 -1
- package/examples/jsm/nodes/lighting/PointLightNode.js +2 -1
- package/examples/jsm/nodes/lighting/SpotLightNode.js +2 -1
- package/examples/jsm/nodes/materials/Line2NodeMaterial.js +11 -7
- package/examples/jsm/nodes/materials/Materials.js +4 -0
- package/examples/jsm/nodes/materials/MeshMatcapNodeMaterial.js +52 -0
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +0 -2
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +94 -6
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +11 -4
- package/examples/jsm/nodes/materials/MeshToonNodeMaterial.js +34 -0
- package/examples/jsm/nodes/materials/NodeMaterial.js +43 -45
- package/examples/jsm/nodes/materials/ShadowNodeMaterial.js +34 -0
- package/examples/jsm/nodes/materials/VolumeNodeMaterial.js +106 -0
- package/examples/jsm/nodes/math/HashNode.js +2 -2
- package/examples/jsm/nodes/pmrem/PMREMUtils.js +1 -1
- package/examples/jsm/nodes/shadernode/ShaderNode.js +57 -41
- package/examples/jsm/nodes/utils/ArrayElementNode.js +1 -1
- package/examples/jsm/nodes/utils/MatcapUVNode.js +1 -1
- package/examples/jsm/nodes/utils/TimerNode.js +1 -1
- package/examples/jsm/objects/Lensflare.js +2 -2
- package/examples/jsm/physics/JoltPhysics.js +281 -0
- package/examples/jsm/postprocessing/RenderPass.js +1 -1
- package/examples/jsm/postprocessing/RenderTransitionPass.js +193 -0
- package/examples/jsm/renderers/CSS2DRenderer.js +25 -5
- package/examples/jsm/renderers/CSS3DRenderer.js +24 -3
- package/examples/jsm/renderers/common/Attributes.js +2 -0
- package/examples/jsm/renderers/common/Background.js +3 -3
- package/examples/jsm/renderers/common/Bindings.js +17 -0
- package/examples/jsm/renderers/common/ChainMap.js +18 -48
- package/examples/jsm/renderers/common/ClippingContext.js +5 -5
- package/examples/jsm/renderers/common/Pipelines.js +2 -2
- package/examples/jsm/renderers/common/RenderBundle.js +18 -0
- package/examples/jsm/renderers/common/RenderBundles.js +38 -0
- package/examples/jsm/renderers/common/RenderList.js +10 -1
- package/examples/jsm/renderers/common/RenderObject.js +49 -1
- package/examples/jsm/renderers/common/Renderer.js +268 -25
- package/examples/jsm/renderers/common/Textures.js +1 -1
- package/examples/jsm/renderers/common/Uniform.js +1 -1
- package/examples/jsm/renderers/common/extras/PMREMGenerator.js +13 -17
- package/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +18 -4
- package/examples/jsm/renderers/common/nodes/NodeSampler.js +6 -0
- package/examples/jsm/renderers/common/nodes/Nodes.js +31 -47
- package/examples/jsm/renderers/webgl/WebGLBackend.js +7 -21
- package/examples/jsm/renderers/webgl/WebGLBufferRenderer.js +5 -1
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +23 -5
- package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +114 -13
- package/examples/jsm/renderers/webgl/utils/WebGLUtils.js +3 -21
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +80 -46
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +85 -12
- package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +4 -1
- package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +10 -1
- package/examples/jsm/renderers/webgpu/utils/WebGPUConstants.js +6 -0
- package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +62 -19
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +62 -3
- package/examples/jsm/transpiler/GLSLDecoder.js +1 -1
- package/examples/jsm/transpiler/ShaderToyDecoder.js +1 -1
- package/examples/jsm/utils/BufferGeometryUtils.js +18 -16
- package/examples/jsm/utils/GPUStatsPanel.js +2 -0
- package/examples/jsm/utils/SceneUtils.js +60 -1
- package/examples/jsm/utils/SortUtils.js +8 -5
- package/examples/jsm/webxr/OculusHandModel.js +3 -2
- package/examples/jsm/webxr/XRHandModelFactory.js +4 -2
- package/package.json +3 -2
- package/src/animation/tracks/BooleanKeyframeTrack.js +10 -1
- package/src/animation/tracks/QuaternionKeyframeTrack.js +1 -2
- package/src/animation/tracks/StringKeyframeTrack.js +10 -1
- package/src/constants.js +1 -1
- package/src/core/Object3D.js +2 -0
- package/src/core/Raycaster.js +6 -2
- package/src/core/RenderTarget.js +8 -0
- package/src/extras/PMREMGenerator.js +12 -11
- package/src/loaders/FileLoader.js +5 -1
- package/src/loaders/LoaderUtils.js +3 -1
- package/src/loaders/MaterialLoader.js +1 -0
- package/src/loaders/ObjectLoader.js +1 -0
- package/src/materials/Material.js +2 -0
- package/src/materials/MeshPhysicalMaterial.js +20 -0
- package/src/objects/BatchedMesh.js +114 -1
- package/src/objects/Line.js +66 -43
- package/src/renderers/WebGLRenderer.js +371 -109
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +15 -0
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +9 -1
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +8 -22
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +1 -0
- package/src/renderers/shaders/ShaderChunk/morphcolor_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js +3 -14
- package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +10 -31
- package/src/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js +3 -23
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +17 -9
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +47 -13
- package/src/renderers/shaders/ShaderChunk.js +0 -2
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +4 -0
- package/src/renderers/shaders/ShaderLib.js +1 -0
- package/src/renderers/webgl/WebGLBackground.js +24 -3
- package/src/renderers/webgl/WebGLBufferRenderer.js +36 -0
- package/src/renderers/webgl/WebGLCapabilities.js +33 -1
- package/src/renderers/webgl/WebGLExtensions.js +3 -1
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +36 -0
- package/src/renderers/webgl/WebGLLights.js +9 -12
- package/src/renderers/webgl/WebGLMaterials.js +7 -5
- package/src/renderers/webgl/WebGLMorphtargets.js +1 -2
- package/src/renderers/webgl/WebGLProgram.js +5 -36
- package/src/renderers/webgl/WebGLPrograms.js +19 -14
- package/src/renderers/webgl/WebGLRenderStates.js +8 -4
- package/src/renderers/webgl/WebGLShadowMap.js +25 -25
- package/src/renderers/webgl/WebGLTextures.js +206 -129
- package/src/renderers/webgl/WebGLUtils.js +3 -21
- package/src/renderers/webxr/WebXRDepthSensing.js +3 -3
- package/src/renderers/webxr/WebXRManager.js +8 -6
- package/src/textures/CompressedArrayTexture.js +14 -0
- package/src/textures/DataArrayTexture.js +14 -0
- package/src/textures/DepthTexture.js +1 -3
- package/src/utils.js +30 -1
- package/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +0 -318
- package/examples/jsm/renderers/webgl-legacy/nodes/SlotNode.js +0 -26
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodeBuilder.js +0 -792
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.js +0 -51
- package/src/renderers/shaders/ShaderChunk/lightmap_fragment.glsl.js +0 -10
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import DataMap from '../DataMap.js';
|
|
2
2
|
import ChainMap from '../ChainMap.js';
|
|
3
3
|
import NodeBuilderState from './NodeBuilderState.js';
|
|
4
|
-
import {
|
|
5
|
-
import { NodeFrame, objectGroup, renderGroup, frameGroup, cubeTexture, texture, rangeFog, densityFog, reference,
|
|
4
|
+
import { EquirectangularReflectionMapping, EquirectangularRefractionMapping, NoToneMapping, SRGBColorSpace } from 'three';
|
|
5
|
+
import { NodeFrame, vec4, objectGroup, renderGroup, frameGroup, cubeTexture, texture, rangeFog, densityFog, reference, viewportBottomLeft, normalWorld, pmremTexture, viewportTopLeft } from '../../../nodes/Nodes.js';
|
|
6
6
|
|
|
7
7
|
class Nodes extends DataMap {
|
|
8
8
|
|
|
@@ -113,7 +113,6 @@ class Nodes extends DataMap {
|
|
|
113
113
|
nodeBuilder.lightsNode = renderObject.lightsNode;
|
|
114
114
|
nodeBuilder.environmentNode = this.getEnvironmentNode( renderObject.scene );
|
|
115
115
|
nodeBuilder.fogNode = this.getFogNode( renderObject.scene );
|
|
116
|
-
nodeBuilder.toneMappingNode = this.getToneMappingNode();
|
|
117
116
|
nodeBuilder.clippingContext = renderObject.clippingContext;
|
|
118
117
|
nodeBuilder.build();
|
|
119
118
|
|
|
@@ -206,14 +205,6 @@ class Nodes extends DataMap {
|
|
|
206
205
|
|
|
207
206
|
}
|
|
208
207
|
|
|
209
|
-
getToneMappingNode() {
|
|
210
|
-
|
|
211
|
-
if ( this.isToneMappingState === false ) return null;
|
|
212
|
-
|
|
213
|
-
return this.renderer.toneMappingNode || this.get( this.renderer ).toneMappingNode || null;
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
|
|
217
208
|
getCacheKey( scene, lightsNode ) {
|
|
218
209
|
|
|
219
210
|
const chain = [ scene, lightsNode ];
|
|
@@ -225,14 +216,12 @@ class Nodes extends DataMap {
|
|
|
225
216
|
|
|
226
217
|
const environmentNode = this.getEnvironmentNode( scene );
|
|
227
218
|
const fogNode = this.getFogNode( scene );
|
|
228
|
-
const toneMappingNode = this.getToneMappingNode();
|
|
229
219
|
|
|
230
220
|
const cacheKey = [];
|
|
231
221
|
|
|
232
222
|
if ( lightsNode ) cacheKey.push( lightsNode.getCacheKey() );
|
|
233
223
|
if ( environmentNode ) cacheKey.push( environmentNode.getCacheKey() );
|
|
234
224
|
if ( fogNode ) cacheKey.push( fogNode.getCacheKey() );
|
|
235
|
-
if ( toneMappingNode ) cacheKey.push( toneMappingNode.getCacheKey() );
|
|
236
225
|
|
|
237
226
|
cacheKeyData = {
|
|
238
227
|
callId,
|
|
@@ -252,45 +241,12 @@ class Nodes extends DataMap {
|
|
|
252
241
|
this.updateEnvironment( scene );
|
|
253
242
|
this.updateFog( scene );
|
|
254
243
|
this.updateBackground( scene );
|
|
255
|
-
this.updateToneMapping();
|
|
256
244
|
|
|
257
245
|
}
|
|
258
246
|
|
|
259
247
|
get isToneMappingState() {
|
|
260
248
|
|
|
261
|
-
|
|
262
|
-
const renderTarget = renderer.getRenderTarget();
|
|
263
|
-
|
|
264
|
-
return renderTarget && renderTarget.isCubeRenderTarget ? false : true;
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
updateToneMapping() {
|
|
269
|
-
|
|
270
|
-
const renderer = this.renderer;
|
|
271
|
-
const rendererData = this.get( renderer );
|
|
272
|
-
const rendererToneMapping = renderer.toneMapping;
|
|
273
|
-
|
|
274
|
-
if ( this.isToneMappingState && rendererToneMapping !== NoToneMapping ) {
|
|
275
|
-
|
|
276
|
-
if ( rendererData.toneMapping !== rendererToneMapping ) {
|
|
277
|
-
|
|
278
|
-
const rendererToneMappingNode = rendererData.rendererToneMappingNode || toneMapping( rendererToneMapping );
|
|
279
|
-
rendererToneMappingNode.toneMapping = rendererToneMapping;
|
|
280
|
-
|
|
281
|
-
rendererData.rendererToneMappingNode = rendererToneMappingNode;
|
|
282
|
-
rendererData.toneMappingNode = rendererToneMappingNode;
|
|
283
|
-
rendererData.toneMapping = rendererToneMapping;
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
} else {
|
|
288
|
-
|
|
289
|
-
// Don't delete rendererData.rendererToneMappingNode
|
|
290
|
-
delete rendererData.toneMappingNode;
|
|
291
|
-
delete rendererData.toneMapping;
|
|
292
|
-
|
|
293
|
-
}
|
|
249
|
+
return this.renderer.getRenderTarget() ? false : true;
|
|
294
250
|
|
|
295
251
|
}
|
|
296
252
|
|
|
@@ -430,6 +386,34 @@ class Nodes extends DataMap {
|
|
|
430
386
|
|
|
431
387
|
}
|
|
432
388
|
|
|
389
|
+
getOutputNode( outputTexture ) {
|
|
390
|
+
|
|
391
|
+
let output = texture( outputTexture, viewportTopLeft );
|
|
392
|
+
|
|
393
|
+
if ( this.isToneMappingState ) {
|
|
394
|
+
|
|
395
|
+
if ( this.renderer.toneMappingNode ) {
|
|
396
|
+
|
|
397
|
+
output = vec4( this.renderer.toneMappingNode.context( { color: output.rgb } ), output.a );
|
|
398
|
+
|
|
399
|
+
} else if ( this.renderer.toneMapping !== NoToneMapping ) {
|
|
400
|
+
|
|
401
|
+
output = output.toneMapping( this.renderer.toneMapping );
|
|
402
|
+
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
if ( this.renderer.currentColorSpace === SRGBColorSpace ) {
|
|
408
|
+
|
|
409
|
+
output = output.linearToColorSpace( this.renderer.currentColorSpace );
|
|
410
|
+
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
return output;
|
|
414
|
+
|
|
415
|
+
}
|
|
416
|
+
|
|
433
417
|
updateBefore( renderObject ) {
|
|
434
418
|
|
|
435
419
|
const nodeFrame = this.getNodeFrameForRender( renderObject );
|
|
@@ -173,6 +173,7 @@ class WebGLBackend extends Backend {
|
|
|
173
173
|
//
|
|
174
174
|
|
|
175
175
|
//
|
|
176
|
+
|
|
176
177
|
this.initTimestampQuery( renderContext );
|
|
177
178
|
|
|
178
179
|
renderContextData.previousContext = this._currentContext;
|
|
@@ -568,7 +569,7 @@ class WebGLBackend extends Backend {
|
|
|
568
569
|
|
|
569
570
|
draw( renderObject, info ) {
|
|
570
571
|
|
|
571
|
-
const { pipeline, material, context } = renderObject;
|
|
572
|
+
const { object, pipeline, material, context } = renderObject;
|
|
572
573
|
const { programGPU } = this.get( pipeline );
|
|
573
574
|
|
|
574
575
|
const { gl, state } = this;
|
|
@@ -579,7 +580,9 @@ class WebGLBackend extends Backend {
|
|
|
579
580
|
|
|
580
581
|
this._bindUniforms( renderObject.getBindings() );
|
|
581
582
|
|
|
582
|
-
|
|
583
|
+
const frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 );
|
|
584
|
+
|
|
585
|
+
state.setMaterial( material, frontFaceCW );
|
|
583
586
|
|
|
584
587
|
gl.useProgram( programGPU );
|
|
585
588
|
|
|
@@ -611,9 +614,8 @@ class WebGLBackend extends Backend {
|
|
|
611
614
|
|
|
612
615
|
const index = renderObject.getIndex();
|
|
613
616
|
|
|
614
|
-
const object = renderObject.object;
|
|
615
617
|
const geometry = renderObject.geometry;
|
|
616
|
-
const drawRange =
|
|
618
|
+
const drawRange = renderObject.drawRange;
|
|
617
619
|
const firstVertex = drawRange.start;
|
|
618
620
|
|
|
619
621
|
//
|
|
@@ -699,16 +701,7 @@ class WebGLBackend extends Backend {
|
|
|
699
701
|
|
|
700
702
|
if ( object.isBatchedMesh ) {
|
|
701
703
|
|
|
702
|
-
if (
|
|
703
|
-
|
|
704
|
-
// TODO: Better support with InstancedBatchedMesh
|
|
705
|
-
if ( object._multiDrawInstances === undefined ) {
|
|
706
|
-
|
|
707
|
-
object._multiDrawInstances = new Int32Array( object._maxGeometryCount );
|
|
708
|
-
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
object._multiDrawInstances.fill( instanceCount );
|
|
704
|
+
if ( object._multiDrawInstances !== null ) {
|
|
712
705
|
|
|
713
706
|
renderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );
|
|
714
707
|
|
|
@@ -1115,12 +1108,6 @@ class WebGLBackend extends Backend {
|
|
|
1115
1108
|
|
|
1116
1109
|
}
|
|
1117
1110
|
|
|
1118
|
-
async hasFeatureAsync( name ) {
|
|
1119
|
-
|
|
1120
|
-
return this.hasFeature( name );
|
|
1121
|
-
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
1111
|
hasFeature( name ) {
|
|
1125
1112
|
|
|
1126
1113
|
const keysMatching = Object.keys( GLFeatureName ).filter( key => GLFeatureName[ key ] === name );
|
|
@@ -1129,7 +1116,6 @@ class WebGLBackend extends Backend {
|
|
|
1129
1116
|
|
|
1130
1117
|
for ( let i = 0; i < keysMatching.length; i ++ ) {
|
|
1131
1118
|
|
|
1132
|
-
|
|
1133
1119
|
if ( extensions.has( keysMatching[ i ] ) ) return true;
|
|
1134
1120
|
|
|
1135
1121
|
}
|
|
@@ -3,7 +3,7 @@ import { MathNode, GLSLNodeParser, NodeBuilder, UniformNode, vectorComponents }
|
|
|
3
3
|
import NodeUniformBuffer from '../../common/nodes/NodeUniformBuffer.js';
|
|
4
4
|
import NodeUniformsGroup from '../../common/nodes/NodeUniformsGroup.js';
|
|
5
5
|
|
|
6
|
-
import { NodeSampledTexture, NodeSampledCubeTexture } from '../../common/nodes/NodeSampledTexture.js';
|
|
6
|
+
import { NodeSampledTexture, NodeSampledCubeTexture, NodeSampledTexture3D } from '../../common/nodes/NodeSampledTexture.js';
|
|
7
7
|
|
|
8
8
|
import { RedFormat, RGFormat, IntType, DataTexture, RGBFormat, RGBAFormat, FloatType } from 'three';
|
|
9
9
|
|
|
@@ -27,6 +27,7 @@ const supports = {
|
|
|
27
27
|
const defaultPrecisions = `
|
|
28
28
|
precision highp float;
|
|
29
29
|
precision highp int;
|
|
30
|
+
precision highp sampler3D;
|
|
30
31
|
precision mediump sampler2DArray;
|
|
31
32
|
precision lowp sampler2DShadow;
|
|
32
33
|
`;
|
|
@@ -50,12 +51,16 @@ class GLSLNodeBuilder extends NodeBuilder {
|
|
|
50
51
|
|
|
51
52
|
getPropertyName( node, shaderStage ) {
|
|
52
53
|
|
|
53
|
-
if ( node.isOutputStructVar ) return '';
|
|
54
|
-
|
|
55
54
|
return super.getPropertyName( node, shaderStage );
|
|
56
55
|
|
|
57
56
|
}
|
|
58
57
|
|
|
58
|
+
getOutputStructName() {
|
|
59
|
+
|
|
60
|
+
return '';
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
59
64
|
buildFunctionCode( shaderNode ) {
|
|
60
65
|
|
|
61
66
|
const layout = shaderNode.layout;
|
|
@@ -246,6 +251,12 @@ ${ flowData.code }
|
|
|
246
251
|
|
|
247
252
|
}
|
|
248
253
|
|
|
254
|
+
generateTextureGrad( texture, textureProperty, uvSnippet, gradSnippet ) {
|
|
255
|
+
|
|
256
|
+
return `textureGrad( ${ textureProperty }, ${ uvSnippet }, ${ gradSnippet[ 0 ] }, ${ gradSnippet[ 1 ] } )`;
|
|
257
|
+
|
|
258
|
+
}
|
|
259
|
+
|
|
249
260
|
generateTextureCompare( texture, textureProperty, uvSnippet, compareSnippet, depthSnippet, shaderStage = this.shaderStage ) {
|
|
250
261
|
|
|
251
262
|
if ( shaderStage === 'fragment' ) {
|
|
@@ -270,8 +281,6 @@ ${ flowData.code }
|
|
|
270
281
|
|
|
271
282
|
for ( const variable of vars ) {
|
|
272
283
|
|
|
273
|
-
if ( variable.isOutputStructVar ) continue;
|
|
274
|
-
|
|
275
284
|
snippets.push( `${ this.getVar( variable.type, variable.name ) };` );
|
|
276
285
|
|
|
277
286
|
}
|
|
@@ -316,6 +325,10 @@ ${ flowData.code }
|
|
|
316
325
|
|
|
317
326
|
snippet = `samplerCube ${ uniform.name };`;
|
|
318
327
|
|
|
328
|
+
} else if ( uniform.type === 'texture3D' ) {
|
|
329
|
+
|
|
330
|
+
snippet = `sampler3D ${ uniform.name };`;
|
|
331
|
+
|
|
319
332
|
} else if ( uniform.type === 'buffer' ) {
|
|
320
333
|
|
|
321
334
|
const bufferNode = uniform.node;
|
|
@@ -753,6 +766,11 @@ void main() {
|
|
|
753
766
|
|
|
754
767
|
this.bindings[ shaderStage ].push( uniformGPU );
|
|
755
768
|
|
|
769
|
+
} else if ( type === 'texture3D' ) {
|
|
770
|
+
|
|
771
|
+
uniformGPU = new NodeSampledTexture3D( uniformNode.name, uniformNode.node );
|
|
772
|
+
this.bindings[ shaderStage ].push( uniformGPU );
|
|
773
|
+
|
|
756
774
|
} else if ( type === 'buffer' ) {
|
|
757
775
|
|
|
758
776
|
node.name = `NodeBuffer_${ node.id }`;
|
|
@@ -83,6 +83,10 @@ class WebGLTextureUtils {
|
|
|
83
83
|
|
|
84
84
|
glTextureType = gl.TEXTURE_2D_ARRAY;
|
|
85
85
|
|
|
86
|
+
} else if ( texture.isData3DTexture === true ) {
|
|
87
|
+
|
|
88
|
+
glTextureType = gl.TEXTURE_3D;
|
|
89
|
+
|
|
86
90
|
} else {
|
|
87
91
|
|
|
88
92
|
glTextureType = gl.TEXTURE_2D;
|
|
@@ -113,6 +117,11 @@ class WebGLTextureUtils {
|
|
|
113
117
|
if ( glType === gl.FLOAT ) internalFormat = gl.R32F;
|
|
114
118
|
if ( glType === gl.HALF_FLOAT ) internalFormat = gl.R16F;
|
|
115
119
|
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.R8;
|
|
120
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.R16;
|
|
121
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.R32UI;
|
|
122
|
+
if ( glType === gl.BYTE ) internalFormat = gl.R8I;
|
|
123
|
+
if ( glType === gl.SHORT ) internalFormat = gl.R16I;
|
|
124
|
+
if ( glType === gl.INT ) internalFormat = gl.R32I;
|
|
116
125
|
|
|
117
126
|
}
|
|
118
127
|
|
|
@@ -132,6 +141,12 @@ class WebGLTextureUtils {
|
|
|
132
141
|
if ( glType === gl.FLOAT ) internalFormat = gl.RG32F;
|
|
133
142
|
if ( glType === gl.HALF_FLOAT ) internalFormat = gl.RG16F;
|
|
134
143
|
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.RG8;
|
|
144
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.RG16;
|
|
145
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.RG32UI;
|
|
146
|
+
if ( glType === gl.BYTE ) internalFormat = gl.RG8I;
|
|
147
|
+
if ( glType === gl.SHORT ) internalFormat = gl.RG16I;
|
|
148
|
+
if ( glType === gl.INT ) internalFormat = gl.RG32I;
|
|
149
|
+
|
|
135
150
|
|
|
136
151
|
}
|
|
137
152
|
|
|
@@ -140,6 +155,12 @@ class WebGLTextureUtils {
|
|
|
140
155
|
if ( glType === gl.FLOAT ) internalFormat = gl.RGB32F;
|
|
141
156
|
if ( glType === gl.HALF_FLOAT ) internalFormat = gl.RGB16F;
|
|
142
157
|
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.RGB8;
|
|
158
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.RGB16;
|
|
159
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.RGB32UI;
|
|
160
|
+
if ( glType === gl.BYTE ) internalFormat = gl.RGB8I;
|
|
161
|
+
if ( glType === gl.SHORT ) internalFormat = gl.RGB16I;
|
|
162
|
+
if ( glType === gl.INT ) internalFormat = gl.RGB32I;
|
|
163
|
+
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = ( colorSpace === SRGBColorSpace && forceLinearTransfer === false ) ? gl.SRGB8 : gl.RGB8;
|
|
143
164
|
if ( glType === gl.UNSIGNED_SHORT_5_6_5 ) internalFormat = gl.RGB565;
|
|
144
165
|
if ( glType === gl.UNSIGNED_SHORT_5_5_5_1 ) internalFormat = gl.RGB5_A1;
|
|
145
166
|
if ( glType === gl.UNSIGNED_SHORT_4_4_4_4 ) internalFormat = gl.RGB4;
|
|
@@ -151,6 +172,12 @@ class WebGLTextureUtils {
|
|
|
151
172
|
|
|
152
173
|
if ( glType === gl.FLOAT ) internalFormat = gl.RGBA32F;
|
|
153
174
|
if ( glType === gl.HALF_FLOAT ) internalFormat = gl.RGBA16F;
|
|
175
|
+
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.RGBA8;
|
|
176
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.RGBA16;
|
|
177
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.RGBA32UI;
|
|
178
|
+
if ( glType === gl.BYTE ) internalFormat = gl.RGBA8I;
|
|
179
|
+
if ( glType === gl.SHORT ) internalFormat = gl.RGBA16I;
|
|
180
|
+
if ( glType === gl.INT ) internalFormat = gl.RGBA32I;
|
|
154
181
|
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = ( colorSpace === SRGBColorSpace && forceLinearTransfer === false ) ? gl.SRGB8_ALPHA8 : gl.RGBA8;
|
|
155
182
|
if ( glType === gl.UNSIGNED_SHORT_4_4_4_4 ) internalFormat = gl.RGBA4;
|
|
156
183
|
if ( glType === gl.UNSIGNED_SHORT_5_5_5_1 ) internalFormat = gl.RGB5_A1;
|
|
@@ -286,6 +313,10 @@ class WebGLTextureUtils {
|
|
|
286
313
|
|
|
287
314
|
gl.texStorage3D( gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, width, height, depth );
|
|
288
315
|
|
|
316
|
+
} else if ( texture.isData3DTexture ) {
|
|
317
|
+
|
|
318
|
+
gl.texStorage3D( gl.TEXTURE_3D, levels, glInternalFormat, width, height, depth );
|
|
319
|
+
|
|
289
320
|
} else if ( ! texture.isVideoTexture ) {
|
|
290
321
|
|
|
291
322
|
gl.texStorage2D( glTextureType, levels, glInternalFormat, width, height );
|
|
@@ -429,6 +460,12 @@ class WebGLTextureUtils {
|
|
|
429
460
|
|
|
430
461
|
gl.texSubImage3D( gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );
|
|
431
462
|
|
|
463
|
+
} else if ( texture.isData3DTexture ) {
|
|
464
|
+
|
|
465
|
+
const image = options.image;
|
|
466
|
+
|
|
467
|
+
gl.texSubImage3D( gl.TEXTURE_3D, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );
|
|
468
|
+
|
|
432
469
|
} else if ( texture.isVideoTexture ) {
|
|
433
470
|
|
|
434
471
|
texture.update();
|
|
@@ -524,41 +561,91 @@ class WebGLTextureUtils {
|
|
|
524
561
|
|
|
525
562
|
}
|
|
526
563
|
|
|
527
|
-
copyTextureToTexture(
|
|
564
|
+
copyTextureToTexture( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {
|
|
528
565
|
|
|
529
566
|
const { gl, backend } = this;
|
|
530
567
|
const { state } = this.backend;
|
|
531
568
|
|
|
532
|
-
const width = srcTexture.image.width;
|
|
533
|
-
const height = srcTexture.image.height;
|
|
534
569
|
const { textureGPU: dstTextureGPU, glTextureType, glType, glFormat } = backend.get( dstTexture );
|
|
535
570
|
|
|
571
|
+
|
|
572
|
+
let width, height, minX, minY;
|
|
573
|
+
let dstX, dstY;
|
|
574
|
+
if ( srcRegion !== null ) {
|
|
575
|
+
|
|
576
|
+
width = srcRegion.max.x - srcRegion.min.x;
|
|
577
|
+
height = srcRegion.max.y - srcRegion.min.y;
|
|
578
|
+
minX = srcRegion.min.x;
|
|
579
|
+
minY = srcRegion.min.y;
|
|
580
|
+
|
|
581
|
+
} else {
|
|
582
|
+
|
|
583
|
+
width = srcTexture.image.width;
|
|
584
|
+
height = srcTexture.image.height;
|
|
585
|
+
minX = 0;
|
|
586
|
+
minY = 0;
|
|
587
|
+
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
if ( dstPosition !== null ) {
|
|
591
|
+
|
|
592
|
+
dstX = dstPosition.x;
|
|
593
|
+
dstY = dstPosition.y;
|
|
594
|
+
|
|
595
|
+
} else {
|
|
596
|
+
|
|
597
|
+
dstX = 0;
|
|
598
|
+
dstY = 0;
|
|
599
|
+
|
|
600
|
+
}
|
|
601
|
+
|
|
536
602
|
state.bindTexture( glTextureType, dstTextureGPU );
|
|
537
603
|
|
|
538
604
|
// As another texture upload may have changed pixelStorei
|
|
539
605
|
// parameters, make sure they are correct for the dstTexture
|
|
606
|
+
gl.pixelStorei( gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment );
|
|
540
607
|
gl.pixelStorei( gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY );
|
|
541
608
|
gl.pixelStorei( gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha );
|
|
542
609
|
gl.pixelStorei( gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment );
|
|
543
610
|
|
|
611
|
+
const currentUnpackRowLen = gl.getParameter( gl.UNPACK_ROW_LENGTH );
|
|
612
|
+
const currentUnpackImageHeight = gl.getParameter( gl.UNPACK_IMAGE_HEIGHT );
|
|
613
|
+
const currentUnpackSkipPixels = gl.getParameter( gl.UNPACK_SKIP_PIXELS );
|
|
614
|
+
const currentUnpackSkipRows = gl.getParameter( gl.UNPACK_SKIP_ROWS );
|
|
615
|
+
const currentUnpackSkipImages = gl.getParameter( gl.UNPACK_SKIP_IMAGES );
|
|
616
|
+
|
|
617
|
+
const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ level ] : srcTexture.image;
|
|
618
|
+
|
|
619
|
+
gl.pixelStorei( gl.UNPACK_ROW_LENGTH, image.width );
|
|
620
|
+
gl.pixelStorei( gl.UNPACK_IMAGE_HEIGHT, image.height );
|
|
621
|
+
gl.pixelStorei( gl.UNPACK_SKIP_PIXELS, minX );
|
|
622
|
+
gl.pixelStorei( gl.UNPACK_SKIP_ROWS, minY );
|
|
623
|
+
|
|
624
|
+
|
|
544
625
|
if ( srcTexture.isDataTexture ) {
|
|
545
626
|
|
|
546
|
-
gl.texSubImage2D( gl.TEXTURE_2D, level,
|
|
627
|
+
gl.texSubImage2D( gl.TEXTURE_2D, level, dstX, dstY, width, height, glFormat, glType, image.data );
|
|
547
628
|
|
|
548
629
|
} else {
|
|
549
630
|
|
|
550
631
|
if ( srcTexture.isCompressedTexture ) {
|
|
551
632
|
|
|
552
|
-
gl.compressedTexSubImage2D( gl.TEXTURE_2D, level,
|
|
633
|
+
gl.compressedTexSubImage2D( gl.TEXTURE_2D, level, dstX, dstY, image.width, image.height, glFormat, image.data );
|
|
553
634
|
|
|
554
635
|
} else {
|
|
555
636
|
|
|
556
|
-
gl.texSubImage2D( gl.TEXTURE_2D, level,
|
|
637
|
+
gl.texSubImage2D( gl.TEXTURE_2D, level, dstX, dstY, glFormat, glType, image );
|
|
557
638
|
|
|
558
639
|
}
|
|
559
640
|
|
|
560
641
|
}
|
|
561
642
|
|
|
643
|
+
gl.pixelStorei( gl.UNPACK_ROW_LENGTH, currentUnpackRowLen );
|
|
644
|
+
gl.pixelStorei( gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight );
|
|
645
|
+
gl.pixelStorei( gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels );
|
|
646
|
+
gl.pixelStorei( gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows );
|
|
647
|
+
gl.pixelStorei( gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages );
|
|
648
|
+
|
|
562
649
|
// Generate mipmaps only when copying level 0
|
|
563
650
|
if ( level === 0 && dstTexture.generateMipmaps ) gl.generateMipmap( gl.TEXTURE_2D );
|
|
564
651
|
|
|
@@ -576,20 +663,35 @@ class WebGLTextureUtils {
|
|
|
576
663
|
const width = texture.image.width;
|
|
577
664
|
const height = texture.image.height;
|
|
578
665
|
|
|
579
|
-
|
|
666
|
+
const requireDrawFrameBuffer = texture.isDepthTexture === true || ( renderContext.renderTarget && renderContext.renderTarget.samples > 0 );
|
|
667
|
+
|
|
668
|
+
if ( requireDrawFrameBuffer ) {
|
|
669
|
+
|
|
670
|
+
let mask;
|
|
671
|
+
let attachment;
|
|
672
|
+
|
|
673
|
+
if ( texture.isDepthTexture === true ) {
|
|
674
|
+
|
|
675
|
+
mask = gl.DEPTH_BUFFER_BIT;
|
|
676
|
+
attachment = gl.DEPTH_ATTACHMENT;
|
|
580
677
|
|
|
581
|
-
|
|
678
|
+
if ( renderContext.stencil ) {
|
|
582
679
|
|
|
583
|
-
|
|
680
|
+
mask |= gl.STENCIL_BUFFER_BIT;
|
|
584
681
|
|
|
585
|
-
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
} else {
|
|
685
|
+
|
|
686
|
+
mask = gl.COLOR_BUFFER_BIT;
|
|
687
|
+
attachment = gl.COLOR_ATTACHMENT0;
|
|
586
688
|
|
|
587
689
|
}
|
|
588
690
|
|
|
589
691
|
const fb = gl.createFramebuffer();
|
|
590
692
|
state.bindFramebuffer( gl.DRAW_FRAMEBUFFER, fb );
|
|
591
693
|
|
|
592
|
-
gl.framebufferTexture2D( gl.DRAW_FRAMEBUFFER,
|
|
694
|
+
gl.framebufferTexture2D( gl.DRAW_FRAMEBUFFER, attachment, gl.TEXTURE_2D, textureGPU, 0 );
|
|
593
695
|
|
|
594
696
|
gl.blitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, gl.NEAREST );
|
|
595
697
|
|
|
@@ -626,7 +728,6 @@ class WebGLTextureUtils {
|
|
|
626
728
|
|
|
627
729
|
if ( samples > 0 ) {
|
|
628
730
|
|
|
629
|
-
|
|
630
731
|
if ( depthTexture && depthTexture.isDepthTexture ) {
|
|
631
732
|
|
|
632
733
|
if ( depthTexture.type === gl.FLOAT ) {
|
|
@@ -692,7 +793,7 @@ class WebGLTextureUtils {
|
|
|
692
793
|
|
|
693
794
|
await backend.utils._clientWaitAsync();
|
|
694
795
|
|
|
695
|
-
const dstBuffer = new typedArrayType(
|
|
796
|
+
const dstBuffer = new typedArrayType( byteLength / typedArrayType.BYTES_PER_ELEMENT );
|
|
696
797
|
|
|
697
798
|
gl.bindBuffer( gl.PIXEL_PACK_BUFFER, buffer );
|
|
698
799
|
gl.getBufferSubData( gl.PIXEL_PACK_BUFFER, 0, dstBuffer );
|
|
@@ -114,33 +114,15 @@ class WebGLUtils {
|
|
|
114
114
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
//
|
|
117
|
+
// ETC
|
|
118
118
|
|
|
119
|
-
if ( p === RGB_ETC1_Format ) {
|
|
120
|
-
|
|
121
|
-
extension = extensions.get( 'WEBGL_compressed_texture_etc1' );
|
|
122
|
-
|
|
123
|
-
if ( extension !== null ) {
|
|
124
|
-
|
|
125
|
-
return extension.COMPRESSED_RGB_ETC1_WEBGL;
|
|
126
|
-
|
|
127
|
-
} else {
|
|
128
|
-
|
|
129
|
-
return null;
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// ETC2
|
|
136
|
-
|
|
137
|
-
if ( p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format ) {
|
|
119
|
+
if ( p === RGB_ETC1_Format || p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format ) {
|
|
138
120
|
|
|
139
121
|
extension = extensions.get( 'WEBGL_compressed_texture_etc' );
|
|
140
122
|
|
|
141
123
|
if ( extension !== null ) {
|
|
142
124
|
|
|
143
|
-
if ( p === RGB_ETC2_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;
|
|
125
|
+
if ( p === RGB_ETC1_Format || p === RGB_ETC2_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;
|
|
144
126
|
if ( p === RGBA_ETC2_EAC_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC;
|
|
145
127
|
|
|
146
128
|
} else {
|