@luma.gl/shadertools 8.5.16 → 8.5.17
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 +75 -75
- 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/lib/.platform-defines.js.swp +0 -0
- package/src/utils/.webgl-info.js.swp +0 -0
- package/src/.DS_Store +0 -0
package/dist/dist.js
CHANGED
|
@@ -97,9 +97,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
97
97
|
/******/ ({
|
|
98
98
|
|
|
99
99
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js":
|
|
100
|
-
|
|
101
|
-
!*** /Users/
|
|
102
|
-
|
|
100
|
+
/*!*****************************************************************************************************!*\
|
|
101
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/base/math-array.js ***!
|
|
102
|
+
\*****************************************************************************************************/
|
|
103
103
|
/*! exports provided: default */
|
|
104
104
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
105
105
|
|
|
@@ -378,9 +378,9 @@ class MathArray extends _extendableBuiltin(Array) {
|
|
|
378
378
|
/***/ }),
|
|
379
379
|
|
|
380
380
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js":
|
|
381
|
-
|
|
382
|
-
!*** /Users/
|
|
383
|
-
|
|
381
|
+
/*!*************************************************************************************************!*\
|
|
382
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/base/matrix.js ***!
|
|
383
|
+
\*************************************************************************************************/
|
|
384
384
|
/*! exports provided: default */
|
|
385
385
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
386
386
|
|
|
@@ -468,9 +468,9 @@ class Matrix extends _math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
468
468
|
/***/ }),
|
|
469
469
|
|
|
470
470
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js":
|
|
471
|
-
|
|
472
|
-
!*** /Users/
|
|
473
|
-
|
|
471
|
+
/*!*************************************************************************************************!*\
|
|
472
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/base/vector.js ***!
|
|
473
|
+
\*************************************************************************************************/
|
|
474
474
|
/*! exports provided: default */
|
|
475
475
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
476
476
|
|
|
@@ -634,9 +634,9 @@ class Vector extends _math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
634
634
|
/***/ }),
|
|
635
635
|
|
|
636
636
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/euler.js":
|
|
637
|
-
|
|
638
|
-
!*** /Users/
|
|
639
|
-
|
|
637
|
+
/*!*******************************************************************************************!*\
|
|
638
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/euler.js ***!
|
|
639
|
+
\*******************************************************************************************/
|
|
640
640
|
/*! exports provided: default */
|
|
641
641
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
642
642
|
|
|
@@ -1195,9 +1195,9 @@ class Euler extends _base_math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
1195
1195
|
/***/ }),
|
|
1196
1196
|
|
|
1197
1197
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js":
|
|
1198
|
-
|
|
1199
|
-
!*** /Users/
|
|
1200
|
-
|
|
1198
|
+
/*!*********************************************************************************************!*\
|
|
1199
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/matrix3.js ***!
|
|
1200
|
+
\*********************************************************************************************/
|
|
1201
1201
|
/*! exports provided: default */
|
|
1202
1202
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1203
1203
|
|
|
@@ -1398,9 +1398,9 @@ class Matrix3 extends _base_matrix__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
1398
1398
|
/***/ }),
|
|
1399
1399
|
|
|
1400
1400
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js":
|
|
1401
|
-
|
|
1402
|
-
!*** /Users/
|
|
1403
|
-
|
|
1401
|
+
/*!*********************************************************************************************!*\
|
|
1402
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/matrix4.js ***!
|
|
1403
|
+
\*********************************************************************************************/
|
|
1404
1404
|
/*! exports provided: default */
|
|
1405
1405
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1406
1406
|
|
|
@@ -1873,9 +1873,9 @@ class Matrix4 extends _base_matrix__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
|
1873
1873
|
/***/ }),
|
|
1874
1874
|
|
|
1875
1875
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/pose.js":
|
|
1876
|
-
|
|
1877
|
-
!*** /Users/
|
|
1878
|
-
|
|
1876
|
+
/*!******************************************************************************************!*\
|
|
1877
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/pose.js ***!
|
|
1878
|
+
\******************************************************************************************/
|
|
1879
1879
|
/*! exports provided: default */
|
|
1880
1880
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1881
1881
|
|
|
@@ -2009,9 +2009,9 @@ class Pose {
|
|
|
2009
2009
|
/***/ }),
|
|
2010
2010
|
|
|
2011
2011
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js":
|
|
2012
|
-
|
|
2013
|
-
!*** /Users/
|
|
2014
|
-
|
|
2012
|
+
/*!************************************************************************************************!*\
|
|
2013
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/quaternion.js ***!
|
|
2014
|
+
\************************************************************************************************/
|
|
2015
2015
|
/*! exports provided: default */
|
|
2016
2016
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2017
2017
|
|
|
@@ -2257,9 +2257,9 @@ class Quaternion extends _base_math_array__WEBPACK_IMPORTED_MODULE_0__["default"
|
|
|
2257
2257
|
/***/ }),
|
|
2258
2258
|
|
|
2259
2259
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/spherical-coordinates.js":
|
|
2260
|
-
|
|
2261
|
-
!*** /Users/
|
|
2262
|
-
|
|
2260
|
+
/*!***********************************************************************************************************!*\
|
|
2261
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/spherical-coordinates.js ***!
|
|
2262
|
+
\***********************************************************************************************************/
|
|
2263
2263
|
/*! exports provided: default */
|
|
2264
2264
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2265
2265
|
|
|
@@ -2418,9 +2418,9 @@ class SphericalCoordinates {
|
|
|
2418
2418
|
/***/ }),
|
|
2419
2419
|
|
|
2420
2420
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector2.js":
|
|
2421
|
-
|
|
2422
|
-
!*** /Users/
|
|
2423
|
-
|
|
2421
|
+
/*!*********************************************************************************************!*\
|
|
2422
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/vector2.js ***!
|
|
2423
|
+
\*********************************************************************************************/
|
|
2424
2424
|
/*! exports provided: default */
|
|
2425
2425
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2426
2426
|
|
|
@@ -2530,9 +2530,9 @@ class Vector2 extends _base_vector__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
2530
2530
|
/***/ }),
|
|
2531
2531
|
|
|
2532
2532
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector3.js":
|
|
2533
|
-
|
|
2534
|
-
!*** /Users/
|
|
2535
|
-
|
|
2533
|
+
/*!*********************************************************************************************!*\
|
|
2534
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/vector3.js ***!
|
|
2535
|
+
\*********************************************************************************************/
|
|
2536
2536
|
/*! exports provided: default */
|
|
2537
2537
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2538
2538
|
|
|
@@ -2688,9 +2688,9 @@ class Vector3 extends _base_vector__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
2688
2688
|
/***/ }),
|
|
2689
2689
|
|
|
2690
2690
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector4.js":
|
|
2691
|
-
|
|
2692
|
-
!*** /Users/
|
|
2693
|
-
|
|
2691
|
+
/*!*********************************************************************************************!*\
|
|
2692
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/classes/vector4.js ***!
|
|
2693
|
+
\*********************************************************************************************/
|
|
2694
2694
|
/*! exports provided: default */
|
|
2695
2695
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2696
2696
|
|
|
@@ -2823,9 +2823,9 @@ class Vector4 extends _base_vector__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
2823
2823
|
/***/ }),
|
|
2824
2824
|
|
|
2825
2825
|
/***/ "../../node_modules/@math.gl/core/dist/esm/index.js":
|
|
2826
|
-
|
|
2827
|
-
!*** /Users/
|
|
2828
|
-
|
|
2826
|
+
/*!***********************************************************************************!*\
|
|
2827
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/index.js ***!
|
|
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__) {
|
|
2831
2831
|
|
|
@@ -2946,9 +2946,9 @@ global_.mathgl = {
|
|
|
2946
2946
|
/***/ }),
|
|
2947
2947
|
|
|
2948
2948
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/assert.js":
|
|
2949
|
-
|
|
2950
|
-
!*** /Users/
|
|
2951
|
-
|
|
2949
|
+
/*!****************************************************************************************!*\
|
|
2950
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/lib/assert.js ***!
|
|
2951
|
+
\****************************************************************************************/
|
|
2952
2952
|
/*! exports provided: default */
|
|
2953
2953
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2954
2954
|
|
|
@@ -2965,9 +2965,9 @@ function assert(condition, message) {
|
|
|
2965
2965
|
/***/ }),
|
|
2966
2966
|
|
|
2967
2967
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/common.js":
|
|
2968
|
-
|
|
2969
|
-
!*** /Users/
|
|
2970
|
-
|
|
2968
|
+
/*!****************************************************************************************!*\
|
|
2969
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/lib/common.js ***!
|
|
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__) {
|
|
2973
2973
|
|
|
@@ -3182,9 +3182,9 @@ function withEpsilon(EPSILON, func) {
|
|
|
3182
3182
|
/***/ }),
|
|
3183
3183
|
|
|
3184
3184
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js":
|
|
3185
|
-
|
|
3186
|
-
!*** /Users/
|
|
3187
|
-
|
|
3185
|
+
/*!**************************************************************************************************!*\
|
|
3186
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js ***!
|
|
3187
|
+
\**************************************************************************************************/
|
|
3188
3188
|
/*! exports provided: vec2_transformMat4AsVector, vec3_transformMat4AsVector, vec3_transformMat2, vec4_transformMat2, vec4_transformMat3 */
|
|
3189
3189
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3190
3190
|
|
|
@@ -3245,9 +3245,9 @@ function vec4_transformMat3(out, a, m) {
|
|
|
3245
3245
|
/***/ }),
|
|
3246
3246
|
|
|
3247
3247
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/math-utils.js":
|
|
3248
|
-
|
|
3249
|
-
!*** /Users/
|
|
3250
|
-
|
|
3248
|
+
/*!********************************************************************************************!*\
|
|
3249
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/lib/math-utils.js ***!
|
|
3250
|
+
\********************************************************************************************/
|
|
3251
3251
|
/*! exports provided: default */
|
|
3252
3252
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3253
3253
|
|
|
@@ -3284,9 +3284,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3284
3284
|
/***/ }),
|
|
3285
3285
|
|
|
3286
3286
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js":
|
|
3287
|
-
|
|
3288
|
-
!*** /Users/
|
|
3289
|
-
|
|
3287
|
+
/*!********************************************************************************************!*\
|
|
3288
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/@math.gl/core/dist/esm/lib/validators.js ***!
|
|
3289
|
+
\********************************************************************************************/
|
|
3290
3290
|
/*! exports provided: validateVector, checkNumber, checkVector, deprecated */
|
|
3291
3291
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3292
3292
|
|
|
@@ -3337,9 +3337,9 @@ function deprecated(method, version) {
|
|
|
3337
3337
|
/***/ }),
|
|
3338
3338
|
|
|
3339
3339
|
/***/ "../../node_modules/gl-matrix/esm/common.js":
|
|
3340
|
-
|
|
3341
|
-
!*** /Users/
|
|
3342
|
-
|
|
3340
|
+
/*!***************************************************************************!*\
|
|
3341
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/gl-matrix/esm/common.js ***!
|
|
3342
|
+
\***************************************************************************/
|
|
3343
3343
|
/*! exports provided: EPSILON, ARRAY_TYPE, RANDOM, setMatrixArrayType, toRadian, equals */
|
|
3344
3344
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3345
3345
|
|
|
@@ -3405,9 +3405,9 @@ if (!Math.hypot) Math.hypot = function () {
|
|
|
3405
3405
|
/***/ }),
|
|
3406
3406
|
|
|
3407
3407
|
/***/ "../../node_modules/gl-matrix/esm/mat3.js":
|
|
3408
|
-
|
|
3409
|
-
!*** /Users/
|
|
3410
|
-
|
|
3408
|
+
/*!*************************************************************************!*\
|
|
3409
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/gl-matrix/esm/mat3.js ***!
|
|
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__) {
|
|
3413
3413
|
|
|
@@ -4228,9 +4228,9 @@ var sub = subtract;
|
|
|
4228
4228
|
/***/ }),
|
|
4229
4229
|
|
|
4230
4230
|
/***/ "../../node_modules/gl-matrix/esm/mat4.js":
|
|
4231
|
-
|
|
4232
|
-
!*** /Users/
|
|
4233
|
-
|
|
4231
|
+
/*!*************************************************************************!*\
|
|
4232
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/gl-matrix/esm/mat4.js ***!
|
|
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__) {
|
|
4236
4236
|
|
|
@@ -6102,9 +6102,9 @@ var sub = subtract;
|
|
|
6102
6102
|
/***/ }),
|
|
6103
6103
|
|
|
6104
6104
|
/***/ "../../node_modules/gl-matrix/esm/quat.js":
|
|
6105
|
-
|
|
6106
|
-
!*** /Users/
|
|
6107
|
-
|
|
6105
|
+
/*!*************************************************************************!*\
|
|
6106
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/gl-matrix/esm/quat.js ***!
|
|
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__) {
|
|
6110
6110
|
|
|
@@ -6867,9 +6867,9 @@ var setAxes = function () {
|
|
|
6867
6867
|
/***/ }),
|
|
6868
6868
|
|
|
6869
6869
|
/***/ "../../node_modules/gl-matrix/esm/vec2.js":
|
|
6870
|
-
|
|
6871
|
-
!*** /Users/
|
|
6872
|
-
|
|
6870
|
+
/*!*************************************************************************!*\
|
|
6871
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/gl-matrix/esm/vec2.js ***!
|
|
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__) {
|
|
6875
6875
|
|
|
@@ -7549,9 +7549,9 @@ var forEach = function () {
|
|
|
7549
7549
|
/***/ }),
|
|
7550
7550
|
|
|
7551
7551
|
/***/ "../../node_modules/gl-matrix/esm/vec3.js":
|
|
7552
|
-
|
|
7553
|
-
!*** /Users/
|
|
7554
|
-
|
|
7552
|
+
/*!*************************************************************************!*\
|
|
7553
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/gl-matrix/esm/vec3.js ***!
|
|
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__) {
|
|
7557
7557
|
|
|
@@ -8397,9 +8397,9 @@ var forEach = function () {
|
|
|
8397
8397
|
/***/ }),
|
|
8398
8398
|
|
|
8399
8399
|
/***/ "../../node_modules/gl-matrix/esm/vec4.js":
|
|
8400
|
-
|
|
8401
|
-
!*** /Users/
|
|
8402
|
-
|
|
8400
|
+
/*!*************************************************************************!*\
|
|
8401
|
+
!*** /Users/carto/git/visgl/luma.gl/node_modules/gl-matrix/esm/vec4.js ***!
|
|
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__) {
|
|
8405
8405
|
|
package/dist/es5/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/bundle.js"],"names":["moduleExports","require","globalThis","luma","module","exports","Object","assign"],"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","sourcesContent":["const moduleExports = require('./index');\n\n// @ts-ignore\nglobalThis.luma = globalThis.luma || {};\n// @ts-ignore\nmodule.exports = Object.assign(globalThis.luma, moduleExports);\n"],"file":"bundle.js"}
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAGA;;AACA;;AAGA;;AASA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","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"],"file":"index.js"}
|
|
@@ -1 +1 @@
|
|
|
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,CAFb;IAGLD,EAAE,EAAEG,cAAc,CAACN,EAAD,EAAKO,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBP,IAAlB,EAAwB;MAACQ,MAAM,EAAEN,EAAT;MAAaO,IAAI,EAAEb,0BAAnB;MAAoCO,OAAO,EAAPA;IAApC,CAAxB,CAAL,CAHb;IAILO,WAAW,EAAEC,mBAAmB,CAACR,OAAD;EAJ3B,CAAP;AAMD;;AAID,SAASE,cAAT,CACEN,EADF,QAcE;EAAA,IAXEa,EAWF,QAXEA,EAWF;EAAA,IAVEJ,MAUF,QAVEA,MAUF;EAAA,IATEC,IASF,QATEA,IASF;EAAA,IAREN,OAQF,QAREA,OAQF;EAAA,wBAPEU,OAOF;E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A;MAAA;QAAA;MAAA;IAM7B;;IACD,IAAI0B,YAAY,CAACM,MAAjB,EAAyB;MACvBR,MAAM,gBAASE,YAAY,CAACM,MAAtB,CAAN;IACD;;IACDR,MAAM,IAAI,KAAV;EACD;;EAED,OAAOA,MAAP;AACD;;AAED,SAAS7B,sBAAT,CAAgC1B,aAAhC,EAA+C;EAC7C,IAAMuD,MAAM,GAAG;IACbpE,EAAE,EAAE,EADS;IAEbC,EAAE,EAAE;EAFS,CAAf;EAKAY,aAAa,CAACgB,OAAd,CAAsB,UAAAgD,IAAI,EAAI;IAC5B,IAAI9E,IAAJ;;IACA,IAAI,OAAO8E,IAAP,KAAgB,QAApB,EAA8B;MAC5B9E,IAAI,GAAG8E,IAAP;MACAA,IAAI,GAAG9E,IAAI,CAAC8E,IAAZ;IACD,CAHD,MAGO;MACL9E,IAAI,GAAG,EAAP;IACD;;IACD8E,IAAI,GAAGA,IAAI,CAACC,IAAL,EAAP;;IACA,kBAA2BD,IAAI,CAACxD,KAAL,CAAW,GAAX,CAA3B;IAAA;IAAA,IAAO0D,KAAP;IAAA,IAAcR,SAAd;;IACA,IAAMvB,IAAI,GAAG6B,IAAI,CAACG,OAAL,CAAa,MAAb,EAAqB,EAArB,CAAb;IACAZ,MAAM,CAACW,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
|
+
{"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,EAAEE,cAAc,CAACL,EAAD,EAAKM,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBN,IAAlB,EAAwB;AAACO,MAAAA,MAAM,EAAEL,EAAT;AAAaM,MAAAA,IAAI,EAAEZ,0BAAnB;AAAoCO,MAAAA,OAAO,EAAPA;AAApC,KAAxB,CAA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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 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/constants.js"],"names":["VERTEX_SHADER","FRAGMENT_SHADER"],"mappings":";;;;;;AAAO,IAAMA,aAAa,GAAG,IAAtB;;AACA,IAAMC,eAAe,GAAG,IAAxB","sourcesContent":["export const VERTEX_SHADER = 'vs';\nexport const FRAGMENT_SHADER = 'fs';\n"],"file":"constants.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/filters/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"],"mappings":";;;;;;;;;;;AAAA,IAAMA,gBAAgB,GAAG;AACvBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,QADM,oBACGC,KADH,EACUC,QADV,EACoB;AACxB,aACEC,MAAM,CAACC,QAAP,CAAg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AI,GAAGC,SAAS,CAACH,OAAO,CAACf,KAAT,CAAhB;AACA,WAAOmB,MAAM,CAACC,MAAP,CAAc;AAACH,MAAAA,IAAI,EAAJA;AAAD,KAAd,EAAsBF,OAAtB,EAA+BlB,gBAAgB,CAACoB,IAAD,CAA/C,CAAP;AACD;;AACD,SAAOE,MAAM,CAACC,MAAP,CAAc;AAACH,IAAAA,IAAI,EAAJA,IAAD;AAAOjB,IAAAA,KAAK,EAAEe;AAAd,GAAd,EAAsClB,gBAAgB,CAACoB,IAAD,CAAtD,CAAP;AACD;;AAGD,SAASC,SAAT,CAAmBlB,KAAnB,EAA0B;AACxB,MAAIO,KAAK,CAACC,OAAN,CAAcR,KAAd,KAAwBS,WAAW,CAACC,MAAZ,CAAmBV,KAAnB,CAA5B,EAAuD;AACrD,WAAO,OAAP;AACD;;AACD,+BAAcA,KAAd;AACD","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"],"file":"prop-types.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/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","Array","isArray","forEach"],"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;AAAA,MAA7BC,mBAA6B,uEAAP,KAAO;AACtF,MAAMC,QAAQ,GAAGH,IAAI,KAAKV,wBAA1B;;AADsF,6BAG3Ec,GAH2E;AAIpF,QAAMC,YAAY,GAAGJ,MAAM,CAACG,GAAD,CAA3B;AACAC,IAAAA,YAAY,CAACC,IAAb,CAAkB,UAACC,CAAD,EAAIC,CAAJ;AAAA,aAAUD,CAAC,CAACE,KAAF,GAAUD,CAAC,CAACC,KAAtB;AAAA,KAAlB;AACAZ,IAAAA,SAAS,CAACa,MAAV,GAAmBL,YAAY,CAACK,MAAhC;;AACA,SAAK,IAAIC,CAAC,GAAG,CAAR,EAA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CAAepB,iBAAf,EAAkC,UAAAqB,KAAK;AAAA,mBAAIH,cAAc,GAAGG,KAArB;AAAA,WAAvC,CAAT;AACD;;AACD;;AAEF;AAIElB,QAAAA,MAAM,GAAGA,MAAM,CAACiB,OAAP,CAAeZ,GAAf,EAAoB,UAAAa,KAAK;AAAA,iBAAIA,KAAK,GAAGH,cAAZ;AAAA,SAAzB,CAAT;AA1CJ;AAXoF;;AAGtF,OAAK,IAAMV,GAAX,IAAkBH,MAAlB,EAA0B;AAAA,UAAfG,GAAe;AAoDzB;;AAGDL,EAAAA,MAAM,GAAGA,MAAM,CAACiB,OAAP,CAAetB,yBAAf,EAA0C,EAA1C,CAAT;;AAGA,MAAIQ,mBAAJ,EAAyB;AACvBH,IAAAA,MAAM,GAAGA,MAAM,CAACiB,OAAP,CAAe,QAAf,EAAyB,UAAAC,KAAK;AAAA,aAAIA,KAAK,GAAG5B,gBAAgB,CAACW,IAAD,CAA5B;AAAA,KAA9B,CAAT;AACD;;AAED,SAAOD,MAAP;AACD;;AAKM,SAASmB,cAAT,CAAwBC,OAAxB,EAAiC;AACtC,MAAMC,MAAM,GAAG,EAAf;AACA,qBAAOC,KAAK,CAACC,OAAN,CAAcH,OAAd,KAA0BA,OAAO,CAACT,MAAR,GAAiB,CAAlD;AACAS,EAAAA,OAAO,CAACI,OAAR,CAAgB,UAAAtB,MAAM,EAAI;AACxB,SAAK,IAAMG,GAAX,IAAkBH,MAAlB,EAA0B;AACxBmB,MAAAA,MAAM,CAAChB,GAAD,CAAN,GAAcgB,MAAM,CAAChB,GAAD,CAAN,aAAiBgB,MAAM,CAAChB,GAAD,CAAvB,eAAiCH,MAAM,CAACG,GAAD,CAAvC,IAAiDH,MAAM,CAACG,GAAD,CAArE;AACD;AACF,GAJD;AAKA,SAAOgB,MAAP;AACD","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"],"file":"inject-shader.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/platform-defines.js"],"names":["getPlatformShaderDefines","gl","debugInfo","gpuVendor","toLowerCase","getVersionDefines","glslVersion","isFragment","versionDefines","FEATURES","GLSL_FRAG_DEPTH","GLSL_DERIVATIVES","GLSL_FRAG_DATA","behavior","GLSL_TEXTURE_LOD"],"mappings":";;;;;;;;AAAA;;AAEO,SAASA,wBAAT,CAAkCC,EAAlC,EAAsC;AAC3C,MAAMC,SAAS,GAAG,+BAAeD,EAAf,CAAlB;;AAEA,UAAQC,SAAS,CAACC,SAAV,CAAoBC,WAApB,EAAR;AACE,SAAK,QAAL;AACE;;AAMF,SAAK,OAAL;AACE;;AAUF,SAAK,KAAL;AAEE;;AAIF;AAIE;AA7BJ;AAuCD;;AAEM,SAASC,iBAAT,CAA2BJ,EAA3B,EAA+BK,WAA/B,EAA4CC,UAA5C,EAAwD;AAE7D,MAAIC,cAAc,gUAAlB;;AAiBA,MAAI,4BAAYP,EAAZ,EAAgBQ,oBAASC,eAAzB,CAAJ,EAA+C;AAC7CF,IAAAA,cAAc,2NAAd;AAUD;;AACD,MACE,4BAAYP,EAAZ,EAAgBQ,oBAASE,gBAAzB,KACA,wCAAwBV,EAAxB,EAA4BQ,oBAASE,gBAArC,CAFF,EAGE;AACAH,IAAAA,cAAc,qNAAd;AASD;;AACD,MACE,4BAAYP,EAAZ,EAAgBQ,oBAASG,cAAzB,KACA,wCAAwBX,EAAxB,EAA4BQ,oBAASG,cAArC,EAAqD;AAACC,IAAAA,QAAQ,EAAE;AAAX,GAArD,CAFF,EAGE;AACAL,IAAAA,cAAc,8LAAd;AASD;;AACD,MAAI,4BAAYP,EAAZ,EAAgBQ,oBAASK,gBAAzB,CAAJ,EAAgD;AAC9CN,IAAAA,cAAc,8MAAd;AAUD;;AACD,SAAOA,cAAP;AACD","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"],"file":"platform-defines.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/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","TEST_EXPORTS"],"mappings":";;;;;;;;;;AAAA;;AACA;;;;;;;;AAGO,SAASA,cAAT,CAAwBC,OAAxB,EAAiC;AACtC,SAAOC,qBAAqB,CAACC,kBAAkB,CAACF,OAAD,CAAnB,CAA5B;AACD;;AAcD,SAASC,qBAAT,CAA+BD,OAA/B,EAAwC;AACtC,MAAMG,SAAS,GAAG,EAAlB;AACA,MAAMC,WAAW,GAAG,EAApB;AACAC,EAAAA,kBAAkB,CAAC;AAACL,IAAAA,OAAO,EAAPA,OAAD;AAAUM,IAAAA,KAAK,EAAE,CAAjB;AAAoBH,IAAAA,SAAS,EAATA,SAApB;AAA+BC,IAAAA,WAAW,EAAXA;AAA/B,GAAD,CAAlB;AAGA,SAAOG,MAAM,CAACC,IAAP,CAAYJ,WAAZ,EACJK,IADI,CACC,UAACC,CAAD,EAAIC,CAAJ;AAAA,WAAUP,WAAW,CAACO,CAAD,CAAX,GAAiBP,WAAW,CAACM,CAAD,CAAtC;AAAA,GADD,EAEJE,GAFI,CAEA,UAAAC,IAAI;AAAA,WAAIV,SAAS,CAACU,IAAD,CAAb;AAAA,GAFJ,CAAP;AAGD;;AAcD,SAASR,kBAAT,OAAsE;AAAA,MAAzCL,OAAyC,QAAzCA,OAAyC;AAAA,MAAhCM,KAAgC,QAAhCA,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AM,GAAG,IAAII,qBAAJ,CAAiBJ,MAAjB,CAAT;AACAA,IAAAA,MAAM,CAACE,YAAP,GAAsBf,kBAAkB,CAACa,MAAM,CAACE,YAAR,CAAxC;AAEA,WAAOF,MAAP;AACD,GAfM,CAAP;AAgBD;;AAEM,IAAMK,YAAY,GAAG;AAC1BnB,EAAAA,qBAAqB,EAArBA,qBAD0B;AAE1BI,EAAAA,kBAAkB,EAAlBA;AAF0B,CAArB","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_EXPORTS = {\n getShaderDependencies,\n getDependencyGraph\n};\n"],"file":"resolve-modules.js"}
|