@luma.gl/shadertools 8.5.18 → 8.5.20
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/dist/dist.js +25 -25
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/assemble-shaders.js.map +1 -1
- package/dist/es5/lib/constants.js.map +1 -1
- package/dist/es5/lib/filters/prop-types.js.map +1 -1
- package/dist/es5/lib/inject-shader.js.map +1 -1
- package/dist/es5/lib/platform-defines.js.map +1 -1
- package/dist/es5/lib/resolve-modules.js.map +1 -1
- package/dist/es5/lib/shader-module.js.map +1 -1
- package/dist/es5/lib/transpile-shader.js.map +1 -1
- package/dist/es5/modules/dirlight/dirlight.js.map +1 -1
- package/dist/es5/modules/fp32/fp32.js.map +1 -1
- package/dist/es5/modules/fp64/fp64-arithmetic.glsl.js.map +1 -1
- package/dist/es5/modules/fp64/fp64-functions.glsl.js.map +1 -1
- package/dist/es5/modules/fp64/fp64-utils.js.map +1 -1
- package/dist/es5/modules/fp64/fp64.js.map +1 -1
- package/dist/es5/modules/fxaa/fxaa.js.map +1 -1
- package/dist/es5/modules/geometry/geometry.js.map +1 -1
- package/dist/es5/modules/image-adjust-filters/brightnesscontrast.js.map +1 -1
- package/dist/es5/modules/image-adjust-filters/denoise.js.map +1 -1
- package/dist/es5/modules/image-adjust-filters/huesaturation.js.map +1 -1
- package/dist/es5/modules/image-adjust-filters/noise.js.map +1 -1
- package/dist/es5/modules/image-adjust-filters/sepia.js.map +1 -1
- package/dist/es5/modules/image-adjust-filters/vibrance.js.map +1 -1
- package/dist/es5/modules/image-adjust-filters/vignette.js.map +1 -1
- package/dist/es5/modules/image-blur-filters/tiltshift.js.map +1 -1
- package/dist/es5/modules/image-blur-filters/triangleblur.js.map +1 -1
- package/dist/es5/modules/image-blur-filters/zoomblur.js.map +1 -1
- package/dist/es5/modules/image-fun-filters/colorhalftone.js.map +1 -1
- package/dist/es5/modules/image-fun-filters/dotscreen.js.map +1 -1
- package/dist/es5/modules/image-fun-filters/edgework.js.map +1 -1
- package/dist/es5/modules/image-fun-filters/hexagonalpixelate.js.map +1 -1
- package/dist/es5/modules/image-fun-filters/ink.js.map +1 -1
- package/dist/es5/modules/image-fun-filters/magnify.js.map +1 -1
- package/dist/es5/modules/image-warp-filters/bulgepinch.js.map +1 -1
- package/dist/es5/modules/image-warp-filters/swirl.js.map +1 -1
- package/dist/es5/modules/image-warp-filters/warp.js.map +1 -1
- package/dist/es5/modules/index.js.map +1 -1
- package/dist/es5/modules/lights/lights.glsl.js.map +1 -1
- package/dist/es5/modules/lights/lights.js.map +1 -1
- package/dist/es5/modules/module-injectors.js.map +1 -1
- package/dist/es5/modules/pbr/pbr-fragment.glsl.js.map +1 -1
- package/dist/es5/modules/pbr/pbr-vertex.glsl.js.map +1 -1
- package/dist/es5/modules/pbr/pbr.js.map +1 -1
- package/dist/es5/modules/phong-lighting/phong-lighting.glsl.js.map +1 -1
- package/dist/es5/modules/phong-lighting/phong-lighting.js.map +1 -1
- package/dist/es5/modules/picking/picking.js.map +1 -1
- package/dist/es5/modules/project/project.js.map +1 -1
- package/dist/es5/modules/transform/transform.js.map +1 -1
- package/dist/es5/modules/utils/random.js.map +1 -1
- package/dist/es5/utils/assert.js.map +1 -1
- package/dist/es5/utils/index.js.map +1 -1
- package/dist/es5/utils/is-old-ie.js.map +1 -1
- package/dist/es5/utils/shader-utils.js.map +1 -1
- package/dist/es5/utils/webgl-info.js.map +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/assemble-shaders.js.map +1 -1
- package/dist/esm/lib/constants.js.map +1 -1
- package/dist/esm/lib/filters/prop-types.js.map +1 -1
- package/dist/esm/lib/inject-shader.js.map +1 -1
- package/dist/esm/lib/platform-defines.js.map +1 -1
- package/dist/esm/lib/resolve-modules.js.map +1 -1
- package/dist/esm/lib/shader-module.js.map +1 -1
- package/dist/esm/lib/transpile-shader.js.map +1 -1
- package/dist/esm/modules/dirlight/dirlight.js.map +1 -1
- package/dist/esm/modules/fp32/fp32.js.map +1 -1
- package/dist/esm/modules/fp64/fp64-arithmetic.glsl.js.map +1 -1
- package/dist/esm/modules/fp64/fp64-functions.glsl.js.map +1 -1
- package/dist/esm/modules/fp64/fp64-utils.js.map +1 -1
- package/dist/esm/modules/fp64/fp64.js.map +1 -1
- package/dist/esm/modules/fxaa/fxaa.js.map +1 -1
- package/dist/esm/modules/geometry/geometry.js.map +1 -1
- package/dist/esm/modules/image-adjust-filters/brightnesscontrast.js.map +1 -1
- package/dist/esm/modules/image-adjust-filters/denoise.js.map +1 -1
- package/dist/esm/modules/image-adjust-filters/huesaturation.js.map +1 -1
- package/dist/esm/modules/image-adjust-filters/noise.js.map +1 -1
- package/dist/esm/modules/image-adjust-filters/sepia.js.map +1 -1
- package/dist/esm/modules/image-adjust-filters/vibrance.js.map +1 -1
- package/dist/esm/modules/image-adjust-filters/vignette.js.map +1 -1
- package/dist/esm/modules/image-blur-filters/tiltshift.js.map +1 -1
- package/dist/esm/modules/image-blur-filters/triangleblur.js.map +1 -1
- package/dist/esm/modules/image-blur-filters/zoomblur.js.map +1 -1
- package/dist/esm/modules/image-fun-filters/colorhalftone.js.map +1 -1
- package/dist/esm/modules/image-fun-filters/dotscreen.js.map +1 -1
- package/dist/esm/modules/image-fun-filters/edgework.js.map +1 -1
- package/dist/esm/modules/image-fun-filters/hexagonalpixelate.js.map +1 -1
- package/dist/esm/modules/image-fun-filters/ink.js.map +1 -1
- package/dist/esm/modules/image-fun-filters/magnify.js.map +1 -1
- package/dist/esm/modules/image-warp-filters/bulgepinch.js.map +1 -1
- package/dist/esm/modules/image-warp-filters/swirl.js.map +1 -1
- package/dist/esm/modules/image-warp-filters/warp.js.map +1 -1
- package/dist/esm/modules/index.js.map +1 -1
- package/dist/esm/modules/lights/lights.glsl.js.map +1 -1
- package/dist/esm/modules/lights/lights.js.map +1 -1
- package/dist/esm/modules/module-injectors.js.map +1 -1
- package/dist/esm/modules/pbr/pbr-fragment.glsl.js.map +1 -1
- package/dist/esm/modules/pbr/pbr-vertex.glsl.js.map +1 -1
- package/dist/esm/modules/pbr/pbr.js.map +1 -1
- package/dist/esm/modules/phong-lighting/phong-lighting.glsl.js.map +1 -1
- package/dist/esm/modules/phong-lighting/phong-lighting.js.map +1 -1
- package/dist/esm/modules/picking/picking.js.map +1 -1
- package/dist/esm/modules/project/project.js.map +1 -1
- package/dist/esm/modules/transform/transform.js.map +1 -1
- package/dist/esm/modules/utils/random.js.map +1 -1
- package/dist/esm/utils/assert.js.map +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/is-old-ie.js.map +1 -1
- package/dist/esm/utils/shader-utils.js.map +1 -1
- package/dist/esm/utils/webgl-info.js.map +1 -1
- package/package.json +2 -2
- package/src/.DS_Store +0 -0
- package/src/modules/.DS_Store +0 -0
package/dist/dist.js
CHANGED
|
@@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
98
98
|
|
|
99
99
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js":
|
|
100
100
|
/*!**************************************************************************************************!*\
|
|
101
|
-
!*** /Users/
|
|
101
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/base/math-array.js ***!
|
|
102
102
|
\**************************************************************************************************/
|
|
103
103
|
/*! exports provided: default */
|
|
104
104
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -379,7 +379,7 @@ class MathArray extends _extendableBuiltin(Array) {
|
|
|
379
379
|
|
|
380
380
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js":
|
|
381
381
|
/*!**********************************************************************************************!*\
|
|
382
|
-
!*** /Users/
|
|
382
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/base/matrix.js ***!
|
|
383
383
|
\**********************************************************************************************/
|
|
384
384
|
/*! exports provided: default */
|
|
385
385
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -469,7 +469,7 @@ class Matrix extends _math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
469
469
|
|
|
470
470
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js":
|
|
471
471
|
/*!**********************************************************************************************!*\
|
|
472
|
-
!*** /Users/
|
|
472
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/base/vector.js ***!
|
|
473
473
|
\**********************************************************************************************/
|
|
474
474
|
/*! exports provided: default */
|
|
475
475
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -635,7 +635,7 @@ class Vector extends _math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
635
635
|
|
|
636
636
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/euler.js":
|
|
637
637
|
/*!****************************************************************************************!*\
|
|
638
|
-
!*** /Users/
|
|
638
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/euler.js ***!
|
|
639
639
|
\****************************************************************************************/
|
|
640
640
|
/*! exports provided: default */
|
|
641
641
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1196,7 +1196,7 @@ class Euler extends _base_math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
1196
1196
|
|
|
1197
1197
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js":
|
|
1198
1198
|
/*!******************************************************************************************!*\
|
|
1199
|
-
!*** /Users/
|
|
1199
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/matrix3.js ***!
|
|
1200
1200
|
\******************************************************************************************/
|
|
1201
1201
|
/*! exports provided: default */
|
|
1202
1202
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1399,7 +1399,7 @@ class Matrix3 extends _base_matrix__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
1399
1399
|
|
|
1400
1400
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js":
|
|
1401
1401
|
/*!******************************************************************************************!*\
|
|
1402
|
-
!*** /Users/
|
|
1402
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/matrix4.js ***!
|
|
1403
1403
|
\******************************************************************************************/
|
|
1404
1404
|
/*! exports provided: default */
|
|
1405
1405
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -1874,7 +1874,7 @@ class Matrix4 extends _base_matrix__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
|
1874
1874
|
|
|
1875
1875
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/pose.js":
|
|
1876
1876
|
/*!***************************************************************************************!*\
|
|
1877
|
-
!*** /Users/
|
|
1877
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/pose.js ***!
|
|
1878
1878
|
\***************************************************************************************/
|
|
1879
1879
|
/*! exports provided: default */
|
|
1880
1880
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -2010,7 +2010,7 @@ class Pose {
|
|
|
2010
2010
|
|
|
2011
2011
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js":
|
|
2012
2012
|
/*!*********************************************************************************************!*\
|
|
2013
|
-
!*** /Users/
|
|
2013
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/quaternion.js ***!
|
|
2014
2014
|
\*********************************************************************************************/
|
|
2015
2015
|
/*! exports provided: default */
|
|
2016
2016
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -2258,7 +2258,7 @@ class Quaternion extends _base_math_array__WEBPACK_IMPORTED_MODULE_0__["default"
|
|
|
2258
2258
|
|
|
2259
2259
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/spherical-coordinates.js":
|
|
2260
2260
|
/*!********************************************************************************************************!*\
|
|
2261
|
-
!*** /Users/
|
|
2261
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/spherical-coordinates.js ***!
|
|
2262
2262
|
\********************************************************************************************************/
|
|
2263
2263
|
/*! exports provided: default */
|
|
2264
2264
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -2419,7 +2419,7 @@ class SphericalCoordinates {
|
|
|
2419
2419
|
|
|
2420
2420
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector2.js":
|
|
2421
2421
|
/*!******************************************************************************************!*\
|
|
2422
|
-
!*** /Users/
|
|
2422
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/vector2.js ***!
|
|
2423
2423
|
\******************************************************************************************/
|
|
2424
2424
|
/*! exports provided: default */
|
|
2425
2425
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -2531,7 +2531,7 @@ class Vector2 extends _base_vector__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
2531
2531
|
|
|
2532
2532
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector3.js":
|
|
2533
2533
|
/*!******************************************************************************************!*\
|
|
2534
|
-
!*** /Users/
|
|
2534
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/vector3.js ***!
|
|
2535
2535
|
\******************************************************************************************/
|
|
2536
2536
|
/*! exports provided: default */
|
|
2537
2537
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -2689,7 +2689,7 @@ class Vector3 extends _base_vector__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
2689
2689
|
|
|
2690
2690
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector4.js":
|
|
2691
2691
|
/*!******************************************************************************************!*\
|
|
2692
|
-
!*** /Users/
|
|
2692
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/classes/vector4.js ***!
|
|
2693
2693
|
\******************************************************************************************/
|
|
2694
2694
|
/*! exports provided: default */
|
|
2695
2695
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -2824,7 +2824,7 @@ class Vector4 extends _base_vector__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
2824
2824
|
|
|
2825
2825
|
/***/ "../../node_modules/@math.gl/core/dist/esm/index.js":
|
|
2826
2826
|
/*!********************************************************************************!*\
|
|
2827
|
-
!*** /Users/
|
|
2827
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/index.js ***!
|
|
2828
2828
|
\********************************************************************************/
|
|
2829
2829
|
/*! exports provided: Vector2, Vector3, Vector4, Matrix3, Matrix4, Quaternion, config, configure, formatValue, isArray, clone, equals, exactEquals, toRadians, toDegrees, radians, degrees, sin, cos, tan, asin, acos, atan, clamp, lerp, withEpsilon, checkNumber, _MathUtils, SphericalCoordinates, Pose, Euler, assert, _SphericalCoordinates, _Pose, _Euler */
|
|
2830
2830
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -2947,7 +2947,7 @@ global_.mathgl = {
|
|
|
2947
2947
|
|
|
2948
2948
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/assert.js":
|
|
2949
2949
|
/*!*************************************************************************************!*\
|
|
2950
|
-
!*** /Users/
|
|
2950
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/lib/assert.js ***!
|
|
2951
2951
|
\*************************************************************************************/
|
|
2952
2952
|
/*! exports provided: default */
|
|
2953
2953
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -2966,7 +2966,7 @@ function assert(condition, message) {
|
|
|
2966
2966
|
|
|
2967
2967
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/common.js":
|
|
2968
2968
|
/*!*************************************************************************************!*\
|
|
2969
|
-
!*** /Users/
|
|
2969
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/lib/common.js ***!
|
|
2970
2970
|
\*************************************************************************************/
|
|
2971
2971
|
/*! exports provided: config, configure, formatValue, isArray, clone, toRadians, toDegrees, radians, degrees, sin, cos, tan, asin, acos, atan, clamp, lerp, equals, exactEquals, withEpsilon */
|
|
2972
2972
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -3183,7 +3183,7 @@ function withEpsilon(EPSILON, func) {
|
|
|
3183
3183
|
|
|
3184
3184
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js":
|
|
3185
3185
|
/*!***********************************************************************************************!*\
|
|
3186
|
-
!*** /Users/
|
|
3186
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js ***!
|
|
3187
3187
|
\***********************************************************************************************/
|
|
3188
3188
|
/*! exports provided: vec2_transformMat4AsVector, vec3_transformMat4AsVector, vec3_transformMat2, vec4_transformMat2, vec4_transformMat3 */
|
|
3189
3189
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -3246,7 +3246,7 @@ function vec4_transformMat3(out, a, m) {
|
|
|
3246
3246
|
|
|
3247
3247
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/math-utils.js":
|
|
3248
3248
|
/*!*****************************************************************************************!*\
|
|
3249
|
-
!*** /Users/
|
|
3249
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/lib/math-utils.js ***!
|
|
3250
3250
|
\*****************************************************************************************/
|
|
3251
3251
|
/*! exports provided: default */
|
|
3252
3252
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -3285,7 +3285,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3285
3285
|
|
|
3286
3286
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js":
|
|
3287
3287
|
/*!*****************************************************************************************!*\
|
|
3288
|
-
!*** /Users/
|
|
3288
|
+
!*** /Users/missx/Source/luma.gl/node_modules/@math.gl/core/dist/esm/lib/validators.js ***!
|
|
3289
3289
|
\*****************************************************************************************/
|
|
3290
3290
|
/*! exports provided: validateVector, checkNumber, checkVector, deprecated */
|
|
3291
3291
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -3338,7 +3338,7 @@ function deprecated(method, version) {
|
|
|
3338
3338
|
|
|
3339
3339
|
/***/ "../../node_modules/gl-matrix/esm/common.js":
|
|
3340
3340
|
/*!************************************************************************!*\
|
|
3341
|
-
!*** /Users/
|
|
3341
|
+
!*** /Users/missx/Source/luma.gl/node_modules/gl-matrix/esm/common.js ***!
|
|
3342
3342
|
\************************************************************************/
|
|
3343
3343
|
/*! exports provided: EPSILON, ARRAY_TYPE, RANDOM, setMatrixArrayType, toRadian, equals */
|
|
3344
3344
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -3406,7 +3406,7 @@ if (!Math.hypot) Math.hypot = function () {
|
|
|
3406
3406
|
|
|
3407
3407
|
/***/ "../../node_modules/gl-matrix/esm/mat3.js":
|
|
3408
3408
|
/*!**********************************************************************!*\
|
|
3409
|
-
!*** /Users/
|
|
3409
|
+
!*** /Users/missx/Source/luma.gl/node_modules/gl-matrix/esm/mat3.js ***!
|
|
3410
3410
|
\**********************************************************************/
|
|
3411
3411
|
/*! exports provided: create, fromMat4, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, rotate, scale, fromTranslation, fromRotation, fromScaling, fromMat2d, fromQuat, normalFromMat4, projection, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */
|
|
3412
3412
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -4229,7 +4229,7 @@ var sub = subtract;
|
|
|
4229
4229
|
|
|
4230
4230
|
/***/ "../../node_modules/gl-matrix/esm/mat4.js":
|
|
4231
4231
|
/*!**********************************************************************!*\
|
|
4232
|
-
!*** /Users/
|
|
4232
|
+
!*** /Users/missx/Source/luma.gl/node_modules/gl-matrix/esm/mat4.js ***!
|
|
4233
4233
|
\**********************************************************************/
|
|
4234
4234
|
/*! exports provided: create, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, scale, rotate, rotateX, rotateY, rotateZ, fromTranslation, fromScaling, fromRotation, fromXRotation, fromYRotation, fromZRotation, fromRotationTranslation, fromQuat2, getTranslation, getScaling, getRotation, fromRotationTranslationScale, fromRotationTranslationScaleOrigin, fromQuat, frustum, perspective, perspectiveFromFieldOfView, ortho, lookAt, targetTo, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */
|
|
4235
4235
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -6103,7 +6103,7 @@ var sub = subtract;
|
|
|
6103
6103
|
|
|
6104
6104
|
/***/ "../../node_modules/gl-matrix/esm/quat.js":
|
|
6105
6105
|
/*!**********************************************************************!*\
|
|
6106
|
-
!*** /Users/
|
|
6106
|
+
!*** /Users/missx/Source/luma.gl/node_modules/gl-matrix/esm/quat.js ***!
|
|
6107
6107
|
\**********************************************************************/
|
|
6108
6108
|
/*! exports provided: create, identity, setAxisAngle, getAxisAngle, getAngle, multiply, rotateX, rotateY, rotateZ, calculateW, exp, ln, pow, slerp, random, invert, conjugate, fromMat3, fromEuler, str, clone, fromValues, copy, set, add, mul, scale, dot, lerp, length, len, squaredLength, sqrLen, normalize, exactEquals, equals, rotationTo, sqlerp, setAxes */
|
|
6109
6109
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -6868,7 +6868,7 @@ var setAxes = function () {
|
|
|
6868
6868
|
|
|
6869
6869
|
/***/ "../../node_modules/gl-matrix/esm/vec2.js":
|
|
6870
6870
|
/*!**********************************************************************!*\
|
|
6871
|
-
!*** /Users/
|
|
6871
|
+
!*** /Users/missx/Source/luma.gl/node_modules/gl-matrix/esm/vec2.js ***!
|
|
6872
6872
|
\**********************************************************************/
|
|
6873
6873
|
/*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat2, transformMat2d, transformMat3, transformMat4, rotate, angle, zero, str, exactEquals, equals, len, sub, mul, div, dist, sqrDist, sqrLen, forEach */
|
|
6874
6874
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -7550,7 +7550,7 @@ var forEach = function () {
|
|
|
7550
7550
|
|
|
7551
7551
|
/***/ "../../node_modules/gl-matrix/esm/vec3.js":
|
|
7552
7552
|
/*!**********************************************************************!*\
|
|
7553
|
-
!*** /Users/
|
|
7553
|
+
!*** /Users/missx/Source/luma.gl/node_modules/gl-matrix/esm/vec3.js ***!
|
|
7554
7554
|
\**********************************************************************/
|
|
7555
7555
|
/*! exports provided: create, clone, length, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, squaredLength, negate, inverse, normalize, dot, cross, lerp, hermite, bezier, random, transformMat4, transformMat3, transformQuat, rotateX, rotateY, rotateZ, angle, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */
|
|
7556
7556
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -8398,7 +8398,7 @@ var forEach = function () {
|
|
|
8398
8398
|
|
|
8399
8399
|
/***/ "../../node_modules/gl-matrix/esm/vec4.js":
|
|
8400
8400
|
/*!**********************************************************************!*\
|
|
8401
|
-
!*** /Users/
|
|
8401
|
+
!*** /Users/missx/Source/luma.gl/node_modules/gl-matrix/esm/vec4.js ***!
|
|
8402
8402
|
\**********************************************************************/
|
|
8403
8403
|
/*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat4, transformQuat, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */
|
|
8404
8404
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
package/dist/es5/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","luma","module","exports","Object","assign"],"sources":["../../src/bundle.js"],"sourcesContent":["const moduleExports = require('./index');\n\n// @ts-ignore\nglobalThis.luma = globalThis.luma || {};\n// @ts-ignore\nmodule.exports = Object.assign(globalThis.luma, moduleExports);\n"],"mappings":";;AAAA,IAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AAGAC,UAAU,CAACC,IAAX,GAAkBD,UAAU,CAACC,IAAX,IAAmB,EAArC;AAEAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcL,UAAU,CAACC,IAAzB,EAA+BH,aAA/B,CAAjB"}
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.js"],"sourcesContent":["// shadertools exports\n\n// DOCUMENTED APIS\nexport {assembleShaders} from './lib/assemble-shaders';\n\n// HELPERS\nexport {combineInjects} from './lib/inject-shader';\nexport {normalizeShaderModule} from './lib/shader-module';\n\n// UTILS\nexport {\n getQualifierDetails,\n getPassthroughFS,\n typeToChannelSuffix,\n typeToChannelCount,\n convertToVec4\n} from './utils/shader-utils';\n\n// SHADER MODULES\nexport * from './modules';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAGA;;AACA;;AAGA;;AASA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/assemble-shaders.js"],"names":["INJECT_SHADER_DECLARATIONS","DECLARATION_INJECT_MARKER","SHADER_TYPE","VERTEX_SHADER","FRAGMENT_SHADER","FRAGMENT_SHADER_PROLOGUE","assembleShaders","gl","opts","vs","fs","modules","assembleShader","Object","assign","source","type","getUniforms","assembleGetUniforms","id","defines","hookFunctions","inject","transpileToGLSL100","prologue","log","isVertex","sourceLines","split","glslVersion","versionLine","coreSource","indexOf","slice","join","allDefines","forEach","module","getDefines","assembledSource","getShaderName","getShaderType","getApplicationDefines","hookFunctionMap","normalizeHookFunctions","hookInjections","declInjections","mainInjections","key","injection","order","match","hash","name","checkDeprecations","moduleSource","getModuleSource","injections","injectionType","push","getHookFunctions","uniforms","moduleUniforms","toUpperCase","injectShaderName","count","sourceText","define","value","Number","isFinite","result","hookName","hookFunction","signature","header","sort","a","b","footer","hook","trim","stage","replace"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,0BAA0B,iBAAUC,uCAAV,SAAhC;AAEA,IAAMC,WAAW,mEACdC,wBADc,EACE,QADF,+CAEdC,0BAFc,EAEI,UAFJ,gBAAjB;AAOA,IAAMC,wBAAwB,+BAA9B;;AAMO,SAASC,eAAT,CAAyBC,EAAzB,EAA6BC,IAA7B,EAAmC;AACxC,MAAOC,EAAP,GAAiBD,IAAjB,CAAOC,EAAP;AAAA,MAAWC,EAAX,GAAiBF,IAAjB,CAAWE,EAAX;AACA,MAAMC,OAAO,GAAG,oCAAeH,IAAI,CAACG,OAAL,IAAgB,EAA/B,CAAhB;AACA,SAAO;AACLJ,IAAAA,EAAE,EAAFA,EADK;AAELE,IAAAA,EAAE,EAAEG,cAAc,CAACL,EAAD,EAAKM,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBN,IAAlB,EAAwB;AAACO,MAAAA,MAAM,EAAEN,EAAT;AAAaO,MAAAA,IAAI,EAAEb,wBAAnB;AAAkCQ,MAAAA,OAAO,EAAPA;AAAlC,KAAxB,CAAL,CAFb;AAGLD,IAAAA,EAAE,E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;AACD;;AACDwE,IAAAA,IAAI,GAAGA,IAAI,CAACC,IAAL,EAAP;;AACA,sBAA2BD,IAAI,CAACpD,KAAL,CAAW,GAAX,CAA3B;AAAA;AAAA,QAAOsD,KAAP;AAAA,QAAcR,SAAd;;AACA,QAAMrB,IAAI,GAAG2B,IAAI,CAACG,OAAL,CAAa,MAAb,EAAqB,EAArB,CAAb;AACAZ,IAAAA,MAAM,CAACW,KAAD,CAAN,CAAc7B,IAAd,IAAsBxC,MAAM,CAACC,MAAP,CAAcN,IAAd,EAAoB;AAACkE,MAAAA,SAAS,EAATA;AAAD,KAApB,CAAtB;AACD,GAZD;AAcA,SAAOH,MAAP;AACD","sourcesContent":["import {VERTEX_SHADER, FRAGMENT_SHADER} from './constants';\nimport {resolveModules} from './resolve-modules';\nimport {getPlatformShaderDefines, getVersionDefines} from './platform-defines';\nimport injectShader, {DECLARATION_INJECT_MARKER} from './inject-shader';\nimport transpileShader from './transpile-shader';\nimport {assert} from '../utils';\n\nconst INJECT_SHADER_DECLARATIONS = `\\n\\n${DECLARATION_INJECT_MARKER}\\n\\n`;\n\nconst SHADER_TYPE = {\n [VERTEX_SHADER]: 'vertex',\n [FRAGMENT_SHADER]: 'fragment'\n};\n\n// Precision prologue to inject before functions are injected in shader\n// TODO - extract any existing prologue in the fragment source and move it up...\nconst FRAGMENT_SHADER_PROLOGUE = `\\\nprecision highp float;\n\n`;\n\n// Inject a list of modules\nexport function assembleShaders(gl, opts) {\n const {vs, fs} = opts;\n const modules = resolveModules(opts.modules || []);\n return {\n gl,\n vs: assembleShader(gl, Object.assign({}, opts, {source: vs, type: VERTEX_SHADER, modules})),\n fs: assembleShader(gl, Object.assign({}, opts, {source: fs, type: FRAGMENT_SHADER, modules})),\n getUniforms: assembleGetUniforms(modules)\n };\n}\n\n// Pulls together complete source code for either a vertex or a fragment shader\n// adding prologues, requested module chunks, and any final injections.\nfunction assembleShader(\n gl,\n {\n id,\n source,\n type,\n modules,\n defines = {},\n hookFunctions = [],\n inject = {},\n transpileToGLSL100 = false,\n prologue = true,\n log\n }\n) {\n assert(typeof source === 'string', 'shader source must be a string');\n\n const isVertex = type === VERTEX_SHADER;\n\n const sourceLines = source.split('\\n');\n let glslVersion = 100;\n let versionLine = '';\n let coreSource = source;\n // Extract any version directive string from source.\n // TODO : keep all pre-processor statements at the begining of the shader.\n if (sourceLines[0].indexOf('#version ') === 0) {\n glslVersion = 300; // TODO - regexp that matches actual version number\n versionLine = sourceLines[0];\n coreSource = sourceLines.slice(1).join('\\n');\n } else {\n versionLine = `#version ${glslVersion}`;\n }\n\n // Combine Module and Application Defines\n const allDefines = {};\n modules.forEach(module => {\n Object.assign(allDefines, module.getDefines());\n });\n Object.assign(allDefines, defines);\n\n // Add platform defines (use these to work around platform-specific bugs and limitations)\n // Add common defines (GLSL version compatibility, feature detection)\n // Add precision declaration for fragment shaders\n let assembledSource = prologue\n ? `\\\n${versionLine}\n${getShaderName({id, source, type})}\n${getShaderType({type})}\n${getPlatformShaderDefines(gl)}\n${getVersionDefines(gl, glslVersion, !isVertex)}\n${getApplicationDefines(allDefines)}\n${isVertex ? '' : FRAGMENT_SHADER_PROLOGUE}\n`\n : `${versionLine}\n`;\n\n const hookFunctionMap = normalizeHookFunctions(hookFunctions);\n\n // Add source of dependent modules in resolved order\n const hookInjections = {};\n const declInjections = {};\n const mainInjections = {};\n\n for (const key in inject) {\n const injection =\n typeof inject[key] === 'string' ? {injection: inject[key], order: 0} : inject[key];\n const match = key.match(/^(v|f)s:(#)?([\\w-]+)$/);\n if (match) {\n const hash = match[2];\n const name = match[3];\n if (hash) {\n if (name === 'decl') {\n declInjections[key] = [injection];\n } else {\n mainInjections[key] = [injection];\n }\n } else {\n hookInjections[key] = [injection];\n }\n } else {\n // Regex injection\n mainInjections[key] = [injection];\n }\n }\n\n for (const module of modules) {\n if (log) {\n module.checkDeprecations(coreSource, log);\n }\n const moduleSource = module.getModuleSource(type, glslVersion);\n // Add the module source, and a #define that declares it presence\n assembledSource += moduleSource;\n\n const injections = module.injections[type];\n for (const key in injections) {\n const match = key.match(/^(v|f)s:#([\\w-]+)$/);\n if (match) {\n const name = match[2];\n const injectionType = name === 'decl' ? declInjections : mainInjections;\n injectionType[key] = injectionType[key] || [];\n injectionType[key].push(injections[key]);\n } else {\n hookInjections[key] = hookInjections[key] || [];\n hookInjections[key].push(injections[key]);\n }\n }\n }\n\n // For injectShader\n assembledSource += INJECT_SHADER_DECLARATIONS;\n\n assembledSource = injectShader(assembledSource, type, declInjections);\n\n assembledSource += getHookFunctions(hookFunctionMap[type], hookInjections);\n\n // Add the version directive and actual source of this shader\n assembledSource += coreSource;\n\n // Apply any requested shader injections\n assembledSource = injectShader(assembledSource, type, mainInjections);\n\n assembledSource = transpileShader(\n assembledSource,\n transpileToGLSL100 ? 100 : glslVersion,\n isVertex\n );\n\n return assembledSource;\n}\n\n// Returns a combined `getUniforms` covering the options for all the modules,\n// the created function will pass on options to the inidividual `getUniforms`\n// function of each shader module and combine the results into one object that\n// can be passed to setUniforms.\nfunction assembleGetUniforms(modules) {\n return function getUniforms(opts) {\n const uniforms = {};\n for (const module of modules) {\n // `modules` is already sorted by dependency level. This guarantees that\n // modules have access to the uniforms that are generated by their dependencies.\n const moduleUniforms = module.getUniforms(opts, uniforms);\n Object.assign(uniforms, moduleUniforms);\n }\n return uniforms;\n };\n}\n\nfunction getShaderType({type}) {\n return `\n#define SHADER_TYPE_${SHADER_TYPE[type].toUpperCase()}\n`;\n}\n\n// Generate \"glslify-compatible\" SHADER_NAME defines\n// These are understood by the GLSL error parsing function\n// If id is provided and no SHADER_NAME constant is present in source, create one\nfunction getShaderName({id, source, type}) {\n const injectShaderName = id && typeof id === 'string' && source.indexOf('SHADER_NAME') === -1;\n return injectShaderName\n ? `\n#define SHADER_NAME ${id}_${SHADER_TYPE[type]}\n\n`\n : '';\n}\n\n// Generates application defines from an object\nfunction getApplicationDefines(defines = {}) {\n let count = 0;\n let sourceText = '';\n for (const define in defines) {\n if (count === 0) {\n sourceText += '\\n// APPLICATION DEFINES\\n';\n }\n count++;\n\n const value = defines[define];\n if (value || Number.isFinite(value)) {\n sourceText += `#define ${define.toUpperCase()} ${defines[define]}\\n`;\n }\n }\n if (count === 0) {\n sourceText += '\\n';\n }\n return sourceText;\n}\n\nfunction getHookFunctions(hookFunctions, hookInjections) {\n let result = '';\n for (const hookName in hookFunctions) {\n const hookFunction = hookFunctions[hookName];\n result += `void ${hookFunction.signature} {\\n`;\n if (hookFunction.header) {\n result += ` ${hookFunction.header}`;\n }\n if (hookInjections[hookName]) {\n const injections = hookInjections[hookName];\n injections.sort((a, b) => a.order - b.order);\n for (const injection of injections) {\n result += ` ${injection.injection}\\n`;\n }\n }\n if (hookFunction.footer) {\n result += ` ${hookFunction.footer}`;\n }\n result += '}\\n';\n }\n\n return result;\n}\n\nfunction normalizeHookFunctions(hookFunctions) {\n const result = {\n vs: {},\n fs: {}\n };\n\n hookFunctions.forEach(hook => {\n let opts;\n if (typeof hook !== 'string') {\n opts = hook;\n hook = opts.hook;\n } else {\n opts = {};\n }\n hook = hook.trim();\n const [stage, signature] = hook.split(':');\n const name = hook.replace(/\\(.+/, '');\n result[stage][name] = Object.assign(opts, {signature});\n });\n\n return result;\n}\n"],"file":"assemble-shaders.js"}
|
|
1
|
+
{"version":3,"file":"assemble-shaders.js","names":["INJECT_SHADER_DECLARATIONS","DECLARATION_INJECT_MARKER","SHADER_TYPE","VERTEX_SHADER","FRAGMENT_SHADER","FRAGMENT_SHADER_PROLOGUE","assembleShaders","gl","opts","vs","fs","modules","resolveModules","assembleShader","Object","assign","source","type","getUniforms","assembleGetUniforms","id","defines","hookFunctions","inject","transpileToGLSL100","prologue","log","assert","isVertex","sourceLines","split","glslVersion","versionLine","coreSource","indexOf","slice","join","allDefines","forEach","module","getDefines","assembledSource","getShaderName","getShaderType","getPlatformShaderDefines","getVersionDefines","getApplicationDefines","hookFunctionMap","normalizeHookFunctions","hookInjections","declInjections","mainInjections","key","injection","order","match","hash","name","checkDeprecations","moduleSource","getModuleSource","injections","injectionType","push","injectShader","getHookFunctions","transpileShader","uniforms","moduleUniforms","toUpperCase","injectShaderName","count","sourceText","define","value","Number","isFinite","result","hookName","hookFunction","signature","header","sort","a","b","footer","hook","trim","stage","replace"],"sources":["../../../src/lib/assemble-shaders.js"],"sourcesContent":["import {VERTEX_SHADER, FRAGMENT_SHADER} from './constants';\nimport {resolveModules} from './resolve-modules';\nimport {getPlatformShaderDefines, getVersionDefines} from './platform-defines';\nimport injectShader, {DECLARATION_INJECT_MARKER} from './inject-shader';\nimport transpileShader from './transpile-shader';\nimport {assert} from '../utils';\n\nconst INJECT_SHADER_DECLARATIONS = `\\n\\n${DECLARATION_INJECT_MARKER}\\n\\n`;\n\nconst SHADER_TYPE = {\n [VERTEX_SHADER]: 'vertex',\n [FRAGMENT_SHADER]: 'fragment'\n};\n\n// Precision prologue to inject before functions are injected in shader\n// TODO - extract any existing prologue in the fragment source and move it up...\nconst FRAGMENT_SHADER_PROLOGUE = `\\\nprecision highp float;\n\n`;\n\n// Inject a list of modules\nexport function assembleShaders(gl, opts) {\n const {vs, fs} = opts;\n const modules = resolveModules(opts.modules || []);\n return {\n gl,\n vs: assembleShader(gl, Object.assign({}, opts, {source: vs, type: VERTEX_SHADER, modules})),\n fs: assembleShader(gl, Object.assign({}, opts, {source: fs, type: FRAGMENT_SHADER, modules})),\n getUniforms: assembleGetUniforms(modules)\n };\n}\n\n// Pulls together complete source code for either a vertex or a fragment shader\n// adding prologues, requested module chunks, and any final injections.\nfunction assembleShader(\n gl,\n {\n id,\n source,\n type,\n modules,\n defines = {},\n hookFunctions = [],\n inject = {},\n transpileToGLSL100 = false,\n prologue = true,\n log\n }\n) {\n assert(typeof source === 'string', 'shader source must be a string');\n\n const isVertex = type === VERTEX_SHADER;\n\n const sourceLines = source.split('\\n');\n let glslVersion = 100;\n let versionLine = '';\n let coreSource = source;\n // Extract any version directive string from source.\n // TODO : keep all pre-processor statements at the begining of the shader.\n if (sourceLines[0].indexOf('#version ') === 0) {\n glslVersion = 300; // TODO - regexp that matches actual version number\n versionLine = sourceLines[0];\n coreSource = sourceLines.slice(1).join('\\n');\n } else {\n versionLine = `#version ${glslVersion}`;\n }\n\n // Combine Module and Application Defines\n const allDefines = {};\n modules.forEach(module => {\n Object.assign(allDefines, module.getDefines());\n });\n Object.assign(allDefines, defines);\n\n // Add platform defines (use these to work around platform-specific bugs and limitations)\n // Add common defines (GLSL version compatibility, feature detection)\n // Add precision declaration for fragment shaders\n let assembledSource = prologue\n ? `\\\n${versionLine}\n${getShaderName({id, source, type})}\n${getShaderType({type})}\n${getPlatformShaderDefines(gl)}\n${getVersionDefines(gl, glslVersion, !isVertex)}\n${getApplicationDefines(allDefines)}\n${isVertex ? '' : FRAGMENT_SHADER_PROLOGUE}\n`\n : `${versionLine}\n`;\n\n const hookFunctionMap = normalizeHookFunctions(hookFunctions);\n\n // Add source of dependent modules in resolved order\n const hookInjections = {};\n const declInjections = {};\n const mainInjections = {};\n\n for (const key in inject) {\n const injection =\n typeof inject[key] === 'string' ? {injection: inject[key], order: 0} : inject[key];\n const match = key.match(/^(v|f)s:(#)?([\\w-]+)$/);\n if (match) {\n const hash = match[2];\n const name = match[3];\n if (hash) {\n if (name === 'decl') {\n declInjections[key] = [injection];\n } else {\n mainInjections[key] = [injection];\n }\n } else {\n hookInjections[key] = [injection];\n }\n } else {\n // Regex injection\n mainInjections[key] = [injection];\n }\n }\n\n for (const module of modules) {\n if (log) {\n module.checkDeprecations(coreSource, log);\n }\n const moduleSource = module.getModuleSource(type, glslVersion);\n // Add the module source, and a #define that declares it presence\n assembledSource += moduleSource;\n\n const injections = module.injections[type];\n for (const key in injections) {\n const match = key.match(/^(v|f)s:#([\\w-]+)$/);\n if (match) {\n const name = match[2];\n const injectionType = name === 'decl' ? declInjections : mainInjections;\n injectionType[key] = injectionType[key] || [];\n injectionType[key].push(injections[key]);\n } else {\n hookInjections[key] = hookInjections[key] || [];\n hookInjections[key].push(injections[key]);\n }\n }\n }\n\n // For injectShader\n assembledSource += INJECT_SHADER_DECLARATIONS;\n\n assembledSource = injectShader(assembledSource, type, declInjections);\n\n assembledSource += getHookFunctions(hookFunctionMap[type], hookInjections);\n\n // Add the version directive and actual source of this shader\n assembledSource += coreSource;\n\n // Apply any requested shader injections\n assembledSource = injectShader(assembledSource, type, mainInjections);\n\n assembledSource = transpileShader(\n assembledSource,\n transpileToGLSL100 ? 100 : glslVersion,\n isVertex\n );\n\n return assembledSource;\n}\n\n// Returns a combined `getUniforms` covering the options for all the modules,\n// the created function will pass on options to the inidividual `getUniforms`\n// function of each shader module and combine the results into one object that\n// can be passed to setUniforms.\nfunction assembleGetUniforms(modules) {\n return function getUniforms(opts) {\n const uniforms = {};\n for (const module of modules) {\n // `modules` is already sorted by dependency level. This guarantees that\n // modules have access to the uniforms that are generated by their dependencies.\n const moduleUniforms = module.getUniforms(opts, uniforms);\n Object.assign(uniforms, moduleUniforms);\n }\n return uniforms;\n };\n}\n\nfunction getShaderType({type}) {\n return `\n#define SHADER_TYPE_${SHADER_TYPE[type].toUpperCase()}\n`;\n}\n\n// Generate \"glslify-compatible\" SHADER_NAME defines\n// These are understood by the GLSL error parsing function\n// If id is provided and no SHADER_NAME constant is present in source, create one\nfunction getShaderName({id, source, type}) {\n const injectShaderName = id && typeof id === 'string' && source.indexOf('SHADER_NAME') === -1;\n return injectShaderName\n ? `\n#define SHADER_NAME ${id}_${SHADER_TYPE[type]}\n\n`\n : '';\n}\n\n// Generates application defines from an object\nfunction getApplicationDefines(defines = {}) {\n let count = 0;\n let sourceText = '';\n for (const define in defines) {\n if (count === 0) {\n sourceText += '\\n// APPLICATION DEFINES\\n';\n }\n count++;\n\n const value = defines[define];\n if (value || Number.isFinite(value)) {\n sourceText += `#define ${define.toUpperCase()} ${defines[define]}\\n`;\n }\n }\n if (count === 0) {\n sourceText += '\\n';\n }\n return sourceText;\n}\n\nfunction getHookFunctions(hookFunctions, hookInjections) {\n let result = '';\n for (const hookName in hookFunctions) {\n const hookFunction = hookFunctions[hookName];\n result += `void ${hookFunction.signature} {\\n`;\n if (hookFunction.header) {\n result += ` ${hookFunction.header}`;\n }\n if (hookInjections[hookName]) {\n const injections = hookInjections[hookName];\n injections.sort((a, b) => a.order - b.order);\n for (const injection of injections) {\n result += ` ${injection.injection}\\n`;\n }\n }\n if (hookFunction.footer) {\n result += ` ${hookFunction.footer}`;\n }\n result += '}\\n';\n }\n\n return result;\n}\n\nfunction normalizeHookFunctions(hookFunctions) {\n const result = {\n vs: {},\n fs: {}\n };\n\n hookFunctions.forEach(hook => {\n let opts;\n if (typeof hook !== 'string') {\n opts = hook;\n hook = opts.hook;\n } else {\n opts = {};\n }\n hook = hook.trim();\n const [stage, signature] = hook.split(':');\n const name = hook.replace(/\\(.+/, '');\n result[stage][name] = Object.assign(opts, {signature});\n });\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,0BAA0B,iBAAUC,uCAAV,SAAhC;AAEA,IAAMC,WAAW,mEACdC,wBADc,EACE,QADF,+CAEdC,0BAFc,EAEI,UAFJ,gBAAjB;AAOA,IAAMC,wBAAwB,+BAA9B;;AAMO,SAASC,eAAT,CAAyBC,EAAzB,EAA6BC,IAA7B,EAAmC;EACxC,IAAOC,EAAP,GAAiBD,IAAjB,CAAOC,EAAP;EAAA,IAAWC,EAAX,GAAiBF,IAAjB,CAAWE,EAAX;EACA,IAAMC,OAAO,GAAG,IAAAC,8BAAA,EAAeJ,IAAI,CAACG,OAAL,IAAgB,EAA/B,CAAhB;EACA,OAAO;IACLJ,EAAE,EAAFA,EADK;IAELE,EAAE,EAAEI,cAAc,CAACN,EAAD,EAAKO,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBP,IAAlB,EAAwB;MAACQ,MAAM,EAAEP,EAAT;MAAaQ,IAAI,EAAEd,wBAAnB;MAAkCQ,OAAO,EAAPA;IAAlC,CAAxB,CAAL,C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W,KAAD,CAAN,CAAc/B,IAAd,IAAsB3C,MAAM,CAACC,MAAP,CAAcP,IAAd,EAAoB;MAACwE,SAAS,EAATA;IAAD,CAApB,CAAtB;EACD,CAZD;EAcA,OAAOH,MAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"constants.js","names":["VERTEX_SHADER","FRAGMENT_SHADER"],"sources":["../../../src/lib/constants.js"],"sourcesContent":["export const VERTEX_SHADER = 'vs';\nexport const FRAGMENT_SHADER = 'fs';\n"],"mappings":";;;;;;AAAO,IAAMA,aAAa,GAAG,IAAtB;;AACA,IAAMC,eAAe,GAAG,IAAxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["TYPE_DEFINITIONS","number","validate","value","propType","Number","isFinite","max","min","array","Array","isArray","ArrayBuffer","isView","parsePropTypes","propDefs","propTypes","propName","propDef","parsePropType","type","getTypeOf","Object","assign"],"sources":["../../../../src/lib/filters/prop-types.js"],"sourcesContent":["const TYPE_DEFINITIONS = {\n number: {\n validate(value, propType) {\n return (\n Number.isFinite(value) &&\n (!('max' in propType) || value <= propType.max) &&\n (!('min' in propType) || value >= propType.min)\n );\n }\n },\n array: {\n validate(value, propType) {\n return Array.isArray(value) || ArrayBuffer.isView(value);\n }\n }\n};\n\nexport function parsePropTypes(propDefs) {\n const propTypes = {};\n for (const propName in propDefs) {\n const propDef = propDefs[propName];\n const propType = parsePropType(propDef);\n propTypes[propName] = propType;\n }\n return propTypes;\n}\n\n// Parses one property definition entry. Either contains:\n// * a valid prop type object ({type, ...})\n// * or just a default value, in which case type and name inference is used\nfunction parsePropType(propDef) {\n let type = getTypeOf(propDef);\n if (type === 'object') {\n if (!propDef) {\n return {type: 'object', value: null};\n }\n if ('type' in propDef) {\n return Object.assign({}, propDef, TYPE_DEFINITIONS[propDef.type]);\n }\n if (!('value' in propDef)) {\n // If no type and value this object is likely the value\n return {type: 'object', value: propDef};\n }\n type = getTypeOf(propDef.value);\n return Object.assign({type}, propDef, TYPE_DEFINITIONS[type]);\n }\n return Object.assign({type, value: propDef}, TYPE_DEFINITIONS[type]);\n}\n\n// improved version of javascript typeof that can distinguish arrays and null values\nfunction getTypeOf(value) {\n if (Array.isArray(value) || ArrayBuffer.isView(value)) {\n return 'array';\n }\n return typeof value;\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAMA,gBAAgB,GAAG;EACvBC,MAAM,EAAE;IACNC,QADM,oBACGC,KADH,EACUC,QADV,EACoB;MACxB,OACEC,MAAM,CAACC,QAAP,CAAgBH,KAAhB,MACC,EAAE,SAASC,QAAX,KAAwBD,KAAK,IAAIC,QAAQ,CAACG,GAD3C,MAEC,EAAE,SAASH,QAAX,KAAwBD,KAAK,IAAIC,QAAQ,CAACI,GAF3C,CADF;IAKD;EAPK,CADe;EAUvBC,KAAK,EAAE;IACLP,QADK,oBACIC,KADJ,EACWC,QADX,EACqB;MACxB,OAAOM,KAAK,CAACC,OAAN,CAAcR,KAAd,KAAwBS,WAAW,CAACC,MAAZ,CAAmBV,KAAnB,CAA/B;IACD;EAHI;AAVgB,CAAzB;;AAiBO,SAASW,cAAT,CAAwBC,QAAxB,EAAkC;EACvC,IAAMC,SAAS,GAAG,EAAlB;;EACA,KAAK,IAAMC,QAAX,IAAuBF,QAAvB,EAAiC;IAC/B,IAAMG,OAAO,GAAGH,QAAQ,CAACE,QAAD,CAAxB;IACA,IAAMb,QAAQ,GAAGe,aAAa,CAACD,OAAD,CAA9B;IACAF,SAAS,CAACC,QAAD,CAAT,GAAsBb,QAAtB;EACD;;EACD,OAAOY,SAAP;AACD;;AAKD,SAASG,aAAT,CAAuBD,OAAvB,EAAgC;EAC9B,IAAIE,IAAI,GAAGC,SAAS,CAACH,OAAD,CAApB;;EACA,IAAIE,IAAI,KAAK,QAAb,EAAuB;IACrB,IAAI,CAACF,OAAL,EAAc;MACZ,OAAO;QAACE,IAAI,EAAE,QAAP;QAAiBjB,KAAK,EAAE;MAAxB,CAAP;IACD;;IACD,IAAI,UAAUe,OAAd,EAAuB;MACrB,OAAOI,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBL,OAAlB,EAA2BlB,gBAAgB,CAACkB,OAAO,CAACE,IAAT,CAA3C,CAAP;IACD;;IACD,IAAI,EAAE,WAAWF,OAAb,CAAJ,EAA2B;MAEzB,OAAO;QAACE,IAAI,EAAE,QAAP;QAAiBjB,KAAK,EAAEe;MAAxB,CAAP;IACD;;IACDE,IAAI,GAAGC,SAAS,CAACH,OAAO,CAACf,KAAT,CAAhB;IACA,OAAOmB,MAAM,CAACC,MAAP,CAAc;MAACH,IAAI,EAAJA;IAAD,CAAd,EAAsBF,OAAtB,EAA+BlB,gBAAgB,CAACoB,IAAD,CAA/C,CAAP;EACD;;EACD,OAAOE,MAAM,CAACC,MAAP,CAAc;IAACH,IAAI,EAAJA,IAAD;IAAOjB,KAAK,EAAEe;EAAd,CAAd,EAAsClB,gBAAgB,CAACoB,IAAD,CAAtD,CAAP;AACD;;AAGD,SAASC,SAAT,CAAmBlB,KAAnB,EAA0B;EACxB,IAAIO,KAAK,CAACC,OAAN,CAAcR,KAAd,KAAwBS,WAAW,CAACC,MAAZ,CAAmBV,KAAnB,CAA5B,EAAuD;IACrD,OAAO,OAAP;EACD;;EACD,6BAAcA,KAAd;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"inject-shader.js","names":["MODULE_INJECTORS","VERTEX_SHADER","MODULE_INJECTORS_VS","FRAGMENT_SHADER","MODULE_INJECTORS_FS","DECLARATION_INJECT_MARKER","REGEX_START_OF_MAIN","REGEX_END_OF_MAIN","fragments","injectShader","source","type","inject","injectStandardStubs","isVertex","key","fragmentData","sort","a","b","order","length","i","len","injection","fragmentString","join","replace","match","combineInjects","injects","result","assert","Array","isArray","forEach"],"sources":["../../../src/lib/inject-shader.js"],"sourcesContent":["import {MODULE_INJECTORS_VS, MODULE_INJECTORS_FS} from '../modules/module-injectors';\nimport {VERTEX_SHADER, FRAGMENT_SHADER} from './constants';\nimport {assert} from '../utils';\n\n// TODO - experimental\nconst MODULE_INJECTORS = {\n [VERTEX_SHADER]: MODULE_INJECTORS_VS,\n [FRAGMENT_SHADER]: MODULE_INJECTORS_FS\n};\n\nexport const DECLARATION_INJECT_MARKER = '__LUMA_INJECT_DECLARATIONS__'; // Uniform/attribute declarations\n\nconst REGEX_START_OF_MAIN = /void\\s+main\\s*\\([^)]*\\)\\s*\\{\\n?/; // Beginning of main\nconst REGEX_END_OF_MAIN = /}\\n?[^{}]*$/; // End of main, assumes main is last function\nconst fragments = [];\n\n// A minimal shader injection/templating system.\n// RFC: https://github.com/visgl/luma.gl/blob/7.0-release/dev-docs/RFCs/v6.0/shader-injection-rfc.md\n/* eslint-disable complexity */\nexport default function injectShader(source, type, inject, injectStandardStubs = false) {\n const isVertex = type === VERTEX_SHADER;\n\n for (const key in inject) {\n const fragmentData = inject[key];\n fragmentData.sort((a, b) => a.order - b.order);\n fragments.length = fragmentData.length;\n for (let i = 0, len = fragmentData.length; i < len; ++i) {\n fragments[i] = fragmentData[i].injection;\n }\n const fragmentString = `${fragments.join('\\n')}\\n`;\n switch (key) {\n // declarations are injected before the main function\n case 'vs:#decl':\n if (isVertex) {\n source = source.replace(DECLARATION_INJECT_MARKER, fragmentString);\n }\n break;\n // inject code at the beginning of the main function\n case 'vs:#main-start':\n if (isVertex) {\n source = source.replace(REGEX_START_OF_MAIN, match => match + fragmentString);\n }\n break;\n // inject code at the end of main function\n case 'vs:#main-end':\n if (isVertex) {\n source = source.replace(REGEX_END_OF_MAIN, match => fragmentString + match);\n }\n break;\n // declarations are injected before the main function\n case 'fs:#decl':\n if (!isVertex) {\n source = source.replace(DECLARATION_INJECT_MARKER, fragmentString);\n }\n break;\n // inject code at the beginning of the main function\n case 'fs:#main-start':\n if (!isVertex) {\n source = source.replace(REGEX_START_OF_MAIN, match => match + fragmentString);\n }\n break;\n // inject code at the end of main function\n case 'fs:#main-end':\n if (!isVertex) {\n source = source.replace(REGEX_END_OF_MAIN, match => fragmentString + match);\n }\n break;\n\n default:\n // TODO(Tarek): I think this usage should be deprecated.\n\n // inject code after key, leaving key in place\n source = source.replace(key, match => match + fragmentString);\n }\n }\n\n // Remove if it hasn't already been replaced\n source = source.replace(DECLARATION_INJECT_MARKER, '');\n\n // Finally, if requested, insert an automatic module injector chunk\n if (injectStandardStubs) {\n source = source.replace(/\\}\\s*$/, match => match + MODULE_INJECTORS[type]);\n }\n\n return source;\n}\n\n/* eslint-enable complexity */\n\n// Takes an array of inject objects and combines them into one\nexport function combineInjects(injects) {\n const result = {};\n assert(Array.isArray(injects) && injects.length > 1);\n injects.forEach(inject => {\n for (const key in inject) {\n result[key] = result[key] ? `${result[key]}\\n${inject[key]}` : inject[key];\n }\n });\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;AAGA,IAAMA,gBAAgB,6EACnBC,wBADmB,EACHC,oCADG,oDAEnBC,0BAFmB,EAEDC,oCAFC,qBAAtB;AAKO,IAAMC,yBAAyB,GAAG,8BAAlC;;AAEP,IAAMC,mBAAmB,GAAG,iCAA5B;AACA,IAAMC,iBAAiB,GAAG,aAA1B;AACA,IAAMC,SAAS,GAAG,EAAlB;;AAKe,SAASC,YAAT,CAAsBC,MAAtB,EAA8BC,IAA9B,EAAoCC,MAApC,EAAyE;EAAA,IAA7BC,mBAA6B,uEAAP,KAAO;EACtF,IAAMC,QAAQ,GAAGH,IAAI,KAAKV,wBAA1B;;EADsF,2BAG3Ec,GAH2E;IAIpF,IAAMC,YAAY,GAAGJ,MAAM,CAACG,GAAD,CAA3B;IACAC,YAAY,CAACC,IAAb,CAAkB,UAACC,CAAD,EAAIC,CAAJ;MAAA,OAAUD,CAAC,CAACE,KAAF,GAAUD,CAAC,CAACC,KAAtB;IAAA,CAAlB;IACAZ,SAAS,CAACa,MAAV,GAAmBL,YA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AP,CAAepB,iBAAf,EAAkC,UAAAqB,KAAK;YAAA,OAAIH,cAAc,GAAGG,KAArB;UAAA,CAAvC,CAAT;QACD;;QACD;;MAEF;QAIElB,MAAM,GAAGA,MAAM,CAACiB,OAAP,CAAeZ,GAAf,EAAoB,UAAAa,KAAK;UAAA,OAAIA,KAAK,GAAGH,cAAZ;QAAA,CAAzB,CAAT;IA1CJ;EAXoF;;EAGtF,KAAK,IAAMV,GAAX,IAAkBH,MAAlB,EAA0B;IAAA,MAAfG,GAAe;EAoDzB;;EAGDL,MAAM,GAAGA,MAAM,CAACiB,OAAP,CAAetB,yBAAf,EAA0C,EAA1C,CAAT;;EAGA,IAAIQ,mBAAJ,EAAyB;IACvBH,MAAM,GAAGA,MAAM,CAACiB,OAAP,CAAe,QAAf,EAAyB,UAAAC,KAAK;MAAA,OAAIA,KAAK,GAAG5B,gBAAgB,CAACW,IAAD,CAA5B;IAAA,CAA9B,CAAT;EACD;;EAED,OAAOD,MAAP;AACD;;AAKM,SAASmB,cAAT,CAAwBC,OAAxB,EAAiC;EACtC,IAAMC,MAAM,GAAG,EAAf;EACA,IAAAC,aAAA,EAAOC,KAAK,CAACC,OAAN,CAAcJ,OAAd,KAA0BA,OAAO,CAACT,MAAR,GAAiB,CAAlD;EACAS,OAAO,CAACK,OAAR,CAAgB,UAAAvB,MAAM,EAAI;IACxB,KAAK,IAAMG,GAAX,IAAkBH,MAAlB,EAA0B;MACxBmB,MAAM,CAAChB,GAAD,CAAN,GAAcgB,MAAM,CAAChB,GAAD,CAAN,aAAiBgB,MAAM,CAAChB,GAAD,CAAvB,eAAiCH,MAAM,CAACG,GAAD,CAAvC,IAAiDH,MAAM,CAACG,GAAD,CAArE;IACD;EACF,CAJD;EAKA,OAAOgB,MAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"platform-defines.js","names":["getPlatformShaderDefines","gl","debugInfo","getContextInfo","gpuVendor","toLowerCase","getVersionDefines","glslVersion","isFragment","versionDefines","hasFeatures","FEATURES","GLSL_FRAG_DEPTH","GLSL_DERIVATIVES","canCompileGLGSExtension","GLSL_FRAG_DATA","behavior","GLSL_TEXTURE_LOD"],"sources":["../../../src/lib/platform-defines.js"],"sourcesContent":["import {getContextInfo, hasFeatures, canCompileGLGSExtension, FEATURES} from '../utils/webgl-info';\n\nexport function getPlatformShaderDefines(gl) {\n const debugInfo = getContextInfo(gl);\n\n switch (debugInfo.gpuVendor.toLowerCase()) {\n case 'nvidia':\n return `\\\n#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n`;\n\n case 'intel':\n return `\\\n#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n`;\n\n case 'amd':\n // AMD Does not eliminate fp64 code\n return `\\\n#define AMD_GPU\n`;\n\n default:\n // We don't know what GPU it is, could be that the GPU driver or\n // browser is not implementing UNMASKED_RENDERER constant and not\n // reporting a correct name\n return `\\\n#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n`;\n }\n}\n\nexport function getVersionDefines(gl, glslVersion, isFragment) {\n // Add shadertools defines to let shaders portably v1/v3 check for features\n let versionDefines = `\\\n#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n`;\n\n if (hasFeatures(gl, FEATURES.GLSL_FRAG_DEPTH)) {\n versionDefines += `\\\n\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n`;\n }\n if (\n hasFeatures(gl, FEATURES.GLSL_DERIVATIVES) &&\n canCompileGLGSExtension(gl, FEATURES.GLSL_DERIVATIVES)\n ) {\n versionDefines += `\\\n\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n`;\n }\n if (\n hasFeatures(gl, FEATURES.GLSL_FRAG_DATA) &&\n canCompileGLGSExtension(gl, FEATURES.GLSL_FRAG_DATA, {behavior: 'require'})\n ) {\n versionDefines += `\\\n\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n`;\n }\n if (hasFeatures(gl, FEATURES.GLSL_TEXTURE_LOD)) {\n versionDefines += `\\\n// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n`;\n }\n return versionDefines;\n}\n"],"mappings":";;;;;;;;AAAA;;AAEO,SAASA,wBAAT,CAAkCC,EAAlC,EAAsC;EAC3C,IAAMC,SAAS,GAAG,IAAAC,yBAAA,EAAeF,EAAf,CAAlB;;EAEA,QAAQC,SAAS,CAACE,SAAV,CAAoBC,WAApB,EAAR;IACE,KAAK,QAAL;MACE;;IAMF,KAAK,OAAL;MACE;;IAUF,KAAK,KAAL;MAEE;;IAIF;MAIE;EA7BJ;AAuCD;;AAEM,SAASC,iBAAT,CAA2BL,EAA3B,EAA+BM,WAA/B,EAA4CC,UAA5C,EAAwD;EAE7D,IAAIC,cAAc,gUAAlB;;EAiBA,IAAI,IAAAC,sBAAA,EAAYT,EAAZ,EAAgBU,mBAAA,CAASC,eAAzB,CAAJ,EAA+C;IAC7CH,cAAc,2NAAd;EAUD;;EACD,IACE,IAAAC,sBAAA,EAAYT,EAAZ,EAAgBU,mBAAA,CAASE,gBAAzB,KACA,IAAAC,kCAAA,EAAwBb,EAAxB,EAA4BU,mBAAA,CAASE,gBAArC,CAFF,EAGE;IACAJ,cAAc,qNAAd;EASD;;EACD,IACE,IAAAC,sBAAA,EAAYT,EAAZ,EAAgBU,mBAAA,CAASI,cAAzB,KACA,IAAAD,kCAAA,EAAwBb,EAAxB,EAA4BU,mBAAA,CAASI,cAArC,EAAqD;IAACC,QAAQ,EAAE;EAAX,CAArD,CAFF,EAGE;IACAP,cAAc,8LAAd;EASD;;EACD,IAAI,IAAAC,sBAAA,EAAYT,EAAZ,EAAgBU,mBAAA,CAASM,gBAAzB,CAAJ,EAAgD;IAC9CR,cAAc,8MAAd;EAUD;;EACD,OAAOA,cAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolve-modules.js","names":["resolveModules","modules","getShaderDependencies","instantiateModules","moduleMap","moduleDepth","getDependencyGraph","level","Object","keys","sort","a","b","map","name","Error","module","undefined","dependencies","seen","ShaderModule","assert","TEST_EXPORTS"],"sources":["../../../src/lib/resolve-modules.js"],"sourcesContent":["import ShaderModule from './shader-module';\nimport {assert} from '../utils';\n\n// Instantiate shader modules and any dependencies resolve dependencies\nexport function resolveModules(modules) {\n return getShaderDependencies(instantiateModules(modules));\n}\n\n/**\n * Takes a list of shader module names and returns a new list of\n * shader module names that includes all dependencies, sorted so\n * that modules that are dependencies of other modules come first.\n *\n * If the shader glsl code from the returned modules is concatenated\n * in the reverse order, it is guaranteed that all functions be resolved and\n * that all function and variable definitions come before use.\n *\n * @param {String[]} modules - Array of modules (inline modules or module names)\n * @return {String[]} - Array of modules\n */\nfunction getShaderDependencies(modules) {\n const moduleMap = {};\n const moduleDepth = {};\n getDependencyGraph({modules, level: 0, moduleMap, moduleDepth});\n\n // Return a reverse sort so that dependencies come before the modules that use them\n return Object.keys(moduleDepth)\n .sort((a, b) => moduleDepth[b] - moduleDepth[a])\n .map(name => moduleMap[name]);\n}\n\n/**\n * Recursively checks module dpendencies to calculate dependency\n * level of each module.\n *\n * @param {object} options\n * @param {object[]} options.modules - Array of modules\n * @param {number} options.level - Current level\n * @param {object} options.moduleMap -\n * @param {object} options.moduleDepth - Current level\n * @return {object} - Map of module name to its level\n */\n// Adds another level of dependencies to the result map\nfunction getDependencyGraph({modules, level, moduleMap, moduleDepth}) {\n if (level >= 5) {\n throw new Error('Possible loop in shader dependency graph');\n }\n\n // Update level on all current modules\n for (const module of modules) {\n moduleMap[module.name] = module;\n if (moduleDepth[module.name] === undefined || moduleDepth[module.name] < level) {\n moduleDepth[module.name] = level;\n }\n }\n\n // Recurse\n for (const module of modules) {\n if (module.dependencies) {\n getDependencyGraph({modules: module.dependencies, level: level + 1, moduleMap, moduleDepth});\n }\n }\n}\n\nfunction instantiateModules(modules, seen) {\n return modules.map(module => {\n if (module instanceof ShaderModule) {\n return module;\n }\n\n assert(\n typeof module !== 'string',\n `Shader module use by name is deprecated. Import shader module '${module}' and use it directly.`\n );\n assert(module.name, 'shader module has no name');\n\n module = new ShaderModule(module);\n module.dependencies = instantiateModules(module.dependencies);\n\n return module;\n });\n}\n\nexport const TEST_EXPORT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AC9EF,WAAW,CAACW,MAAM,CAACF,IAAR,CAAX,GAA2BP,KAA3B;MACD;IACF;EAXmE;IAAA;EAAA;IAAA;EAAA;;EAAA,4CAc/CN,OAd+C;EAAA;;EAAA;IAcpE,uDAA8B;MAAA,IAAnBe,OAAmB;;MAC5B,IAAIA,OAAM,CAACE,YAAX,EAAyB;QACvBZ,kBAAkB,CAAC;UAACL,OAAO,EAAEe,OAAM,CAACE,YAAjB;UAA+BX,KAAK,EAAEA,KAAK,GAAG,CAA9C;UAAiDH,SAAS,EAATA,SAAjD;UAA4DC,WAAW,EAAXA;QAA5D,CAAD,CAAlB;MACD;IACF;EAlBmE;IAAA;EAAA;IAAA;EAAA;AAmBrE;;AAED,SAASF,kBAAT,CAA4BF,OAA5B,EAAqCkB,IAArC,EAA2C;EACzC,OAAOlB,OAAO,CAACY,GAAR,CAAY,UAAAG,MAAM,EAAI;IAC3B,IAAIA,MAAM,YAAYI,qBAAtB,EAAoC;MAClC,OAAOJ,MAAP;IACD;;IAED,IAAAK,aAAA,EACE,OAAOL,MAAP,KAAkB,QADpB,2EAEoEA,MAFpE;IAIA,IAAAK,aAAA,EAAOL,MAAM,CAACF,IAAd,EAAoB,2BAApB;IAEAE,MAAM,GAAG,IAAII,qBAAJ,CAAiBJ,MAAjB,CAAT;IACAA,MAAM,CAACE,YAAP,GAAsBf,kBAAkB,CAACa,MAAM,CAACE,YAAR,CAAxC;IAEA,OAAOF,MAAP;EACD,CAfM,CAAP;AAgBD;;AAEM,IAAMM,YAAY,GAAG;EAC1BpB,qBAAqB,EAArBA,qBAD0B;EAE1BI,kBAAkB,EAAlBA;AAF0B,CAArB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"shader-module.js","names":["VERTEX_SHADER","FRAGMENT_SHADER","ShaderModule","name","vs","fs","dependencies","uniforms","getUniforms","deprecations","defines","inject","vertexShader","fragmentShader","assert","getModuleUniforms","_parseDeprecationDefinitions","injections","normalizeInjections","parsePropTypes","type","moduleSource","toUpperCase","replace","opts","_defaultGetUniforms","shaderSource","log","forEach","def","regex","test","deprecated","old","new","removed","RegExp","propTypes","key","propDef","private","validate","value","normalizeShaderModule","module","normalized","shaderModule","bind","result","hook","injection","stage","slice","order"],"sources":["../../../src/lib/shader-module.js"],"sourcesContent":["import {assert} from '../utils';\nimport {parsePropTypes} from './filters/prop-types';\n\nconst VERTEX_SHADER = 'vs';\nconst FRAGMENT_SHADER = 'fs';\n\nexport default class ShaderModule {\n constructor({\n name,\n vs,\n fs,\n dependencies = [],\n uniforms,\n getUniforms,\n deprecations = [],\n defines = {},\n inject = {},\n // DEPRECATED\n vertexShader,\n fragmentShader\n }) {\n assert(typeof name === 'string');\n this.name = name;\n this.vs = vs || vertexShader;\n this.fs = fs || fragmentShader;\n this.getModuleUniforms = getUniforms;\n this.dependencies = dependencies;\n this.deprecations = this._parseDeprecationDefinitions(deprecations);\n this.defines = defines;\n this.injections = normalizeInjections(inject);\n\n if (uniforms) {\n this.uniforms = parsePropTypes(uniforms);\n }\n }\n\n // Extracts the source code chunk for the specified shader type from the named shader module\n getModuleSource(type) {\n let moduleSource;\n switch (type) {\n case VERTEX_SHADER:\n moduleSource = this.vs || '';\n break;\n case FRAGMENT_SHADER:\n moduleSource = this.fs || '';\n break;\n default:\n assert(false);\n }\n\n return `\\\n#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi, '_')}\n${moduleSource}\\\n// END MODULE_${this.name}\n\n`;\n }\n\n getUniforms(opts, uniforms) {\n if (this.getModuleUniforms) {\n return this.getModuleUniforms(opts, uniforms);\n }\n // Build uniforms from the uniforms array\n if (this.uniforms) {\n return this._defaultGetUniforms(opts);\n }\n return {};\n }\n\n getDefines() {\n return this.defines;\n }\n\n // Warn about deprecated uniforms or functions\n checkDeprecations(shaderSource, log) {\n this.deprecations.forEach(def => {\n if (def.regex.test(shaderSource)) {\n if (def.deprecated) {\n log.deprecated(def.old, def.new)();\n } else {\n log.removed(def.old, def.new)();\n }\n }\n });\n }\n\n _parseDeprecationDefinitions(deprecations) {\n deprecations.forEach(def => {\n switch (def.type) {\n case 'function':\n def.regex = new RegExp(`\\\\b${def.old}\\\\(`);\n break;\n default:\n def.regex = new RegExp(`${def.type} ${def.old};`);\n }\n });\n\n return deprecations;\n }\n\n _defaultGetUniforms(opts = {}) {\n const uniforms = {};\n const propTypes = this.uniforms;\n\n for (const key in propTypes) {\n const propDef = propTypes[key];\n if (key in opts && !propDef.private) {\n if (propDef.validate) {\n assert(propDef.validate(opts[key], propDef), `${this.name}: invalid ${key}`);\n }\n uniforms[key] = opts[key];\n } else {\n uniforms[key] = propDef.value;\n }\n }\n\n return uniforms;\n }\n}\n\n// This utility mutates the original module\n// Keeping for backward compatibility\n// TODO - remove in v8\nexport function normalizeShaderModule(module) {\n if (!module.normalized) {\n module.normalized = true;\n if (module.uniforms && !module.getUniforms) {\n const shaderModule = new ShaderModule(module);\n module.getUniforms = shaderModule.getUniforms.bind(shaderModule);\n }\n }\n return module;\n}\n\nfunction normalizeInjections(injections) {\n const result = {\n vs: {},\n fs: {}\n };\n\n for (const hook in injections) {\n let injection = injections[hook];\n const stage = hook.slice(0, 2);\n\n if (typeof injection === 'string') {\n injection = {\n order: 0,\n injection\n };\n }\n\n result[stage][hook] = injection;\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,aAAa,GAAG,IAAtB;AACA,IAAMC,eAAe,GAAG,IAAxB;;IAEqBC,Y;EACnB,4BAaG;IAAA,IAZDC,IAYC,QAZDA,IAYC;IAAA,IAXDC,EAWC,QAXDA,EAWC;IAAA,IAVDC,EAUC,QAVDA,EAUC;IAAA,6BATDC,YASC;IAAA,IATDA,YASC,kCATc,EASd;IAAA,IARDC,QAQC,QARDA,QAQC;IAAA,IAPDC,WAOC,QAPDA,WAOC;IAAA,6BANDC,YAMC;IAAA,IANDA,YAMC,kCANc,EAMd;IAAA,wBALDC,OAKC;IA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BC,SAAtB;EACD;;EAED,OAAOF,MAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"transpile-shader.js","names":["testVariable","qualifier","RegExp","ES300_REPLACEMENTS","ES300_VERTEX_REPLACEMENTS","ES300_FRAGMENT_REPLACEMENTS","ES100_REPLACEMENTS","ES100_VERTEX_REPLACEMENTS","ES100_FRAGMENT_REPLACEMENTS","ES100_FRAGMENT_OUTPUT_NAME","ES300_FRAGMENT_OUTPUT_REGEX","REGEX_START_OF_MAIN","transpileShader","source","targetGLSLVersion","isVertex","convertShader","convertFragmentShaderTo300","convertFragmentShaderTo100","Error","replacements","pattern","replacement","replace","outputMatch","match","outputName"],"sources":["../../../src/lib/transpile-shader.js"],"sourcesContent":["// TRANSPILATION TABLES\n\nfunction testVariable(qualifier) {\n /*\n should match:\n in float weight;\n out vec4 positions[2];\n should not match:\n void f(out float a, in float b) {}\n */\n return new RegExp(`\\\\b${qualifier}[ \\\\t]+(\\\\w+[ \\\\t]+\\\\w+(\\\\[\\\\w+\\\\])?;)`, 'g');\n}\n\n/** Simple regex replacements for GLSL ES 1.00 syntax that has changed in GLSL ES 3.00 */\nconst ES300_REPLACEMENTS = [\n // Fix poorly formatted version directive\n [/^(#version[ \\t]+(100|300[ \\t]+es))?[ \\t]*\\n/, '#version 300 es\\n'],\n // The individual `texture...()` functions were replaced with `texture()` overloads\n [/\\btexture(2D|2DProj|Cube)Lod(EXT)?\\(/g, 'textureLod('],\n [/\\btexture(2D|2DProj|Cube)(EXT)?\\(/g, 'texture(']\n];\n\nconst ES300_VERTEX_REPLACEMENTS = [\n ...ES300_REPLACEMENTS,\n // `attribute` keyword replaced with `in`\n [testVariable('attribute'), 'in $1'],\n // `varying` keyword replaced with `out`\n [testVariable('varying'), 'out $1']\n];\n\n/** Simple regex replacements for GLSL ES 1.00 syntax that has changed in GLSL ES 3.00 */\nconst ES300_FRAGMENT_REPLACEMENTS = [\n ...ES300_REPLACEMENTS,\n // `varying` keyword replaced with `in`\n [testVariable('varying'), 'in $1']\n];\n\nconst ES100_REPLACEMENTS = [\n [/^#version[ \\t]+300[ \\t]+es/, '#version 100'],\n\n // In GLSL 1.00 ES these functions are provided by an extension\n [/\\btexture(2D|2DProj|Cube)Lod\\(/g, 'texture$1LodEXT('],\n\n // Overloads in GLSL 3.00 map to individual functions. Note that we cannot\n // differentiate 2D,2DProj,Cube without type analysis so we choose the most common variant.\n [/\\btexture\\(/g, 'texture2D('],\n [/\\btextureLod\\(/g, 'texture2DLodEXT(']\n];\n\nconst ES100_VERTEX_REPLACEMENTS = [\n ...ES100_REPLACEMENTS,\n [testVariable('in'), 'attribute $1'],\n [testVariable('out'), 'varying $1']\n];\n\nconst ES100_FRAGMENT_REPLACEMENTS = [\n ...ES100_REPLACEMENTS,\n // Replace `in` with `varying`\n [testVariable('in'), 'varying $1']\n];\n\nconst ES100_FRAGMENT_OUTPUT_NAME = 'gl_FragColor';\nconst ES300_FRAGMENT_OUTPUT_REGEX = /\\bout[ \\t]+vec4[ \\t]+(\\w+)[ \\t]*;\\n?/;\n\nconst REGEX_START_OF_MAIN = /void\\s+main\\s*\\([^)]*\\)\\s*\\{\\n?/; // Beginning of main\n\n// Transpiles shader source code to target GLSL version\n// Note: We always run transpiler even if same version e.g. 3.00 => 3.00\n// RFC: https://github.com/visgl/luma.gl/blob/7.0-release/dev-docs/RFCs/v6.0/portable-glsl-300-rfc.md\nexport default function transpileShader(source, targetGLSLVersion, isVertex) {\n switch (targetGLSLVersion) {\n case 300:\n return isVertex\n ? convertShader(source, ES300_VERTEX_REPLACEMENTS)\n : convertFragmentShaderTo300(source);\n case 100:\n return isVertex\n ? convertShader(source, ES100_VERTEX_REPLACEMENTS)\n : convertFragmentShaderTo100(source);\n default:\n throw new Error(`unknown GLSL version ${targetGLSLVersion}`);\n }\n}\n\nfunction convertShader(source, replacements) {\n for (const [pattern, replacement] of replacements) {\n source = source.replace(pattern, replacement);\n }\n return source;\n}\n\nfunction convertFragmentShaderTo300(source) {\n source = convertShader(source, ES300_FRAGMENT_REPLACEMENTS);\n\n const outputMatch = source.match(ES300_FRAGMENT_OUTPUT_REGEX);\n if (outputMatch) {\n const outputName = outputMatch[1];\n source = source.replace(new RegExp(`\\\\b${ES100_FRAGMENT_OUTPUT_NAME}\\\\b`, 'g'), outputName);\n } else {\n const outputName = 'fragmentColor';\n source = source\n .replace(REGEX_START_OF_MAIN, match => `out vec4 ${outputName};\\n${match}`)\n .replace(new RegExp(`\\\\b${ES100_FRAGMENT_OUTPUT_NAME}\\\\b`, 'g'), outputName);\n }\n\n return source;\n}\n\nfunction convertFragmentShaderTo100(source) {\n source = convertShader(source, ES100_FRAGMENT_REPLACEMENTS);\n\n const outputMatch = source.match(ES300_FRAGMENT_OUTPUT_REGEX);\n if (outputMatch) {\n const outputName = outputMatch[1];\n source = source\n .replace(ES300_FRAGMENT_OUTPUT_REGEX, '')\n .replace(new RegExp(`\\\\b${outputName}\\\\b`, 'g'), ES100_FRAGMENT_OUTPUT_NAME);\n }\n\n return source;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA,SAASA,YAAT,CAAsBC,SAAtB,EAAiC;EAQ/B,OAAO,IAAIC,MAAJ,cAAiBD,SAAjB,6CAAoE,GAApE,CAAP;AACD;;AAGD,IAAME,kBAAkB,GAAG,CAEzB,CAAC,6CAAD,EAAgD,mBAAhD,CAFyB,EAIzB,CAAC,uCAAD,EAA0C,aAA1C,CAJyB,EAKzB,CAAC,oCAAD,EAAuC,UAAvC,CALyB,CAA3B;AAQA,IAAMC,yBAAyB,aAC1BD,kBAD0B,GAG7B,CAACH,YAAY,CAAC,WAAD,CAAb,EAA4B,OAA5B,CAH6B,EAK7B,CAACA,YAAY,CAAC,SAAD,CAAb,EAA0B,QAA1B,CAL6B,EAA/B;AASA,IAAMK,2BAA2B,aAC5BF,kBAD4B,GAG/B,CAACH,YAAY,CAAC,SAAD,CAAb,EAA0B,OAA1B,CAH+B,EAAj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T_MODULE_OPTIONS","lightDirection","getUniforms","opts","uniforms","dirlight_uLightDirection","vs","fs","dirlight","name","dependencies","project"],"sources":["../../../../src/modules/dirlight/dirlight.js"],"sourcesContent":["/** @typedef {import('../../types').ShaderModule} ShaderModule */\n\n// Cheap lighting - single directional light, single dot product, one uniform\n\nimport {project} from '../project/project';\n\n/* eslint-disable camelcase */\nconst DEFAULT_LIGHT_DIRECTION = new Float32Array([1, 1, 2]);\n\nconst DEFAULT_MODULE_OPTIONS = {\n lightDirection: DEFAULT_LIGHT_DIRECTION\n};\n\nfunction getUniforms(opts = DEFAULT_MODULE_OPTIONS) {\n const uniforms = {};\n if (opts.lightDirection) {\n uniforms.dirlight_uLightDirection = opts.lightDirection;\n }\n return uniforms;\n}\n\n// TODO - reuse normal from geometry module\nconst vs = null;\n\nconst fs = `\\\nuniform vec3 dirlight_uLightDirection;\n\n/*\n * Returns color attenuated by angle from light source\n */\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n`;\n\nexport const dirlight = {\n name: 'dirlight',\n vs,\n fs,\n getUniforms,\n dependencies: [project]\n};\n"],"mappings":";;;;;;;AAIA;;AAGA,IAAMA,uBAAuB,GAAG,IAAIC,YAAJ,CAAiB,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAAjB,CAAhC;AAEA,IAAMC,sBAAsB,GAAG;EAC7BC,cAAc,EAAEH;AADa,CAA/B;;AAIA,SAASI,WAAT,GAAoD;EAAA,IAA/BC,IAA+B,uEAAxBH,sBAAwB;EAClD,IAAMI,QAAQ,GAAG,EAAjB;;EACA,IAAID,IAAI,CAACF,cAAT,EAAyB;IACvBG,QAAQ,CAACC,wBAAT,GAAoCF,IAAI,CAACF,cAAzC;EACD;;EACD,OAAOG,QAAP;AACD;;AAGD,IAAME,EAAE,GAAG,IAAX;AAEA,IAAMC,EAAE,4PAAR;AAaO,IAAMC,QAAQ,GAAG;EACtBC,IAAI,EAAE,UADgB;EAEtBH,EAAE,EAAFA,EAFsB;EAGtBC,EAAE,EAAFA,EAHsB;EAItBL,WAAW,EAAXA,WAJsB;EAKtBQ,YAAY,EAAE,CAACC,gBAAD;AALQ,CAAjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"fp32.js","names":["fp32shader","fp32","name","vs","fs"],"sources":["../../../../src/modules/fp32/fp32.js"],"sourcesContent":["/** @typedef {import('../../types').ShaderModule} ShaderModule */\n\nconst fp32shader = `\\\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n\n// All these functions are for substituting tan() function from Intel GPU only\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01; // 1/3!\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03; // 1/5!\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04; // 1/7!\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06; // 1/9!\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n // 2pi range reduction\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n`;\n\nexport const fp32 = {\n name: 'fp32',\n vs: fp32shader,\n fs: null\n};\n"],"mappings":";;;;;;AAEA,IAAMA,UAAU,qrGAAhB;AAyJO,IAAMC,IAAI,GAAG;EAClBC,IAAI,EAAE,MADY;EAElBC,EAAE,EAAEH,UAFc;EAGlBI,EAAE,EAAE;AAHc,CAAb"}
|