@babylonjs/core 5.23.0 → 5.24.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/Actions/abstractActionManager.d.ts +6 -6
- package/Actions/abstractActionManager.js +1 -1
- package/Actions/abstractActionManager.js.map +1 -1
- package/Actions/actionManager.d.ts +5 -5
- package/Actions/actionManager.js +5 -5
- package/Actions/actionManager.js.map +1 -1
- package/Animations/animationGroup.d.ts +3 -3
- package/Animations/animationGroup.js +3 -3
- package/Animations/animationGroup.js.map +1 -1
- package/Audio/audioSceneComponent.d.ts +1 -1
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.d.ts +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Cameras/bouncingBehavior.d.ts +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
- package/Behaviors/Cameras/framingBehavior.js +1 -1
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Bones/bone.d.ts +1 -1
- package/Bones/bone.js +1 -1
- package/Bones/bone.js.map +1 -1
- package/Bones/skeleton.d.ts +2 -2
- package/Bones/skeleton.js +2 -2
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +1 -1
- package/Cameras/arcRotateCamera.js +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +2 -2
- package/Cameras/camera.js +2 -2
- package/Cameras/camera.js.map +1 -1
- package/Cameras/freeCamera.d.ts +1 -1
- package/Cameras/freeCamera.js +1 -1
- package/Cameras/freeCamera.js.map +1 -1
- package/Cameras/gamepadCamera.d.ts +1 -1
- package/Cameras/gamepadCamera.js +1 -1
- package/Cameras/gamepadCamera.js.map +1 -1
- package/Cameras/targetCamera.d.ts +1 -1
- package/Cameras/targetCamera.js +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Cameras/touchCamera.d.ts +1 -1
- package/Cameras/touchCamera.js +1 -1
- package/Cameras/touchCamera.js.map +1 -1
- package/Cameras/universalCamera.d.ts +1 -1
- package/Cameras/universalCamera.js +1 -1
- package/Cameras/universalCamera.js.map +1 -1
- package/Cameras/virtualJoysticksCamera.d.ts +1 -1
- package/Cameras/virtualJoysticksCamera.js +1 -1
- package/Cameras/virtualJoysticksCamera.js.map +1 -1
- package/Culling/boundingBox.d.ts +2 -2
- package/Culling/boundingBox.js +2 -2
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/ray.d.ts +1 -1
- package/Culling/ray.js +1 -1
- package/Culling/ray.js.map +1 -1
- package/Debug/debugLayer.d.ts +1 -1
- package/Debug/debugLayer.js +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +8 -10
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.query.d.ts +2 -2
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/ICanvas.d.ts +11 -0
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/WebGL/webGLPipelineContext.d.ts +29 -19
- package/Engines/WebGL/webGLPipelineContext.js +99 -311
- package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/engine.d.ts +2 -2
- package/Engines/engine.js +2 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +2 -2
- package/Engines/nativeEngine.js +2 -2
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +1 -0
- package/Engines/renderTargetWrapper.js +5 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +6 -5
- package/Engines/thinEngine.js +11 -7
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +4 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/clipboardEvents.d.ts +1 -1
- package/Events/clipboardEvents.js +1 -1
- package/Events/clipboardEvents.js.map +1 -1
- package/Gamepads/Controllers/windowsMotionController.d.ts +1 -1
- package/Gamepads/Controllers/windowsMotionController.js +1 -1
- package/Gamepads/Controllers/windowsMotionController.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +4 -0
- package/Gizmos/boundingBoxGizmo.js +6 -0
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Layers/effectLayer.d.ts +3 -3
- package/Layers/effectLayer.js +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +3 -3
- package/Layers/glowLayer.js +2 -2
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +3 -3
- package/Layers/highlightLayer.js +2 -2
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/directionalLight.d.ts +2 -2
- package/Lights/directionalLight.js +2 -2
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/hemisphericLight.d.ts +3 -3
- package/Lights/hemisphericLight.js +3 -3
- package/Lights/hemisphericLight.js.map +1 -1
- package/Lights/light.d.ts +2 -2
- package/Lights/light.js +2 -2
- package/Lights/light.js.map +1 -1
- package/Lights/lightConstants.d.ts +1 -1
- package/Lights/lightConstants.js +1 -1
- package/Lights/lightConstants.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +1 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +1 -1
- package/Materials/Node/nodeMaterial.js +2 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +1 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.d.ts +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.js +9 -3
- package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +9 -9
- package/Materials/Textures/Procedurals/proceduralTexture.js +9 -9
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/colorGradingTexture.d.ts +1 -1
- package/Materials/Textures/colorGradingTexture.js +1 -1
- package/Materials/Textures/colorGradingTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.d.ts +2 -2
- package/Materials/Textures/cubeTexture.js +2 -2
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.d.ts +1 -1
- package/Materials/Textures/rawCubeTexture.js +1 -1
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +3 -5
- package/Materials/Textures/renderTargetTexture.js +19 -19
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/colorCurves.d.ts +3 -3
- package/Materials/colorCurves.js +3 -3
- package/Materials/colorCurves.js.map +1 -1
- package/Materials/effect.d.ts +27 -27
- package/Materials/effect.js +22 -288
- package/Materials/effect.js.map +1 -1
- package/Materials/fresnelParameters.d.ts +1 -1
- package/Materials/fresnelParameters.js +1 -1
- package/Materials/fresnelParameters.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +4 -4
- package/Materials/imageProcessingConfiguration.js +4 -4
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +25 -25
- package/Materials/shaderMaterial.js +25 -25
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.js +1 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Maths/math.functions.d.ts +2 -2
- package/Maths/math.functions.js +2 -2
- package/Maths/math.functions.js.map +1 -1
- package/Maths/math.polar.d.ts +77 -0
- package/Maths/math.polar.js +114 -0
- package/Maths/math.polar.js.map +1 -0
- package/Maths/math.scalar.d.ts +2 -2
- package/Maths/math.scalar.js +2 -2
- package/Maths/math.scalar.js.map +1 -1
- package/Maths/math.vector.d.ts +13 -12
- package/Maths/math.vector.js +13 -12
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +1 -1
- package/Meshes/abstractMesh.js +9 -4
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +3 -3
- package/Meshes/geometry.js +3 -3
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +1 -1
- package/Meshes/instancedMesh.js +1 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +3 -3
- package/Meshes/mesh.js +7 -3
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/subMesh.d.ts +1 -1
- package/Meshes/subMesh.js +1 -1
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.d.ts +1 -1
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Meshes/transformNode.js +3 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +2 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/HighDynamicRange/hdr.d.ts +3 -3
- package/Misc/HighDynamicRange/hdr.js +3 -3
- package/Misc/HighDynamicRange/hdr.js.map +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.d.ts +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
- package/Misc/arrayTools.d.ts +13 -12
- package/Misc/arrayTools.js +70 -39
- package/Misc/arrayTools.js.map +1 -1
- package/Misc/assetsManager.d.ts +3 -3
- package/Misc/assetsManager.js +3 -3
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +1 -1
- package/Misc/basis.js.map +1 -1
- package/Misc/environmentTextureTools.d.ts +4 -4
- package/Misc/environmentTextureTools.js +5 -5
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/fileTools.d.ts +3 -3
- package/Misc/fileTools.js +19 -12
- package/Misc/fileTools.js.map +1 -1
- package/Misc/observable.d.ts +1 -1
- package/Misc/observable.js +1 -1
- package/Misc/observable.js.map +1 -1
- package/Misc/performanceMonitor.d.ts +3 -3
- package/Misc/performanceMonitor.js +3 -3
- package/Misc/performanceMonitor.js.map +1 -1
- package/Misc/rgbdTextureTools.d.ts +1 -1
- package/Misc/rgbdTextureTools.js +1 -1
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/sceneOptimizer.d.ts +7 -7
- package/Misc/sceneOptimizer.js +7 -7
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/stringDictionary.d.ts +6 -6
- package/Misc/stringDictionary.js +6 -6
- package/Misc/stringDictionary.js.map +1 -1
- package/Misc/textureTools.d.ts +4 -4
- package/Misc/textureTools.js +4 -4
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.d.ts +6 -6
- package/Misc/tools.js +6 -6
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.d.ts +1 -1
- package/Misc/videoRecorder.js +1 -1
- package/Misc/videoRecorder.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +1 -1
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +1 -1
- package/Particles/gpuParticleSystem.js +1 -1
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +1 -1
- package/Particles/particleSystem.js +1 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +4 -0
- package/Particles/solidParticleSystem.js +25 -3
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Physics/Plugins/ammoJSPlugin.d.ts +1 -1
- package/Physics/Plugins/ammoJSPlugin.js +1 -1
- package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.js +1 -1
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/Physics/physicsEngineComponent.d.ts +1 -1
- package/Physics/physicsEngineComponent.js +1 -1
- package/Physics/physicsEngineComponent.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +3 -3
- package/PostProcesses/blurPostProcess.js +3 -3
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +3 -3
- package/PostProcesses/volumetricLightScatteringPostProcess.js +3 -3
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/depthPeelingRenderer.d.ts +1 -0
- package/Rendering/depthPeelingRenderer.js +32 -5
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.d.ts +2 -2
- package/Rendering/edgesRenderer.js +1 -1
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +4 -2
- package/Rendering/geometryBufferRenderer.js +5 -3
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/geometryBufferRendererSceneComponent.d.ts +2 -1
- package/Rendering/geometryBufferRendererSceneComponent.js +3 -2
- package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
- package/Rendering/prePassRenderer.d.ts +11 -3
- package/Rendering/prePassRenderer.js +18 -3
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.d.ts +2 -2
- package/Rendering/subSurfaceConfiguration.js +2 -2
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +4 -0
- package/XR/features/WebXRControllerTeleportation.js +24 -19
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.d.ts +2 -2
- package/XR/motionController/webXRAbstractMotionController.js +2 -2
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/motionController/webXRControllerComponent.d.ts +1 -1
- package/XR/motionController/webXRControllerComponent.js +1 -1
- package/XR/motionController/webXRControllerComponent.js.map +1 -1
- package/XR/motionController/webXRMotionControllerManager.d.ts +3 -3
- package/XR/motionController/webXRMotionControllerManager.js +3 -3
- package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
- package/node.d.ts +4 -4
- package/node.js +3 -3
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +61 -61
- package/scene.js +58 -46
- package/scene.js.map +1 -1
|
@@ -19,6 +19,7 @@ export declare class WebGLPipelineContext implements IPipelineContext {
|
|
|
19
19
|
fragmentCompilationError: Nullable<string>;
|
|
20
20
|
programLinkError: Nullable<string>;
|
|
21
21
|
programValidationError: Nullable<string>;
|
|
22
|
+
constructor();
|
|
22
23
|
get isAsync(): boolean;
|
|
23
24
|
get isReady(): boolean;
|
|
24
25
|
_handlesSpectorRebuildCallback(onCompiled: (program: WebGLProgram) => void): void;
|
|
@@ -39,6 +40,15 @@ export declare class WebGLPipelineContext implements IPipelineContext {
|
|
|
39
40
|
* @hidden
|
|
40
41
|
*/
|
|
41
42
|
_cacheMatrix(uniformName: string, matrix: IMatrixLike): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* @param _uniformName
|
|
45
|
+
* @param _x
|
|
46
|
+
* @param _y
|
|
47
|
+
* @param _z
|
|
48
|
+
* @param _w
|
|
49
|
+
* @hidden
|
|
50
|
+
*/
|
|
51
|
+
_cacheFloatN(_uniformName: string, _x: number, _y?: number, _z?: number, _w?: number): boolean;
|
|
42
52
|
/**
|
|
43
53
|
* @param uniformName
|
|
44
54
|
* @param x
|
|
@@ -68,14 +78,14 @@ export declare class WebGLPipelineContext implements IPipelineContext {
|
|
|
68
78
|
* @param uniformName Name of the variable.
|
|
69
79
|
* @param value Value to be set.
|
|
70
80
|
*/
|
|
71
|
-
setInt(uniformName: string, value: number)
|
|
81
|
+
setInt: (uniformName: string, value: number) => void;
|
|
72
82
|
/**
|
|
73
83
|
* Sets a int2 on a uniform variable.
|
|
74
84
|
* @param uniformName Name of the variable.
|
|
75
85
|
* @param x First int in int2.
|
|
76
86
|
* @param y Second int in int2.
|
|
77
87
|
*/
|
|
78
|
-
setInt2(uniformName: string, x: number, y: number)
|
|
88
|
+
setInt2: (uniformName: string, x: number, y: number) => void;
|
|
79
89
|
/**
|
|
80
90
|
* Sets a int3 on a uniform variable.
|
|
81
91
|
* @param uniformName Name of the variable.
|
|
@@ -83,7 +93,7 @@ export declare class WebGLPipelineContext implements IPipelineContext {
|
|
|
83
93
|
* @param y Second int in int3.
|
|
84
94
|
* @param z Third int in int3.
|
|
85
95
|
*/
|
|
86
|
-
setInt3(uniformName: string, x: number, y: number, z: number)
|
|
96
|
+
setInt3: (uniformName: string, x: number, y: number, z: number) => void;
|
|
87
97
|
/**
|
|
88
98
|
* Sets a int4 on a uniform variable.
|
|
89
99
|
* @param uniformName Name of the variable.
|
|
@@ -92,62 +102,62 @@ export declare class WebGLPipelineContext implements IPipelineContext {
|
|
|
92
102
|
* @param z Third int in int4.
|
|
93
103
|
* @param w Fourth int in int4.
|
|
94
104
|
*/
|
|
95
|
-
setInt4(uniformName: string, x: number, y: number, z: number, w: number)
|
|
105
|
+
setInt4: (uniformName: string, x: number, y: number, z: number, w: number) => void;
|
|
96
106
|
/**
|
|
97
107
|
* Sets an int array on a uniform variable.
|
|
98
108
|
* @param uniformName Name of the variable.
|
|
99
109
|
* @param array array to be set.
|
|
100
110
|
*/
|
|
101
|
-
setIntArray(uniformName: string, array: Int32Array)
|
|
111
|
+
setIntArray: (uniformName: string, array: Int32Array) => void;
|
|
102
112
|
/**
|
|
103
113
|
* Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
|
|
104
114
|
* @param uniformName Name of the variable.
|
|
105
115
|
* @param array array to be set.
|
|
106
116
|
*/
|
|
107
|
-
setIntArray2(uniformName: string, array: Int32Array)
|
|
117
|
+
setIntArray2: (uniformName: string, array: Int32Array) => void;
|
|
108
118
|
/**
|
|
109
119
|
* Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
|
|
110
120
|
* @param uniformName Name of the variable.
|
|
111
121
|
* @param array array to be set.
|
|
112
122
|
*/
|
|
113
|
-
setIntArray3(uniformName: string, array: Int32Array)
|
|
123
|
+
setIntArray3: (uniformName: string, array: Int32Array) => void;
|
|
114
124
|
/**
|
|
115
125
|
* Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
|
|
116
126
|
* @param uniformName Name of the variable.
|
|
117
127
|
* @param array array to be set.
|
|
118
128
|
*/
|
|
119
|
-
setIntArray4(uniformName: string, array: Int32Array)
|
|
129
|
+
setIntArray4: (uniformName: string, array: Int32Array) => void;
|
|
120
130
|
/**
|
|
121
131
|
* Sets an array on a uniform variable.
|
|
122
132
|
* @param uniformName Name of the variable.
|
|
123
133
|
* @param array array to be set.
|
|
124
134
|
*/
|
|
125
|
-
setArray(uniformName: string, array: number[])
|
|
135
|
+
setArray: (uniformName: string, array: number[]) => void;
|
|
126
136
|
/**
|
|
127
137
|
* Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
|
|
128
138
|
* @param uniformName Name of the variable.
|
|
129
139
|
* @param array array to be set.
|
|
130
140
|
*/
|
|
131
|
-
setArray2(uniformName: string, array: number[])
|
|
141
|
+
setArray2: (uniformName: string, array: number[]) => void;
|
|
132
142
|
/**
|
|
133
143
|
* Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
|
|
134
144
|
* @param uniformName Name of the variable.
|
|
135
145
|
* @param array array to be set.
|
|
136
146
|
* @returns this effect.
|
|
137
147
|
*/
|
|
138
|
-
setArray3(uniformName: string, array: number[])
|
|
148
|
+
setArray3: (uniformName: string, array: number[]) => void;
|
|
139
149
|
/**
|
|
140
150
|
* Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
|
|
141
151
|
* @param uniformName Name of the variable.
|
|
142
152
|
* @param array array to be set.
|
|
143
153
|
*/
|
|
144
|
-
setArray4(uniformName: string, array: number[])
|
|
154
|
+
setArray4: (uniformName: string, array: number[]) => void;
|
|
145
155
|
/**
|
|
146
156
|
* Sets matrices on a uniform variable.
|
|
147
157
|
* @param uniformName Name of the variable.
|
|
148
158
|
* @param matrices matrices to be set.
|
|
149
159
|
*/
|
|
150
|
-
setMatrices(uniformName: string, matrices: Float32Array)
|
|
160
|
+
setMatrices: (uniformName: string, matrices: Float32Array) => void;
|
|
151
161
|
/**
|
|
152
162
|
* Sets matrix on a uniform variable.
|
|
153
163
|
* @param uniformName Name of the variable.
|
|
@@ -159,20 +169,20 @@ export declare class WebGLPipelineContext implements IPipelineContext {
|
|
|
159
169
|
* @param uniformName Name of the variable.
|
|
160
170
|
* @param matrix matrix to be set.
|
|
161
171
|
*/
|
|
162
|
-
setMatrix3x3(uniformName: string, matrix: Float32Array)
|
|
172
|
+
setMatrix3x3: (uniformName: string, matrix: Float32Array) => void;
|
|
163
173
|
/**
|
|
164
174
|
* Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
|
|
165
175
|
* @param uniformName Name of the variable.
|
|
166
176
|
* @param matrix matrix to be set.
|
|
167
177
|
*/
|
|
168
|
-
setMatrix2x2(uniformName: string, matrix: Float32Array)
|
|
178
|
+
setMatrix2x2: (uniformName: string, matrix: Float32Array) => void;
|
|
169
179
|
/**
|
|
170
180
|
* Sets a float on a uniform variable.
|
|
171
181
|
* @param uniformName Name of the variable.
|
|
172
182
|
* @param value value to be set.
|
|
173
183
|
* @returns this effect.
|
|
174
184
|
*/
|
|
175
|
-
setFloat(uniformName: string, value: number)
|
|
185
|
+
setFloat: (uniformName: string, value: number) => void;
|
|
176
186
|
/**
|
|
177
187
|
* Sets a Vector2 on a uniform variable.
|
|
178
188
|
* @param uniformName Name of the variable.
|
|
@@ -185,7 +195,7 @@ export declare class WebGLPipelineContext implements IPipelineContext {
|
|
|
185
195
|
* @param x First float in float2.
|
|
186
196
|
* @param y Second float in float2.
|
|
187
197
|
*/
|
|
188
|
-
setFloat2(uniformName: string, x: number, y: number)
|
|
198
|
+
setFloat2: (uniformName: string, x: number, y: number) => void;
|
|
189
199
|
/**
|
|
190
200
|
* Sets a Vector3 on a uniform variable.
|
|
191
201
|
* @param uniformName Name of the variable.
|
|
@@ -199,7 +209,7 @@ export declare class WebGLPipelineContext implements IPipelineContext {
|
|
|
199
209
|
* @param y Second float in float3.
|
|
200
210
|
* @param z Third float in float3.
|
|
201
211
|
*/
|
|
202
|
-
setFloat3(uniformName: string, x: number, y: number, z: number)
|
|
212
|
+
setFloat3: (uniformName: string, x: number, y: number, z: number) => void;
|
|
203
213
|
/**
|
|
204
214
|
* Sets a Vector4 on a uniform variable.
|
|
205
215
|
* @param uniformName Name of the variable.
|
|
@@ -221,7 +231,7 @@ export declare class WebGLPipelineContext implements IPipelineContext {
|
|
|
221
231
|
* @param w Fourth float in float4.
|
|
222
232
|
* @returns this effect.
|
|
223
233
|
*/
|
|
224
|
-
setFloat4(uniformName: string, x: number, y: number, z: number, w: number)
|
|
234
|
+
setFloat4: (uniformName: string, x: number, y: number, z: number, w: number) => void;
|
|
225
235
|
/**
|
|
226
236
|
* Sets a Color3 on a uniform variable.
|
|
227
237
|
* @param uniformName Name of the variable.
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
const floatNCache = [
|
|
2
|
+
"Int2",
|
|
3
|
+
"Int",
|
|
4
|
+
"Int3",
|
|
5
|
+
"Int4",
|
|
6
|
+
"Vector2",
|
|
7
|
+
"Vector3",
|
|
8
|
+
"Vector4",
|
|
9
|
+
"Float2",
|
|
10
|
+
"Float",
|
|
11
|
+
"Float3",
|
|
12
|
+
"Float4",
|
|
13
|
+
"Quaternion",
|
|
14
|
+
"Color3",
|
|
15
|
+
"Color4",
|
|
16
|
+
"DirectColor4",
|
|
17
|
+
];
|
|
1
18
|
/** @hidden */
|
|
2
19
|
export class WebGLPipelineContext {
|
|
3
20
|
constructor() {
|
|
@@ -6,6 +23,51 @@ export class WebGLPipelineContext {
|
|
|
6
23
|
this.fragmentCompilationError = null;
|
|
7
24
|
this.programLinkError = null;
|
|
8
25
|
this.programValidationError = null;
|
|
26
|
+
const args = [];
|
|
27
|
+
const prepareArray = function () {
|
|
28
|
+
args.length = 0;
|
|
29
|
+
Array.prototype.push.apply(args, arguments);
|
|
30
|
+
args[0] = this._uniforms[args[0]];
|
|
31
|
+
};
|
|
32
|
+
const proxyFunction = (functionName) => {
|
|
33
|
+
const cacheFunction = floatNCache.includes(functionName.substring(3)) && "FloatN";
|
|
34
|
+
if (cacheFunction) {
|
|
35
|
+
const cacheFunc = this[`_cache${cacheFunction}`];
|
|
36
|
+
return function () {
|
|
37
|
+
const func = this.engine[functionName];
|
|
38
|
+
prepareArray.apply(this, arguments);
|
|
39
|
+
if (cacheFunc.apply(this, arguments)) {
|
|
40
|
+
if (!func.apply(this.engine, args)) {
|
|
41
|
+
this._valueCache[arguments[0]] = null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return function () {
|
|
48
|
+
const func = this.engine[functionName];
|
|
49
|
+
prepareArray.apply(this, arguments);
|
|
50
|
+
if (arguments[1] !== undefined) {
|
|
51
|
+
this._valueCache[arguments[0]] = null;
|
|
52
|
+
func.apply(this.engine, args);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
["Int?", "IntArray?", "Array?", "Float?", "Matrices", "Matrix3x3", "Matrix2x2"].forEach((functionName) => {
|
|
58
|
+
const name = `set${functionName}`;
|
|
59
|
+
if (this[name]) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (name.endsWith("?")) {
|
|
63
|
+
["", 2, 3, 4].forEach((n) => {
|
|
64
|
+
this[(name.slice(0, -1) + n)] = this[(name.slice(0, -1) + n)] || proxyFunction(name.slice(0, -1) + n).bind(this);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this[name] = this[name] || proxyFunction(name).bind(this);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
9
71
|
}
|
|
10
72
|
get isAsync() {
|
|
11
73
|
return this.isParallelCompiled;
|
|
@@ -72,29 +134,42 @@ export class WebGLPipelineContext {
|
|
|
72
134
|
return true;
|
|
73
135
|
}
|
|
74
136
|
/**
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
* @param
|
|
137
|
+
* @param _uniformName
|
|
138
|
+
* @param _x
|
|
139
|
+
* @param _y
|
|
140
|
+
* @param _z
|
|
141
|
+
* @param _w
|
|
78
142
|
* @hidden
|
|
79
143
|
*/
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
144
|
+
_cacheFloatN(_uniformName, _x, _y, _z, _w) {
|
|
145
|
+
/**
|
|
146
|
+
* arguments will be used to abstract the cache function.
|
|
147
|
+
* arguments[0] is the uniform name. the rest are numbers.
|
|
148
|
+
*/
|
|
149
|
+
let cache = this._valueCache[arguments[0]];
|
|
150
|
+
if (!cache || cache.length !== arguments.length - 1) {
|
|
151
|
+
cache = Array.prototype.slice.call(arguments, 1);
|
|
152
|
+
this._valueCache[arguments[0]] = cache;
|
|
85
153
|
return true;
|
|
86
154
|
}
|
|
87
155
|
let changed = false;
|
|
88
|
-
|
|
89
|
-
cache[
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
cache[1] = y;
|
|
94
|
-
changed = true;
|
|
156
|
+
for (let i = 0; i < cache.length; ++i) {
|
|
157
|
+
if (cache[i] !== arguments[i + 1]) {
|
|
158
|
+
cache[i] = arguments[i + 1];
|
|
159
|
+
changed = true;
|
|
160
|
+
}
|
|
95
161
|
}
|
|
96
162
|
return changed;
|
|
97
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* @param uniformName
|
|
166
|
+
* @param x
|
|
167
|
+
* @param y
|
|
168
|
+
* @hidden
|
|
169
|
+
*/
|
|
170
|
+
_cacheFloat2(uniformName, x, y) {
|
|
171
|
+
return this._cacheFloatN(uniformName, x, y);
|
|
172
|
+
}
|
|
98
173
|
/**
|
|
99
174
|
* @param uniformName
|
|
100
175
|
* @param x
|
|
@@ -103,26 +178,7 @@ export class WebGLPipelineContext {
|
|
|
103
178
|
* @hidden
|
|
104
179
|
*/
|
|
105
180
|
_cacheFloat3(uniformName, x, y, z) {
|
|
106
|
-
|
|
107
|
-
if (!cache || cache.length !== 3) {
|
|
108
|
-
cache = [x, y, z];
|
|
109
|
-
this._valueCache[uniformName] = cache;
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
let changed = false;
|
|
113
|
-
if (cache[0] !== x) {
|
|
114
|
-
cache[0] = x;
|
|
115
|
-
changed = true;
|
|
116
|
-
}
|
|
117
|
-
if (cache[1] !== y) {
|
|
118
|
-
cache[1] = y;
|
|
119
|
-
changed = true;
|
|
120
|
-
}
|
|
121
|
-
if (cache[2] !== z) {
|
|
122
|
-
cache[2] = z;
|
|
123
|
-
changed = true;
|
|
124
|
-
}
|
|
125
|
-
return changed;
|
|
181
|
+
return this._cacheFloatN(uniformName, x, y, z);
|
|
126
182
|
}
|
|
127
183
|
/**
|
|
128
184
|
* @param uniformName
|
|
@@ -133,171 +189,7 @@ export class WebGLPipelineContext {
|
|
|
133
189
|
* @hidden
|
|
134
190
|
*/
|
|
135
191
|
_cacheFloat4(uniformName, x, y, z, w) {
|
|
136
|
-
|
|
137
|
-
if (!cache || cache.length !== 4) {
|
|
138
|
-
cache = [x, y, z, w];
|
|
139
|
-
this._valueCache[uniformName] = cache;
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
let changed = false;
|
|
143
|
-
if (cache[0] !== x) {
|
|
144
|
-
cache[0] = x;
|
|
145
|
-
changed = true;
|
|
146
|
-
}
|
|
147
|
-
if (cache[1] !== y) {
|
|
148
|
-
cache[1] = y;
|
|
149
|
-
changed = true;
|
|
150
|
-
}
|
|
151
|
-
if (cache[2] !== z) {
|
|
152
|
-
cache[2] = z;
|
|
153
|
-
changed = true;
|
|
154
|
-
}
|
|
155
|
-
if (cache[3] !== w) {
|
|
156
|
-
cache[3] = w;
|
|
157
|
-
changed = true;
|
|
158
|
-
}
|
|
159
|
-
return changed;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Sets an integer value on a uniform variable.
|
|
163
|
-
* @param uniformName Name of the variable.
|
|
164
|
-
* @param value Value to be set.
|
|
165
|
-
*/
|
|
166
|
-
setInt(uniformName, value) {
|
|
167
|
-
const cache = this._valueCache[uniformName];
|
|
168
|
-
if (cache !== undefined && cache === value) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
if (this.engine.setInt(this._uniforms[uniformName], value)) {
|
|
172
|
-
this._valueCache[uniformName] = value;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Sets a int2 on a uniform variable.
|
|
177
|
-
* @param uniformName Name of the variable.
|
|
178
|
-
* @param x First int in int2.
|
|
179
|
-
* @param y Second int in int2.
|
|
180
|
-
*/
|
|
181
|
-
setInt2(uniformName, x, y) {
|
|
182
|
-
if (this._cacheFloat2(uniformName, x, y)) {
|
|
183
|
-
if (!this.engine.setInt2(this._uniforms[uniformName], x, y)) {
|
|
184
|
-
this._valueCache[uniformName] = null;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Sets a int3 on a uniform variable.
|
|
190
|
-
* @param uniformName Name of the variable.
|
|
191
|
-
* @param x First int in int3.
|
|
192
|
-
* @param y Second int in int3.
|
|
193
|
-
* @param z Third int in int3.
|
|
194
|
-
*/
|
|
195
|
-
setInt3(uniformName, x, y, z) {
|
|
196
|
-
if (this._cacheFloat3(uniformName, x, y, z)) {
|
|
197
|
-
if (!this.engine.setInt3(this._uniforms[uniformName], x, y, z)) {
|
|
198
|
-
this._valueCache[uniformName] = null;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Sets a int4 on a uniform variable.
|
|
204
|
-
* @param uniformName Name of the variable.
|
|
205
|
-
* @param x First int in int4.
|
|
206
|
-
* @param y Second int in int4.
|
|
207
|
-
* @param z Third int in int4.
|
|
208
|
-
* @param w Fourth int in int4.
|
|
209
|
-
*/
|
|
210
|
-
setInt4(uniformName, x, y, z, w) {
|
|
211
|
-
if (this._cacheFloat4(uniformName, x, y, z, w)) {
|
|
212
|
-
if (!this.engine.setInt4(this._uniforms[uniformName], x, y, z, w)) {
|
|
213
|
-
this._valueCache[uniformName] = null;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Sets an int array on a uniform variable.
|
|
219
|
-
* @param uniformName Name of the variable.
|
|
220
|
-
* @param array array to be set.
|
|
221
|
-
*/
|
|
222
|
-
setIntArray(uniformName, array) {
|
|
223
|
-
this._valueCache[uniformName] = null;
|
|
224
|
-
this.engine.setIntArray(this._uniforms[uniformName], array);
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
|
|
228
|
-
* @param uniformName Name of the variable.
|
|
229
|
-
* @param array array to be set.
|
|
230
|
-
*/
|
|
231
|
-
setIntArray2(uniformName, array) {
|
|
232
|
-
this._valueCache[uniformName] = null;
|
|
233
|
-
this.engine.setIntArray2(this._uniforms[uniformName], array);
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
|
|
237
|
-
* @param uniformName Name of the variable.
|
|
238
|
-
* @param array array to be set.
|
|
239
|
-
*/
|
|
240
|
-
setIntArray3(uniformName, array) {
|
|
241
|
-
this._valueCache[uniformName] = null;
|
|
242
|
-
this.engine.setIntArray3(this._uniforms[uniformName], array);
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
|
|
246
|
-
* @param uniformName Name of the variable.
|
|
247
|
-
* @param array array to be set.
|
|
248
|
-
*/
|
|
249
|
-
setIntArray4(uniformName, array) {
|
|
250
|
-
this._valueCache[uniformName] = null;
|
|
251
|
-
this.engine.setIntArray4(this._uniforms[uniformName], array);
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Sets an array on a uniform variable.
|
|
255
|
-
* @param uniformName Name of the variable.
|
|
256
|
-
* @param array array to be set.
|
|
257
|
-
*/
|
|
258
|
-
setArray(uniformName, array) {
|
|
259
|
-
this._valueCache[uniformName] = null;
|
|
260
|
-
this.engine.setArray(this._uniforms[uniformName], array);
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
|
|
264
|
-
* @param uniformName Name of the variable.
|
|
265
|
-
* @param array array to be set.
|
|
266
|
-
*/
|
|
267
|
-
setArray2(uniformName, array) {
|
|
268
|
-
this._valueCache[uniformName] = null;
|
|
269
|
-
this.engine.setArray2(this._uniforms[uniformName], array);
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
|
|
273
|
-
* @param uniformName Name of the variable.
|
|
274
|
-
* @param array array to be set.
|
|
275
|
-
* @returns this effect.
|
|
276
|
-
*/
|
|
277
|
-
setArray3(uniformName, array) {
|
|
278
|
-
this._valueCache[uniformName] = null;
|
|
279
|
-
this.engine.setArray3(this._uniforms[uniformName], array);
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
|
|
283
|
-
* @param uniformName Name of the variable.
|
|
284
|
-
* @param array array to be set.
|
|
285
|
-
*/
|
|
286
|
-
setArray4(uniformName, array) {
|
|
287
|
-
this._valueCache[uniformName] = null;
|
|
288
|
-
this.engine.setArray4(this._uniforms[uniformName], array);
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* Sets matrices on a uniform variable.
|
|
292
|
-
* @param uniformName Name of the variable.
|
|
293
|
-
* @param matrices matrices to be set.
|
|
294
|
-
*/
|
|
295
|
-
setMatrices(uniformName, matrices) {
|
|
296
|
-
if (!matrices) {
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
this._valueCache[uniformName] = null;
|
|
300
|
-
this.engine.setMatrices(this._uniforms[uniformName], matrices);
|
|
192
|
+
return this._cacheFloatN(uniformName, x, y, z, w);
|
|
301
193
|
}
|
|
302
194
|
/**
|
|
303
195
|
* Sets matrix on a uniform variable.
|
|
@@ -311,63 +203,13 @@ export class WebGLPipelineContext {
|
|
|
311
203
|
}
|
|
312
204
|
}
|
|
313
205
|
}
|
|
314
|
-
/**
|
|
315
|
-
* Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)
|
|
316
|
-
* @param uniformName Name of the variable.
|
|
317
|
-
* @param matrix matrix to be set.
|
|
318
|
-
*/
|
|
319
|
-
setMatrix3x3(uniformName, matrix) {
|
|
320
|
-
this._valueCache[uniformName] = null;
|
|
321
|
-
this.engine.setMatrix3x3(this._uniforms[uniformName], matrix);
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
|
|
325
|
-
* @param uniformName Name of the variable.
|
|
326
|
-
* @param matrix matrix to be set.
|
|
327
|
-
*/
|
|
328
|
-
setMatrix2x2(uniformName, matrix) {
|
|
329
|
-
this._valueCache[uniformName] = null;
|
|
330
|
-
this.engine.setMatrix2x2(this._uniforms[uniformName], matrix);
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Sets a float on a uniform variable.
|
|
334
|
-
* @param uniformName Name of the variable.
|
|
335
|
-
* @param value value to be set.
|
|
336
|
-
* @returns this effect.
|
|
337
|
-
*/
|
|
338
|
-
setFloat(uniformName, value) {
|
|
339
|
-
const cache = this._valueCache[uniformName];
|
|
340
|
-
if (cache !== undefined && cache === value) {
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
if (this.engine.setFloat(this._uniforms[uniformName], value)) {
|
|
344
|
-
this._valueCache[uniformName] = value;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
206
|
/**
|
|
348
207
|
* Sets a Vector2 on a uniform variable.
|
|
349
208
|
* @param uniformName Name of the variable.
|
|
350
209
|
* @param vector2 vector2 to be set.
|
|
351
210
|
*/
|
|
352
211
|
setVector2(uniformName, vector2) {
|
|
353
|
-
|
|
354
|
-
if (!this.engine.setFloat2(this._uniforms[uniformName], vector2.x, vector2.y)) {
|
|
355
|
-
this._valueCache[uniformName] = null;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Sets a float2 on a uniform variable.
|
|
361
|
-
* @param uniformName Name of the variable.
|
|
362
|
-
* @param x First float in float2.
|
|
363
|
-
* @param y Second float in float2.
|
|
364
|
-
*/
|
|
365
|
-
setFloat2(uniformName, x, y) {
|
|
366
|
-
if (this._cacheFloat2(uniformName, x, y)) {
|
|
367
|
-
if (!this.engine.setFloat2(this._uniforms[uniformName], x, y)) {
|
|
368
|
-
this._valueCache[uniformName] = null;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
212
|
+
this.setFloat2(uniformName, vector2.x, vector2.y);
|
|
371
213
|
}
|
|
372
214
|
/**
|
|
373
215
|
* Sets a Vector3 on a uniform variable.
|
|
@@ -375,25 +217,7 @@ export class WebGLPipelineContext {
|
|
|
375
217
|
* @param vector3 Value to be set.
|
|
376
218
|
*/
|
|
377
219
|
setVector3(uniformName, vector3) {
|
|
378
|
-
|
|
379
|
-
if (!this.engine.setFloat3(this._uniforms[uniformName], vector3.x, vector3.y, vector3.z)) {
|
|
380
|
-
this._valueCache[uniformName] = null;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Sets a float3 on a uniform variable.
|
|
386
|
-
* @param uniformName Name of the variable.
|
|
387
|
-
* @param x First float in float3.
|
|
388
|
-
* @param y Second float in float3.
|
|
389
|
-
* @param z Third float in float3.
|
|
390
|
-
*/
|
|
391
|
-
setFloat3(uniformName, x, y, z) {
|
|
392
|
-
if (this._cacheFloat3(uniformName, x, y, z)) {
|
|
393
|
-
if (!this.engine.setFloat3(this._uniforms[uniformName], x, y, z)) {
|
|
394
|
-
this._valueCache[uniformName] = null;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
220
|
+
this.setFloat3(uniformName, vector3.x, vector3.y, vector3.z);
|
|
397
221
|
}
|
|
398
222
|
/**
|
|
399
223
|
* Sets a Vector4 on a uniform variable.
|
|
@@ -401,11 +225,7 @@ export class WebGLPipelineContext {
|
|
|
401
225
|
* @param vector4 Value to be set.
|
|
402
226
|
*/
|
|
403
227
|
setVector4(uniformName, vector4) {
|
|
404
|
-
|
|
405
|
-
if (!this.engine.setFloat4(this._uniforms[uniformName], vector4.x, vector4.y, vector4.z, vector4.w)) {
|
|
406
|
-
this._valueCache[uniformName] = null;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
228
|
+
this.setFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w);
|
|
409
229
|
}
|
|
410
230
|
/**
|
|
411
231
|
* Sets a Quaternion on a uniform variable.
|
|
@@ -413,27 +233,7 @@ export class WebGLPipelineContext {
|
|
|
413
233
|
* @param quaternion Value to be set.
|
|
414
234
|
*/
|
|
415
235
|
setQuaternion(uniformName, quaternion) {
|
|
416
|
-
|
|
417
|
-
if (!this.engine.setFloat4(this._uniforms[uniformName], quaternion.x, quaternion.y, quaternion.z, quaternion.w)) {
|
|
418
|
-
this._valueCache[uniformName] = null;
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Sets a float4 on a uniform variable.
|
|
424
|
-
* @param uniformName Name of the variable.
|
|
425
|
-
* @param x First float in float4.
|
|
426
|
-
* @param y Second float in float4.
|
|
427
|
-
* @param z Third float in float4.
|
|
428
|
-
* @param w Fourth float in float4.
|
|
429
|
-
* @returns this effect.
|
|
430
|
-
*/
|
|
431
|
-
setFloat4(uniformName, x, y, z, w) {
|
|
432
|
-
if (this._cacheFloat4(uniformName, x, y, z, w)) {
|
|
433
|
-
if (!this.engine.setFloat4(this._uniforms[uniformName], x, y, z, w)) {
|
|
434
|
-
this._valueCache[uniformName] = null;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
236
|
+
this.setFloat4(uniformName, quaternion.x, quaternion.y, quaternion.z, quaternion.w);
|
|
437
237
|
}
|
|
438
238
|
/**
|
|
439
239
|
* Sets a Color3 on a uniform variable.
|
|
@@ -441,11 +241,7 @@ export class WebGLPipelineContext {
|
|
|
441
241
|
* @param color3 Value to be set.
|
|
442
242
|
*/
|
|
443
243
|
setColor3(uniformName, color3) {
|
|
444
|
-
|
|
445
|
-
if (!this.engine.setFloat3(this._uniforms[uniformName], color3.r, color3.g, color3.b)) {
|
|
446
|
-
this._valueCache[uniformName] = null;
|
|
447
|
-
}
|
|
448
|
-
}
|
|
244
|
+
this.setFloat3(uniformName, color3.r, color3.g, color3.b);
|
|
449
245
|
}
|
|
450
246
|
/**
|
|
451
247
|
* Sets a Color4 on a uniform variable.
|
|
@@ -454,11 +250,7 @@ export class WebGLPipelineContext {
|
|
|
454
250
|
* @param alpha Alpha value to be set.
|
|
455
251
|
*/
|
|
456
252
|
setColor4(uniformName, color3, alpha) {
|
|
457
|
-
|
|
458
|
-
if (!this.engine.setFloat4(this._uniforms[uniformName], color3.r, color3.g, color3.b, alpha)) {
|
|
459
|
-
this._valueCache[uniformName] = null;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
253
|
+
this.setFloat4(uniformName, color3.r, color3.g, color3.b, alpha);
|
|
462
254
|
}
|
|
463
255
|
/**
|
|
464
256
|
* Sets a Color4 on a uniform variable
|
|
@@ -466,11 +258,7 @@ export class WebGLPipelineContext {
|
|
|
466
258
|
* @param color4 defines the value to be set
|
|
467
259
|
*/
|
|
468
260
|
setDirectColor4(uniformName, color4) {
|
|
469
|
-
|
|
470
|
-
if (!this.engine.setFloat4(this._uniforms[uniformName], color4.r, color4.g, color4.b, color4.a)) {
|
|
471
|
-
this._valueCache[uniformName] = null;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
261
|
+
this.setFloat4(uniformName, color4.r, color4.g, color4.b, color4.a);
|
|
474
262
|
}
|
|
475
263
|
_getVertexShaderCode() {
|
|
476
264
|
return this.vertexShader ? this.engine._getShaderSource(this.vertexShader) : null;
|