super-three 0.155.0 → 0.157.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 +361 -324
- package/build/three.js +361 -324
- package/build/three.min.js +2 -2
- package/build/three.module.js +354 -323
- package/build/three.module.min.js +1 -1
- package/examples/jsm/capabilities/WebGL.js +17 -0
- package/examples/jsm/controls/DragControls.js +3 -2
- package/examples/jsm/controls/OrbitControls.js +13 -5
- package/examples/jsm/csm/CSMShader.js +59 -21
- package/examples/jsm/exporters/EXRExporter.js +102 -24
- package/examples/jsm/exporters/GLTFExporter.js +1 -1
- package/examples/jsm/libs/rhino3dm/rhino3dm.js +8726 -4
- package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +8737 -4
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/libs/tween.module.js +790 -735
- package/examples/jsm/libs/utif.module.js +1644 -1558
- package/examples/jsm/lights/LightProbeGenerator.js +37 -3
- package/examples/jsm/lines/LineMaterial.js +90 -156
- package/examples/jsm/loaders/3DMLoader.js +378 -104
- package/examples/jsm/loaders/DDSLoader.js +46 -3
- package/examples/jsm/loaders/EXRLoader.js +4 -4
- package/examples/jsm/loaders/FBXLoader.js +2 -0
- package/examples/jsm/loaders/GLTFLoader.js +18 -8
- package/examples/jsm/loaders/KTX2Loader.js +126 -77
- package/examples/jsm/loaders/LDrawLoader.js +22 -16
- package/examples/jsm/loaders/LogLuvLoader.js +2 -2
- package/examples/jsm/loaders/MMDLoader.js +10 -7
- package/examples/jsm/loaders/RGBELoader.js +48 -66
- package/examples/jsm/loaders/STLLoader.js +7 -0
- package/examples/jsm/loaders/USDZLoader.js +215 -12
- package/examples/jsm/materials/MeshGouraudMaterial.js +22 -18
- package/examples/jsm/nodes/Nodes.js +8 -1
- package/examples/jsm/nodes/accessors/BitangentNode.js +1 -1
- package/examples/jsm/nodes/accessors/BufferAttributeNode.js +30 -4
- package/examples/jsm/nodes/accessors/BufferNode.js +1 -1
- package/examples/jsm/nodes/accessors/CameraNode.js +1 -1
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +19 -4
- package/examples/jsm/nodes/accessors/ExtendedMaterialNode.js +4 -5
- package/examples/jsm/nodes/accessors/InstanceNode.js +2 -2
- package/examples/jsm/nodes/accessors/LineMaterialNode.js +29 -0
- package/examples/jsm/nodes/accessors/MaterialNode.js +23 -13
- package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +12 -9
- package/examples/jsm/nodes/accessors/ModelNode.js +1 -1
- package/examples/jsm/nodes/accessors/ModelViewProjectionNode.js +5 -4
- package/examples/jsm/nodes/accessors/MorphNode.js +4 -4
- package/examples/jsm/nodes/accessors/NormalNode.js +1 -1
- package/examples/jsm/nodes/accessors/Object3DNode.js +3 -3
- package/examples/jsm/nodes/accessors/PointUVNode.js +1 -1
- package/examples/jsm/nodes/accessors/PositionNode.js +1 -1
- package/examples/jsm/nodes/accessors/ReferenceNode.js +13 -7
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +2 -2
- package/examples/jsm/nodes/accessors/SceneNode.js +2 -2
- package/examples/jsm/nodes/accessors/SkinningNode.js +2 -2
- package/examples/jsm/nodes/accessors/StorageBufferNode.js +1 -1
- package/examples/jsm/nodes/accessors/TangentNode.js +1 -1
- package/examples/jsm/nodes/accessors/TextureBicubicNode.js +2 -2
- package/examples/jsm/nodes/accessors/TextureNode.js +18 -8
- package/examples/jsm/nodes/accessors/TextureSizeNode.js +2 -2
- package/examples/jsm/nodes/accessors/TextureStoreNode.js +29 -0
- package/examples/jsm/nodes/accessors/UVNode.js +1 -1
- package/examples/jsm/nodes/accessors/UserDataNode.js +2 -2
- package/examples/jsm/nodes/code/CodeNode.js +1 -1
- package/examples/jsm/nodes/code/ExpressionNode.js +1 -1
- package/examples/jsm/nodes/code/FunctionCallNode.js +1 -1
- package/examples/jsm/nodes/code/FunctionNode.js +18 -7
- package/examples/jsm/nodes/code/ScriptableNode.js +2 -2
- package/examples/jsm/nodes/code/ScriptableValueNode.js +2 -2
- package/examples/jsm/nodes/core/ArrayUniformNode.js +1 -1
- package/examples/jsm/nodes/core/AttributeNode.js +3 -3
- package/examples/jsm/nodes/core/BypassNode.js +1 -1
- package/examples/jsm/nodes/core/CacheNode.js +1 -1
- package/examples/jsm/nodes/core/ConstNode.js +1 -1
- package/examples/jsm/nodes/core/ContextNode.js +2 -2
- package/examples/jsm/nodes/core/IndexNode.js +1 -1
- package/examples/jsm/nodes/core/InputNode.js +1 -1
- package/examples/jsm/nodes/core/Node.js +45 -14
- package/examples/jsm/nodes/core/NodeBuilder.js +83 -15
- package/examples/jsm/nodes/core/NodeFrame.js +37 -14
- package/examples/jsm/nodes/core/NodeUniform.js +1 -1
- package/examples/jsm/nodes/core/OutputStructNode.js +62 -0
- package/examples/jsm/nodes/core/PropertyNode.js +3 -1
- package/examples/jsm/nodes/core/StackNode.js +5 -5
- package/examples/jsm/nodes/core/StructTypeNode.js +24 -0
- package/examples/jsm/nodes/core/TempNode.js +1 -1
- package/examples/jsm/nodes/core/UniformNode.js +3 -1
- package/examples/jsm/nodes/core/VarNode.js +1 -1
- package/examples/jsm/nodes/core/VaryingNode.js +1 -1
- package/examples/jsm/nodes/core/constants.js +1 -1
- package/examples/jsm/nodes/display/BlendModeNode.js +2 -2
- package/examples/jsm/nodes/display/BumpMapNode.js +2 -2
- package/examples/jsm/nodes/display/ColorAdjustmentNode.js +2 -2
- package/examples/jsm/nodes/display/ColorSpaceNode.js +2 -2
- package/examples/jsm/nodes/display/FrontFacingNode.js +1 -1
- package/examples/jsm/nodes/display/NormalMapNode.js +2 -2
- package/examples/jsm/nodes/display/PosterizeNode.js +2 -2
- package/examples/jsm/nodes/display/ToneMappingNode.js +2 -2
- package/examples/jsm/nodes/display/ViewportDepthNode.js +2 -2
- package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +1 -1
- package/examples/jsm/nodes/display/ViewportNode.js +21 -7
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +1 -1
- package/examples/jsm/nodes/display/ViewportTextureNode.js +1 -1
- package/examples/jsm/nodes/fog/FogExp2Node.js +2 -2
- package/examples/jsm/nodes/fog/FogNode.js +2 -2
- package/examples/jsm/nodes/fog/FogRangeNode.js +2 -2
- package/examples/jsm/nodes/geometry/RangeNode.js +2 -2
- package/examples/jsm/nodes/gpgpu/ComputeNode.js +1 -1
- package/examples/jsm/nodes/lighting/AONode.js +2 -2
- package/examples/jsm/nodes/lighting/AmbientLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +4 -4
- package/examples/jsm/nodes/lighting/DirectionalLightNode.js +4 -4
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +2 -2
- package/examples/jsm/nodes/lighting/HemisphereLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/IESSpotLightNode.js +2 -2
- package/examples/jsm/nodes/lighting/LightNode.js +2 -2
- package/examples/jsm/nodes/lighting/LightingContextNode.js +3 -3
- package/examples/jsm/nodes/lighting/LightingNode.js +1 -1
- package/examples/jsm/nodes/lighting/LightsNode.js +4 -4
- package/examples/jsm/nodes/lighting/PointLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/SpotLightNode.js +4 -4
- package/examples/jsm/nodes/materials/Line2NodeMaterial.js +449 -0
- package/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +1 -1
- package/examples/jsm/nodes/materials/LineDashedNodeMaterial.js +54 -0
- package/examples/jsm/nodes/materials/Materials.js +2 -0
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +1 -1
- package/examples/jsm/nodes/materials/MeshLambertNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +3 -3
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +6 -6
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +3 -3
- package/examples/jsm/nodes/materials/NodeMaterial.js +39 -29
- package/examples/jsm/nodes/materials/PointsNodeMaterial.js +1 -1
- package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +2 -2
- package/examples/jsm/nodes/math/CondNode.js +1 -1
- package/examples/jsm/nodes/math/HashNode.js +34 -0
- package/examples/jsm/nodes/math/MathNode.js +2 -2
- package/examples/jsm/nodes/math/OperatorNode.js +1 -1
- package/examples/jsm/nodes/procedural/CheckerNode.js +3 -3
- package/examples/jsm/nodes/shadernode/ShaderNode.js +85 -28
- package/examples/jsm/nodes/utils/ArrayElementNode.js +1 -1
- package/examples/jsm/nodes/utils/ConvertNode.js +1 -1
- package/examples/jsm/nodes/utils/DiscardNode.js +1 -1
- package/examples/jsm/nodes/utils/EquirectUVNode.js +2 -2
- package/examples/jsm/nodes/utils/JoinNode.js +1 -1
- package/examples/jsm/nodes/utils/LoopNode.js +11 -11
- package/examples/jsm/nodes/utils/MatcapUVNode.js +2 -2
- package/examples/jsm/nodes/utils/MaxMipLevelNode.js +1 -1
- package/examples/jsm/nodes/utils/OscNode.js +2 -2
- package/examples/jsm/nodes/utils/PackingNode.js +2 -2
- package/examples/jsm/nodes/utils/RemapNode.js +2 -2
- package/examples/jsm/nodes/utils/RotateUVNode.js +2 -2
- package/examples/jsm/nodes/utils/SetNode.js +62 -0
- package/examples/jsm/nodes/utils/SpecularMIPLevelNode.js +2 -2
- package/examples/jsm/nodes/utils/SplitNode.js +2 -2
- package/examples/jsm/nodes/utils/SpriteSheetUVNode.js +2 -2
- package/examples/jsm/nodes/utils/TimerNode.js +2 -2
- package/examples/jsm/nodes/utils/TriplanarTexturesNode.js +2 -2
- package/examples/jsm/objects/Sky.js +1 -3
- package/examples/jsm/postprocessing/FilmPass.js +3 -5
- package/examples/jsm/postprocessing/OutputPass.js +3 -2
- 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/renderers/common/Backend.js +11 -8
- package/examples/jsm/renderers/common/Background.js +2 -2
- package/examples/jsm/renderers/common/Binding.js +6 -0
- package/examples/jsm/renderers/common/Bindings.js +4 -5
- package/examples/jsm/renderers/common/Pipelines.js +9 -9
- package/examples/jsm/renderers/common/RenderContext.js +3 -0
- package/examples/jsm/renderers/common/RenderContexts.js +26 -1
- package/examples/jsm/renderers/common/RenderList.js +12 -4
- package/examples/jsm/renderers/common/RenderObject.js +43 -15
- package/examples/jsm/renderers/common/RenderObjects.js +8 -14
- package/examples/jsm/renderers/common/Renderer.js +52 -16
- package/examples/jsm/renderers/common/SampledTexture.js +6 -3
- package/examples/jsm/renderers/common/Sampler.js +1 -1
- package/examples/jsm/renderers/common/StorageBuffer.js +1 -1
- package/examples/jsm/renderers/common/StorageTexture.js +19 -0
- package/examples/jsm/renderers/common/Textures.js +166 -21
- package/examples/jsm/renderers/common/nodes/NodeBuilderState.js +35 -0
- package/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +21 -11
- package/examples/jsm/renderers/common/nodes/NodeSampler.js +1 -7
- package/examples/jsm/renderers/common/nodes/Nodes.js +79 -18
- package/examples/jsm/renderers/webgl/WebGLBackend.js +702 -0
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +207 -20
- 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 +212 -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 +4 -4
- package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/WebGLNodes.js +14 -2
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +282 -43
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +18 -2
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +93 -60
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +2 -2
- package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +15 -2
- package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +39 -14
- package/examples/jsm/renderers/webgpu/utils/WebGPUTexturePassUtils.js +285 -0
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +205 -284
- package/examples/jsm/renderers/webgpu/utils/WebGPUUtils.js +6 -5
- package/examples/jsm/shaders/FilmShader.js +11 -54
- package/examples/jsm/shaders/GammaCorrectionShader.js +1 -1
- package/examples/jsm/shaders/MMDToonShader.js +4 -4
- package/examples/jsm/shaders/OutputShader.js +2 -2
- package/examples/jsm/shaders/SAOShader.js +0 -13
- package/examples/jsm/shaders/SSAOShader.js +33 -26
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +6 -6
- package/examples/jsm/utils/BufferGeometryUtils.js +6 -4
- package/package.json +1 -1
- package/src/Three.js +1 -2
- package/src/animation/AnimationUtils.js +3 -20
- package/src/animation/KeyframeTrack.js +8 -8
- package/src/audio/Audio.js +6 -0
- package/src/cameras/Camera.js +1 -5
- package/src/cameras/CubeCamera.js +14 -8
- package/src/constants.js +10 -1
- package/src/core/Object3D.js +1 -14
- package/src/core/RenderTarget.js +16 -7
- package/src/core/UniformsGroup.js +2 -2
- package/src/extras/core/CurvePath.js +4 -1
- package/src/loaders/DataTextureLoader.js +0 -2
- package/src/loaders/MaterialLoader.js +1 -1
- package/src/loaders/ObjectLoader.js +6 -0
- package/src/materials/Material.js +10 -10
- package/src/math/Color.js +1 -5
- package/src/math/ColorManagement.js +82 -60
- 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/objects/Sprite.js +2 -2
- package/src/renderers/WebGLRenderer.js +42 -51
- package/src/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +35 -2
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -9
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +19 -15
- package/src/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +4 -4
- package/src/renderers/shaders/ShaderChunk/lights_lambert_pars_fragment.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +11 -6
- package/src/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js +4 -4
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +16 -16
- package/src/renderers/shaders/ShaderChunk/lights_toon_pars_fragment.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +11 -1
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/background.glsl.js +8 -0
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +1 -1
- package/src/renderers/shaders/UniformsUtils.js +2 -2
- package/src/renderers/webgl/WebGLBackground.js +9 -17
- package/src/renderers/webgl/WebGLLights.js +14 -3
- package/src/renderers/webgl/WebGLProgram.js +36 -5
- package/src/renderers/webgl/WebGLPrograms.js +9 -1
- package/src/renderers/webgl/WebGLTextures.js +19 -8
- package/src/renderers/webgl/WebGLUtils.js +25 -20
- package/src/scenes/Fog.js +1 -0
- package/src/scenes/FogExp2.js +1 -0
- package/src/textures/Source.js +2 -2
- package/src/textures/Texture.js +2 -2
- package/src/utils.js +9 -1
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureMipmapUtils.js +0 -163
- package/src/lights/AmbientLightProbe.js +0 -21
- package/src/lights/HemisphereLightProbe.js +0 -30
- /package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/SlotNode.js +0 -0
|
@@ -30,6 +30,23 @@ class WebGL {
|
|
|
30
30
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
static isColorSpaceAvailable( colorSpace ) {
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
|
|
37
|
+
const canvas = document.createElement( 'canvas' );
|
|
38
|
+
const ctx = window.WebGL2RenderingContext && canvas.getContext( 'webgl2' );
|
|
39
|
+
ctx.drawingBufferColorSpace = colorSpace;
|
|
40
|
+
return ctx.drawingBufferColorSpace === colorSpace; // deepscan-disable-line SAME_OPERAND_VALUE
|
|
41
|
+
|
|
42
|
+
} catch ( e ) {
|
|
43
|
+
|
|
44
|
+
return false;
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
33
50
|
static getWebGLErrorMessage() {
|
|
34
51
|
|
|
35
52
|
return this.getErrorMessage( 1 );
|
|
@@ -99,7 +99,7 @@ class DragControls extends EventDispatcher {
|
|
|
99
99
|
_intersections.length = 0;
|
|
100
100
|
|
|
101
101
|
_raycaster.setFromCamera( _pointer, _camera );
|
|
102
|
-
_raycaster.intersectObjects( _objects,
|
|
102
|
+
_raycaster.intersectObjects( _objects, scope.recursive, _intersections );
|
|
103
103
|
|
|
104
104
|
if ( _intersections.length > 0 ) {
|
|
105
105
|
|
|
@@ -151,7 +151,7 @@ class DragControls extends EventDispatcher {
|
|
|
151
151
|
_intersections.length = 0;
|
|
152
152
|
|
|
153
153
|
_raycaster.setFromCamera( _pointer, _camera );
|
|
154
|
-
_raycaster.intersectObjects( _objects,
|
|
154
|
+
_raycaster.intersectObjects( _objects, scope.recursive, _intersections );
|
|
155
155
|
|
|
156
156
|
if ( _intersections.length > 0 ) {
|
|
157
157
|
|
|
@@ -205,6 +205,7 @@ class DragControls extends EventDispatcher {
|
|
|
205
205
|
// API
|
|
206
206
|
|
|
207
207
|
this.enabled = true;
|
|
208
|
+
this.recursive = true;
|
|
208
209
|
this.transformGroup = false;
|
|
209
210
|
|
|
210
211
|
this.activate = activate;
|
|
@@ -176,7 +176,7 @@ class OrbitControls extends EventDispatcher {
|
|
|
176
176
|
|
|
177
177
|
const twoPI = 2 * Math.PI;
|
|
178
178
|
|
|
179
|
-
return function update() {
|
|
179
|
+
return function update( deltaTime = null ) {
|
|
180
180
|
|
|
181
181
|
const position = scope.object.position;
|
|
182
182
|
|
|
@@ -190,7 +190,7 @@ class OrbitControls extends EventDispatcher {
|
|
|
190
190
|
|
|
191
191
|
if ( scope.autoRotate && state === STATE.NONE ) {
|
|
192
192
|
|
|
193
|
-
rotateLeft( getAutoRotationAngle() );
|
|
193
|
+
rotateLeft( getAutoRotationAngle( deltaTime ) );
|
|
194
194
|
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -469,9 +469,17 @@ class OrbitControls extends EventDispatcher {
|
|
|
469
469
|
const pointers = [];
|
|
470
470
|
const pointerPositions = {};
|
|
471
471
|
|
|
472
|
-
function getAutoRotationAngle() {
|
|
472
|
+
function getAutoRotationAngle( deltaTime ) {
|
|
473
473
|
|
|
474
|
-
|
|
474
|
+
if ( deltaTime !== null ) {
|
|
475
|
+
|
|
476
|
+
return ( 2 * Math.PI / 60 * scope.autoRotateSpeed ) * deltaTime;
|
|
477
|
+
|
|
478
|
+
} else {
|
|
479
|
+
|
|
480
|
+
return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
|
|
481
|
+
|
|
482
|
+
}
|
|
475
483
|
|
|
476
484
|
}
|
|
477
485
|
|
|
@@ -623,7 +631,7 @@ class OrbitControls extends EventDispatcher {
|
|
|
623
631
|
mouse.x = ( x / w ) * 2 - 1;
|
|
624
632
|
mouse.y = - ( y / h ) * 2 + 1;
|
|
625
633
|
|
|
626
|
-
dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( object ).sub( object.position ).normalize();
|
|
634
|
+
dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( scope.object ).sub( scope.object.position ).normalize();
|
|
627
635
|
|
|
628
636
|
}
|
|
629
637
|
|
|
@@ -2,18 +2,32 @@ import { ShaderChunk } from 'three';
|
|
|
2
2
|
|
|
3
3
|
const CSMShader = {
|
|
4
4
|
lights_fragment_begin: /* glsl */`
|
|
5
|
-
|
|
5
|
+
vec3 geometryPosition = - vViewPosition;
|
|
6
|
+
vec3 geometryNormal = normal;
|
|
7
|
+
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
geometry.normal = normal;
|
|
9
|
-
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
|
|
9
|
+
vec3 geometryClearcoatNormal;
|
|
10
10
|
|
|
11
|
-
#ifdef
|
|
11
|
+
#ifdef USE_CLEARCOAT
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
geometryClearcoatNormal = clearcoatNormal;
|
|
14
14
|
|
|
15
15
|
#endif
|
|
16
16
|
|
|
17
|
+
#ifdef USE_IRIDESCENCE
|
|
18
|
+
float dotNVi = saturate( dot( normal, geometryViewDir ) );
|
|
19
|
+
if ( material.iridescenceThickness == 0.0 ) {
|
|
20
|
+
material.iridescence = 0.0;
|
|
21
|
+
} else {
|
|
22
|
+
material.iridescence = saturate( material.iridescence );
|
|
23
|
+
}
|
|
24
|
+
if ( material.iridescence > 0.0 ) {
|
|
25
|
+
material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
|
|
26
|
+
// Iridescence F0 approximation
|
|
27
|
+
material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
|
|
28
|
+
}
|
|
29
|
+
#endif
|
|
30
|
+
|
|
17
31
|
IncidentLight directLight;
|
|
18
32
|
|
|
19
33
|
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
|
|
@@ -28,14 +42,14 @@ IncidentLight directLight;
|
|
|
28
42
|
|
|
29
43
|
pointLight = pointLights[ i ];
|
|
30
44
|
|
|
31
|
-
getPointLightInfo( pointLight,
|
|
45
|
+
getPointLightInfo( pointLight, geometryPosition, directLight );
|
|
32
46
|
|
|
33
47
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
|
|
34
48
|
pointLightShadow = pointLightShadows[ i ];
|
|
35
49
|
directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
|
|
36
50
|
#endif
|
|
37
51
|
|
|
38
|
-
RE_Direct( directLight,
|
|
52
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
39
53
|
|
|
40
54
|
}
|
|
41
55
|
#pragma unroll_loop_end
|
|
@@ -45,6 +59,10 @@ IncidentLight directLight;
|
|
|
45
59
|
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
|
|
46
60
|
|
|
47
61
|
SpotLight spotLight;
|
|
62
|
+
vec4 spotColor;
|
|
63
|
+
vec3 spotLightCoord;
|
|
64
|
+
bool inSpotLightMap;
|
|
65
|
+
|
|
48
66
|
#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
|
|
49
67
|
SpotLightShadow spotLightShadow;
|
|
50
68
|
#endif
|
|
@@ -54,7 +72,23 @@ IncidentLight directLight;
|
|
|
54
72
|
|
|
55
73
|
spotLight = spotLights[ i ];
|
|
56
74
|
|
|
57
|
-
getSpotLightInfo( spotLight,
|
|
75
|
+
getSpotLightInfo( spotLight, geometryPosition, directLight );
|
|
76
|
+
|
|
77
|
+
// spot lights are ordered [shadows with maps, shadows without maps, maps without shadows, none]
|
|
78
|
+
#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
|
|
79
|
+
#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
|
|
80
|
+
#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
|
81
|
+
#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
|
|
82
|
+
#else
|
|
83
|
+
#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
|
|
84
|
+
#endif
|
|
85
|
+
#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
|
|
86
|
+
spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
|
|
87
|
+
inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
|
|
88
|
+
spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
|
|
89
|
+
directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
|
|
90
|
+
#endif
|
|
91
|
+
#undef SPOT_LIGHT_MAP_INDEX
|
|
58
92
|
|
|
59
93
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
|
60
94
|
spotLightShadow = spotLightShadows[ i ];
|
|
@@ -62,7 +96,7 @@ IncidentLight directLight;
|
|
|
62
96
|
|
|
63
97
|
#endif
|
|
64
98
|
|
|
65
|
-
RE_Direct( directLight,
|
|
99
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
66
100
|
|
|
67
101
|
}
|
|
68
102
|
#pragma unroll_loop_end
|
|
@@ -89,7 +123,7 @@ IncidentLight directLight;
|
|
|
89
123
|
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
|
|
90
124
|
|
|
91
125
|
directionalLight = directionalLights[ i ];
|
|
92
|
-
getDirectionalLightInfo( directionalLight,
|
|
126
|
+
getDirectionalLightInfo( directionalLight, directLight );
|
|
93
127
|
|
|
94
128
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
|
|
95
129
|
// NOTE: Depth gets larger away from the camera.
|
|
@@ -113,7 +147,7 @@ IncidentLight directLight;
|
|
|
113
147
|
directLight.color = mix( prevColor, directLight.color, shouldFadeLastCascade ? ratio : 1.0 );
|
|
114
148
|
|
|
115
149
|
ReflectedLight prevLight = reflectedLight;
|
|
116
|
-
RE_Direct( directLight,
|
|
150
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
117
151
|
|
|
118
152
|
bool shouldBlend = UNROLLED_LOOP_INDEX != CSM_CASCADES - 1 || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth < cascadeCenter;
|
|
119
153
|
float blendRatio = shouldBlend ? ratio : 1.0;
|
|
@@ -134,14 +168,14 @@ IncidentLight directLight;
|
|
|
134
168
|
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
|
|
135
169
|
|
|
136
170
|
directionalLight = directionalLights[ i ];
|
|
137
|
-
getDirectionalLightInfo( directionalLight,
|
|
171
|
+
getDirectionalLightInfo( directionalLight, directLight );
|
|
138
172
|
|
|
139
173
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
|
|
140
174
|
|
|
141
175
|
directionalLightShadow = directionalLightShadows[ i ];
|
|
142
176
|
if(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y) directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
|
143
177
|
|
|
144
|
-
if(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight,
|
|
178
|
+
if(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
145
179
|
|
|
146
180
|
#endif
|
|
147
181
|
|
|
@@ -158,9 +192,9 @@ IncidentLight directLight;
|
|
|
158
192
|
|
|
159
193
|
directionalLight = directionalLights[ i ];
|
|
160
194
|
|
|
161
|
-
getDirectionalLightInfo( directionalLight,
|
|
195
|
+
getDirectionalLightInfo( directionalLight, directLight );
|
|
162
196
|
|
|
163
|
-
RE_Direct( directLight,
|
|
197
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
164
198
|
|
|
165
199
|
}
|
|
166
200
|
#pragma unroll_loop_end
|
|
@@ -182,14 +216,14 @@ IncidentLight directLight;
|
|
|
182
216
|
|
|
183
217
|
directionalLight = directionalLights[ i ];
|
|
184
218
|
|
|
185
|
-
getDirectionalLightInfo( directionalLight,
|
|
219
|
+
getDirectionalLightInfo( directionalLight, directLight );
|
|
186
220
|
|
|
187
221
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
|
|
188
222
|
directionalLightShadow = directionalLightShadows[ i ];
|
|
189
223
|
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
|
190
224
|
#endif
|
|
191
225
|
|
|
192
|
-
RE_Direct( directLight,
|
|
226
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
193
227
|
|
|
194
228
|
}
|
|
195
229
|
#pragma unroll_loop_end
|
|
@@ -204,7 +238,7 @@ IncidentLight directLight;
|
|
|
204
238
|
for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
|
|
205
239
|
|
|
206
240
|
rectAreaLight = rectAreaLights[ i ];
|
|
207
|
-
RE_Direct_RectArea( rectAreaLight,
|
|
241
|
+
RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
208
242
|
|
|
209
243
|
}
|
|
210
244
|
#pragma unroll_loop_end
|
|
@@ -217,14 +251,18 @@ IncidentLight directLight;
|
|
|
217
251
|
|
|
218
252
|
vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
|
|
219
253
|
|
|
220
|
-
|
|
254
|
+
#if defined( USE_LIGHT_PROBES )
|
|
255
|
+
|
|
256
|
+
irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
|
|
257
|
+
|
|
258
|
+
#endif
|
|
221
259
|
|
|
222
260
|
#if ( NUM_HEMI_LIGHTS > 0 )
|
|
223
261
|
|
|
224
262
|
#pragma unroll_loop_start
|
|
225
263
|
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
|
|
226
264
|
|
|
227
|
-
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ],
|
|
265
|
+
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
|
|
228
266
|
|
|
229
267
|
}
|
|
230
268
|
#pragma unroll_loop_end
|
|
@@ -21,61 +21,107 @@ const ZIP_COMPRESSION = 3;
|
|
|
21
21
|
|
|
22
22
|
class EXRExporter {
|
|
23
23
|
|
|
24
|
-
parse(
|
|
24
|
+
parse( arg1, arg2, arg3 ) {
|
|
25
25
|
|
|
26
|
-
if ( !
|
|
26
|
+
if ( ! arg1 || ! ( arg1.isWebGLRenderer || arg1.isDataTexture ) ) {
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
dataBuffer = getPixelData( renderer, renderTarget, info ),
|
|
30
|
-
rawContentBuffer = reorganizeDataBuffer( dataBuffer, info ),
|
|
31
|
-
chunks = compressData( rawContentBuffer, info );
|
|
28
|
+
throw Error( 'EXRExporter.parse: Unsupported first parameter, expected instance of WebGLRenderer or DataTexture.' );
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
} else if ( arg1.isWebGLRenderer ) {
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
const renderer = arg1, renderTarget = arg2, options = arg3;
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
supportedRTT( renderTarget );
|
|
35
|
+
|
|
36
|
+
const info = buildInfoRTT( renderTarget, options ),
|
|
37
|
+
dataBuffer = getPixelData( renderer, renderTarget, info ),
|
|
38
|
+
rawContentBuffer = reorganizeDataBuffer( dataBuffer, info ),
|
|
39
|
+
chunks = compressData( rawContentBuffer, info );
|
|
40
|
+
|
|
41
|
+
return fillData( chunks, info );
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
} else if ( arg1.isDataTexture ) {
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
const texture = arg1, options = arg2;
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
supportedDT( texture );
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
const info = buildInfoDT( texture, options ),
|
|
50
|
+
dataBuffer = texture.image.data,
|
|
51
|
+
rawContentBuffer = reorganizeDataBuffer( dataBuffer, info ),
|
|
52
|
+
chunks = compressData( rawContentBuffer, info );
|
|
53
|
+
|
|
54
|
+
return fillData( chunks, info );
|
|
55
|
+
|
|
56
|
+
}
|
|
46
57
|
|
|
47
58
|
}
|
|
48
59
|
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function supportedRTT( renderTarget ) {
|
|
63
|
+
|
|
49
64
|
if ( ! renderTarget || ! renderTarget.isWebGLRenderTarget ) {
|
|
50
65
|
|
|
51
|
-
|
|
66
|
+
throw Error( 'EXRExporter.parse: Unsupported second parameter, expected instance of WebGLRenderTarget.' );
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if ( renderTarget.isWebGLCubeRenderTarget || renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget ) {
|
|
52
71
|
|
|
53
|
-
|
|
72
|
+
throw Error( 'EXRExporter.parse: Unsupported render target type, expected instance of WebGLRenderTarget.' );
|
|
54
73
|
|
|
55
74
|
}
|
|
56
75
|
|
|
57
76
|
if ( renderTarget.texture.type !== FloatType && renderTarget.texture.type !== HalfFloatType ) {
|
|
58
77
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return false;
|
|
78
|
+
throw Error( 'EXRExporter.parse: Unsupported WebGLRenderTarget texture type.' );
|
|
62
79
|
|
|
63
80
|
}
|
|
64
81
|
|
|
65
82
|
if ( renderTarget.texture.format !== RGBAFormat ) {
|
|
66
83
|
|
|
67
|
-
|
|
84
|
+
throw Error( 'EXRExporter.parse: Unsupported WebGLRenderTarget texture format, expected RGBAFormat.' );
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function supportedDT( texture ) {
|
|
91
|
+
|
|
92
|
+
if ( texture.type !== FloatType && texture.type !== HalfFloatType ) {
|
|
93
|
+
|
|
94
|
+
throw Error( 'EXRExporter.parse: Unsupported DataTexture texture type.' );
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if ( texture.format !== RGBAFormat ) {
|
|
99
|
+
|
|
100
|
+
throw Error( 'EXRExporter.parse: Unsupported DataTexture texture format, expected RGBAFormat.' );
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if ( ! texture.image.data ) {
|
|
105
|
+
|
|
106
|
+
throw Error( 'EXRExporter.parse: Invalid DataTexture image data.' );
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if ( texture.type === FloatType && texture.image.data.constructor.name !== 'Float32Array' ) {
|
|
68
111
|
|
|
69
|
-
|
|
112
|
+
throw Error( 'EXRExporter.parse: DataTexture image data doesn\'t match type, expected \'Float32Array\'.' );
|
|
70
113
|
|
|
71
114
|
}
|
|
72
115
|
|
|
116
|
+
if ( texture.type === HalfFloatType && texture.image.data.constructor.name !== 'Uint16Array' ) {
|
|
73
117
|
|
|
74
|
-
|
|
118
|
+
throw Error( 'EXRExporter.parse: DataTexture image data doesn\'t match type, expected \'Uint16Array\'.' );
|
|
119
|
+
|
|
120
|
+
}
|
|
75
121
|
|
|
76
122
|
}
|
|
77
123
|
|
|
78
|
-
function
|
|
124
|
+
function buildInfoRTT( renderTarget, options = {} ) {
|
|
79
125
|
|
|
80
126
|
const compressionSizes = {
|
|
81
127
|
0: 1,
|
|
@@ -87,7 +133,6 @@ function buildInfo( renderTarget, options = {} ) {
|
|
|
87
133
|
HEIGHT = renderTarget.height,
|
|
88
134
|
TYPE = renderTarget.texture.type,
|
|
89
135
|
FORMAT = renderTarget.texture.format,
|
|
90
|
-
COLOR_SPACE = renderTarget.texture.colorSpace,
|
|
91
136
|
COMPRESSION = ( options.compression !== undefined ) ? options.compression : ZIP_COMPRESSION,
|
|
92
137
|
EXPORTER_TYPE = ( options.type !== undefined ) ? options.type : HalfFloatType,
|
|
93
138
|
OUT_TYPE = ( EXPORTER_TYPE === FloatType ) ? 2 : 1,
|
|
@@ -99,7 +144,40 @@ function buildInfo( renderTarget, options = {} ) {
|
|
|
99
144
|
height: HEIGHT,
|
|
100
145
|
type: TYPE,
|
|
101
146
|
format: FORMAT,
|
|
102
|
-
|
|
147
|
+
compression: COMPRESSION,
|
|
148
|
+
blockLines: COMPRESSION_SIZE,
|
|
149
|
+
dataType: OUT_TYPE,
|
|
150
|
+
dataSize: 2 * OUT_TYPE,
|
|
151
|
+
numBlocks: Math.ceil( HEIGHT / COMPRESSION_SIZE ),
|
|
152
|
+
numInputChannels: 4,
|
|
153
|
+
numOutputChannels: NUM_CHANNELS,
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function buildInfoDT( texture, options = {} ) {
|
|
159
|
+
|
|
160
|
+
const compressionSizes = {
|
|
161
|
+
0: 1,
|
|
162
|
+
2: 1,
|
|
163
|
+
3: 16
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const WIDTH = texture.image.width,
|
|
167
|
+
HEIGHT = texture.image.height,
|
|
168
|
+
TYPE = texture.type,
|
|
169
|
+
FORMAT = texture.format,
|
|
170
|
+
COMPRESSION = ( options.compression !== undefined ) ? options.compression : ZIP_COMPRESSION,
|
|
171
|
+
EXPORTER_TYPE = ( options.type !== undefined ) ? options.type : HalfFloatType,
|
|
172
|
+
OUT_TYPE = ( EXPORTER_TYPE === FloatType ) ? 2 : 1,
|
|
173
|
+
COMPRESSION_SIZE = compressionSizes[ COMPRESSION ],
|
|
174
|
+
NUM_CHANNELS = 4;
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
width: WIDTH,
|
|
178
|
+
height: HEIGHT,
|
|
179
|
+
type: TYPE,
|
|
180
|
+
format: FORMAT,
|
|
103
181
|
compression: COMPRESSION,
|
|
104
182
|
blockLines: COMPRESSION_SIZE,
|
|
105
183
|
dataType: OUT_TYPE,
|
|
@@ -2438,7 +2438,7 @@ class GLTFLightExtension {
|
|
|
2438
2438
|
if ( light.distance > 0 ) lightDef.range = light.distance;
|
|
2439
2439
|
|
|
2440
2440
|
lightDef.spot = {};
|
|
2441
|
-
lightDef.spot.innerConeAngle = (
|
|
2441
|
+
lightDef.spot.innerConeAngle = ( 1.0 - light.penumbra ) * light.angle;
|
|
2442
2442
|
lightDef.spot.outerConeAngle = light.angle;
|
|
2443
2443
|
|
|
2444
2444
|
}
|