@deck.gl/extensions 8.6.0-alpha.2 → 8.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +3178 -443
- package/package.json +3 -3
package/dist/dist.dev.js
CHANGED
|
@@ -97,9 +97,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
97
97
|
/******/ ({
|
|
98
98
|
|
|
99
99
|
/***/ "../../node_modules/@luma.gl/constants/dist/esm/index.js":
|
|
100
|
-
|
|
101
|
-
!*** /Users/
|
|
102
|
-
|
|
100
|
+
/*!*************************************************************************************!*\
|
|
101
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/constants/dist/esm/index.js ***!
|
|
102
|
+
\*************************************************************************************/
|
|
103
103
|
/*! exports provided: default */
|
|
104
104
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
105
105
|
|
|
@@ -726,9 +726,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
726
726
|
/***/ }),
|
|
727
727
|
|
|
728
728
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/index.js":
|
|
729
|
-
|
|
730
|
-
!*** /Users/
|
|
731
|
-
|
|
729
|
+
/*!***************************************************************************************!*\
|
|
730
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/index.js ***!
|
|
731
|
+
\***************************************************************************************/
|
|
732
732
|
/*! exports provided: assembleShaders, combineInjects, normalizeShaderModule, getQualifierDetails, getPassthroughFS, typeToChannelSuffix, typeToChannelCount, convertToVec4, random, fp32, fp64, fp64arithmetic, project, lights, dirlight, picking, gouraudLighting, phongLighting, pbr, tiltShift, triangleBlur, zoomBlur, brightnessContrast, denoise, hueSaturation, noise, sepia, vibrance, vignette, colorHalftone, dotScreen, edgeWork, hexagonalPixelate, ink, magnify, bulgePinch, swirl, _warp, fxaa, _transform */
|
|
733
733
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
734
734
|
|
|
@@ -829,9 +829,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
829
829
|
/***/ }),
|
|
830
830
|
|
|
831
831
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/lib/assemble-shaders.js":
|
|
832
|
-
|
|
833
|
-
!*** /Users/
|
|
834
|
-
|
|
832
|
+
/*!******************************************************************************************************!*\
|
|
833
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/lib/assemble-shaders.js ***!
|
|
834
|
+
\******************************************************************************************************/
|
|
835
835
|
/*! exports provided: assembleShaders */
|
|
836
836
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
837
837
|
|
|
@@ -850,12 +850,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
850
850
|
|
|
851
851
|
|
|
852
852
|
|
|
853
|
-
const INJECT_SHADER_DECLARATIONS =
|
|
853
|
+
const INJECT_SHADER_DECLARATIONS = `\n\n${_inject_shader__WEBPACK_IMPORTED_MODULE_3__["DECLARATION_INJECT_MARKER"]}\n\n`;
|
|
854
854
|
const SHADER_TYPE = {
|
|
855
855
|
[_constants__WEBPACK_IMPORTED_MODULE_0__["VERTEX_SHADER"]]: 'vertex',
|
|
856
856
|
[_constants__WEBPACK_IMPORTED_MODULE_0__["FRAGMENT_SHADER"]]: 'fragment'
|
|
857
857
|
};
|
|
858
|
-
const FRAGMENT_SHADER_PROLOGUE =
|
|
858
|
+
const FRAGMENT_SHADER_PROLOGUE = `\
|
|
859
|
+
precision highp float;
|
|
860
|
+
|
|
861
|
+
`;
|
|
859
862
|
function assembleShaders(gl, opts) {
|
|
860
863
|
const {
|
|
861
864
|
vs,
|
|
@@ -902,7 +905,7 @@ function assembleShader(gl, {
|
|
|
902
905
|
versionLine = sourceLines[0];
|
|
903
906
|
coreSource = sourceLines.slice(1).join('\n');
|
|
904
907
|
} else {
|
|
905
|
-
versionLine =
|
|
908
|
+
versionLine = `#version ${glslVersion}`;
|
|
906
909
|
}
|
|
907
910
|
|
|
908
911
|
const allDefines = {};
|
|
@@ -910,13 +913,22 @@ function assembleShader(gl, {
|
|
|
910
913
|
Object.assign(allDefines, module.getDefines());
|
|
911
914
|
});
|
|
912
915
|
Object.assign(allDefines, defines);
|
|
913
|
-
let assembledSource = prologue ?
|
|
916
|
+
let assembledSource = prologue ? `\
|
|
917
|
+
${versionLine}
|
|
918
|
+
${getShaderName({
|
|
914
919
|
id,
|
|
915
920
|
source,
|
|
916
921
|
type
|
|
917
|
-
})
|
|
922
|
+
})}
|
|
923
|
+
${getShaderType({
|
|
918
924
|
type
|
|
919
|
-
})
|
|
925
|
+
})}
|
|
926
|
+
${Object(_platform_defines__WEBPACK_IMPORTED_MODULE_2__["getPlatformShaderDefines"])(gl)}
|
|
927
|
+
${Object(_platform_defines__WEBPACK_IMPORTED_MODULE_2__["getVersionDefines"])(gl, glslVersion, !isVertex)}
|
|
928
|
+
${getApplicationDefines(allDefines)}
|
|
929
|
+
${isVertex ? '' : FRAGMENT_SHADER_PROLOGUE}
|
|
930
|
+
` : `${versionLine}
|
|
931
|
+
`;
|
|
920
932
|
const hookFunctionMap = normalizeHookFunctions(hookFunctions);
|
|
921
933
|
const hookInjections = {};
|
|
922
934
|
const declInjections = {};
|
|
@@ -996,7 +1008,9 @@ function assembleGetUniforms(modules) {
|
|
|
996
1008
|
function getShaderType({
|
|
997
1009
|
type
|
|
998
1010
|
}) {
|
|
999
|
-
return
|
|
1011
|
+
return `
|
|
1012
|
+
#define SHADER_TYPE_${SHADER_TYPE[type].toUpperCase()}
|
|
1013
|
+
`;
|
|
1000
1014
|
}
|
|
1001
1015
|
|
|
1002
1016
|
function getShaderName({
|
|
@@ -1005,7 +1019,10 @@ function getShaderName({
|
|
|
1005
1019
|
type
|
|
1006
1020
|
}) {
|
|
1007
1021
|
const injectShaderName = id && typeof id === 'string' && source.indexOf('SHADER_NAME') === -1;
|
|
1008
|
-
return injectShaderName ?
|
|
1022
|
+
return injectShaderName ? `
|
|
1023
|
+
#define SHADER_NAME ${id}_${SHADER_TYPE[type]}
|
|
1024
|
+
|
|
1025
|
+
` : '';
|
|
1009
1026
|
}
|
|
1010
1027
|
|
|
1011
1028
|
function getApplicationDefines(defines = {}) {
|
|
@@ -1021,7 +1038,7 @@ function getApplicationDefines(defines = {}) {
|
|
|
1021
1038
|
const value = defines[define];
|
|
1022
1039
|
|
|
1023
1040
|
if (value || Number.isFinite(value)) {
|
|
1024
|
-
sourceText +=
|
|
1041
|
+
sourceText += `#define ${define.toUpperCase()} ${defines[define]}\n`;
|
|
1025
1042
|
}
|
|
1026
1043
|
}
|
|
1027
1044
|
|
|
@@ -1037,10 +1054,10 @@ function getHookFunctions(hookFunctions, hookInjections) {
|
|
|
1037
1054
|
|
|
1038
1055
|
for (const hookName in hookFunctions) {
|
|
1039
1056
|
const hookFunction = hookFunctions[hookName];
|
|
1040
|
-
result +=
|
|
1057
|
+
result += `void ${hookFunction.signature} {\n`;
|
|
1041
1058
|
|
|
1042
1059
|
if (hookFunction.header) {
|
|
1043
|
-
result +=
|
|
1060
|
+
result += ` ${hookFunction.header}`;
|
|
1044
1061
|
}
|
|
1045
1062
|
|
|
1046
1063
|
if (hookInjections[hookName]) {
|
|
@@ -1048,12 +1065,12 @@ function getHookFunctions(hookFunctions, hookInjections) {
|
|
|
1048
1065
|
injections.sort((a, b) => a.order - b.order);
|
|
1049
1066
|
|
|
1050
1067
|
for (const injection of injections) {
|
|
1051
|
-
result +=
|
|
1068
|
+
result += ` ${injection.injection}\n`;
|
|
1052
1069
|
}
|
|
1053
1070
|
}
|
|
1054
1071
|
|
|
1055
1072
|
if (hookFunction.footer) {
|
|
1056
|
-
result +=
|
|
1073
|
+
result += ` ${hookFunction.footer}`;
|
|
1057
1074
|
}
|
|
1058
1075
|
|
|
1059
1076
|
result += '}\n';
|
|
@@ -1091,9 +1108,9 @@ function normalizeHookFunctions(hookFunctions) {
|
|
|
1091
1108
|
/***/ }),
|
|
1092
1109
|
|
|
1093
1110
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/lib/constants.js":
|
|
1094
|
-
|
|
1095
|
-
!*** /Users/
|
|
1096
|
-
|
|
1111
|
+
/*!***********************************************************************************************!*\
|
|
1112
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/lib/constants.js ***!
|
|
1113
|
+
\***********************************************************************************************/
|
|
1097
1114
|
/*! exports provided: VERTEX_SHADER, FRAGMENT_SHADER */
|
|
1098
1115
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1099
1116
|
|
|
@@ -1108,9 +1125,9 @@ const FRAGMENT_SHADER = 'fs';
|
|
|
1108
1125
|
/***/ }),
|
|
1109
1126
|
|
|
1110
1127
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/lib/filters/prop-types.js":
|
|
1111
|
-
|
|
1112
|
-
!*** /Users/
|
|
1113
|
-
|
|
1128
|
+
/*!********************************************************************************************************!*\
|
|
1129
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/lib/filters/prop-types.js ***!
|
|
1130
|
+
\********************************************************************************************************/
|
|
1114
1131
|
/*! exports provided: parsePropTypes */
|
|
1115
1132
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1116
1133
|
|
|
@@ -1189,9 +1206,9 @@ function getTypeOf(value) {
|
|
|
1189
1206
|
/***/ }),
|
|
1190
1207
|
|
|
1191
1208
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/lib/inject-shader.js":
|
|
1192
|
-
|
|
1193
|
-
!*** /Users/
|
|
1194
|
-
|
|
1209
|
+
/*!***************************************************************************************************!*\
|
|
1210
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/lib/inject-shader.js ***!
|
|
1211
|
+
\***************************************************************************************************/
|
|
1195
1212
|
/*! exports provided: DECLARATION_INJECT_MARKER, default, combineInjects */
|
|
1196
1213
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1197
1214
|
|
|
@@ -1226,7 +1243,7 @@ function injectShader(source, type, inject, injectStandardStubs = false) {
|
|
|
1226
1243
|
fragments[i] = fragmentData[i].injection;
|
|
1227
1244
|
}
|
|
1228
1245
|
|
|
1229
|
-
const fragmentString =
|
|
1246
|
+
const fragmentString = `${fragments.join('\n')}\n`;
|
|
1230
1247
|
|
|
1231
1248
|
switch (key) {
|
|
1232
1249
|
case 'vs:#decl':
|
|
@@ -1289,7 +1306,7 @@ function combineInjects(injects) {
|
|
|
1289
1306
|
Object(_utils__WEBPACK_IMPORTED_MODULE_2__["assert"])(Array.isArray(injects) && injects.length > 1);
|
|
1290
1307
|
injects.forEach(inject => {
|
|
1291
1308
|
for (const key in inject) {
|
|
1292
|
-
result[key] = result[key] ?
|
|
1309
|
+
result[key] = result[key] ? `${result[key]}\n${inject[key]}` : inject[key];
|
|
1293
1310
|
}
|
|
1294
1311
|
});
|
|
1295
1312
|
return result;
|
|
@@ -1299,9 +1316,9 @@ function combineInjects(injects) {
|
|
|
1299
1316
|
/***/ }),
|
|
1300
1317
|
|
|
1301
1318
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/lib/platform-defines.js":
|
|
1302
|
-
|
|
1303
|
-
!*** /Users/
|
|
1304
|
-
|
|
1319
|
+
/*!******************************************************************************************************!*\
|
|
1320
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/lib/platform-defines.js ***!
|
|
1321
|
+
\******************************************************************************************************/
|
|
1305
1322
|
/*! exports provided: getPlatformShaderDefines, getVersionDefines */
|
|
1306
1323
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1307
1324
|
|
|
@@ -1316,37 +1333,108 @@ function getPlatformShaderDefines(gl) {
|
|
|
1316
1333
|
|
|
1317
1334
|
switch (debugInfo.gpuVendor.toLowerCase()) {
|
|
1318
1335
|
case 'nvidia':
|
|
1319
|
-
return
|
|
1336
|
+
return `\
|
|
1337
|
+
#define NVIDIA_GPU
|
|
1338
|
+
// Nvidia optimizes away the calculation necessary for emulated fp64
|
|
1339
|
+
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
1340
|
+
`;
|
|
1320
1341
|
|
|
1321
1342
|
case 'intel':
|
|
1322
|
-
return
|
|
1343
|
+
return `\
|
|
1344
|
+
#define INTEL_GPU
|
|
1345
|
+
// Intel optimizes away the calculation necessary for emulated fp64
|
|
1346
|
+
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
1347
|
+
// Intel's built-in 'tan' function doesn't have acceptable precision
|
|
1348
|
+
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
1349
|
+
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
|
|
1350
|
+
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
1351
|
+
`;
|
|
1323
1352
|
|
|
1324
1353
|
case 'amd':
|
|
1325
|
-
return
|
|
1354
|
+
return `\
|
|
1355
|
+
#define AMD_GPU
|
|
1356
|
+
`;
|
|
1326
1357
|
|
|
1327
1358
|
default:
|
|
1328
|
-
return
|
|
1359
|
+
return `\
|
|
1360
|
+
#define DEFAULT_GPU
|
|
1361
|
+
// Prevent driver from optimizing away the calculation necessary for emulated fp64
|
|
1362
|
+
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
1363
|
+
// Intel's built-in 'tan' function doesn't have acceptable precision
|
|
1364
|
+
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
1365
|
+
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
|
|
1366
|
+
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
1367
|
+
`;
|
|
1329
1368
|
}
|
|
1330
1369
|
}
|
|
1331
1370
|
function getVersionDefines(gl, glslVersion, isFragment) {
|
|
1332
|
-
let versionDefines =
|
|
1371
|
+
let versionDefines = `\
|
|
1372
|
+
#if (__VERSION__ > 120)
|
|
1373
|
+
|
|
1374
|
+
# define FEATURE_GLSL_DERIVATIVES
|
|
1375
|
+
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
1376
|
+
# define FEATURE_GLSL_FRAG_DEPTH
|
|
1377
|
+
# define FEATURE_GLSL_TEXTURE_LOD
|
|
1378
|
+
|
|
1379
|
+
// DEPRECATED FLAGS, remove in v9
|
|
1380
|
+
# define FRAG_DEPTH
|
|
1381
|
+
# define DERIVATIVES
|
|
1382
|
+
# define DRAW_BUFFERS
|
|
1383
|
+
# define TEXTURE_LOD
|
|
1384
|
+
|
|
1385
|
+
#endif // __VERSION
|
|
1386
|
+
`;
|
|
1333
1387
|
|
|
1334
1388
|
if (Object(_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["hasFeatures"])(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["FEATURES"].GLSL_FRAG_DEPTH)) {
|
|
1335
|
-
versionDefines +=
|
|
1389
|
+
versionDefines += `\
|
|
1390
|
+
|
|
1391
|
+
// FRAG_DEPTH => gl_FragDepth is available
|
|
1392
|
+
#ifdef GL_EXT_frag_depth
|
|
1393
|
+
#extension GL_EXT_frag_depth : enable
|
|
1394
|
+
# define FEATURE_GLSL_FRAG_DEPTH
|
|
1395
|
+
# define FRAG_DEPTH
|
|
1396
|
+
# define gl_FragDepth gl_FragDepthEXT
|
|
1397
|
+
#endif
|
|
1398
|
+
`;
|
|
1336
1399
|
}
|
|
1337
1400
|
|
|
1338
1401
|
if (Object(_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["hasFeatures"])(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["FEATURES"].GLSL_DERIVATIVES) && Object(_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["canCompileGLGSExtension"])(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["FEATURES"].GLSL_DERIVATIVES)) {
|
|
1339
|
-
versionDefines +=
|
|
1402
|
+
versionDefines += `\
|
|
1403
|
+
|
|
1404
|
+
// DERIVATIVES => dxdF, dxdY and fwidth are available
|
|
1405
|
+
#ifdef GL_OES_standard_derivatives
|
|
1406
|
+
#extension GL_OES_standard_derivatives : enable
|
|
1407
|
+
# define FEATURE_GLSL_DERIVATIVES
|
|
1408
|
+
# define DERIVATIVES
|
|
1409
|
+
#endif
|
|
1410
|
+
`;
|
|
1340
1411
|
}
|
|
1341
1412
|
|
|
1342
1413
|
if (Object(_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["hasFeatures"])(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["FEATURES"].GLSL_FRAG_DATA) && Object(_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["canCompileGLGSExtension"])(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["FEATURES"].GLSL_FRAG_DATA, {
|
|
1343
1414
|
behavior: 'require'
|
|
1344
1415
|
})) {
|
|
1345
|
-
versionDefines +=
|
|
1416
|
+
versionDefines += `\
|
|
1417
|
+
|
|
1418
|
+
// DRAW_BUFFERS => gl_FragData[] is available
|
|
1419
|
+
#ifdef GL_EXT_draw_buffers
|
|
1420
|
+
#extension GL_EXT_draw_buffers : require
|
|
1421
|
+
#define FEATURE_GLSL_DRAW_BUFFERS
|
|
1422
|
+
#define DRAW_BUFFERS
|
|
1423
|
+
#endif
|
|
1424
|
+
`;
|
|
1346
1425
|
}
|
|
1347
1426
|
|
|
1348
1427
|
if (Object(_utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["hasFeatures"])(gl, _utils_webgl_info__WEBPACK_IMPORTED_MODULE_0__["FEATURES"].GLSL_TEXTURE_LOD)) {
|
|
1349
|
-
versionDefines +=
|
|
1428
|
+
versionDefines += `\
|
|
1429
|
+
// TEXTURE_LOD => texture2DLod etc are available
|
|
1430
|
+
#ifdef GL_EXT_shader_texture_lod
|
|
1431
|
+
#extension GL_EXT_shader_texture_lod : enable
|
|
1432
|
+
|
|
1433
|
+
# define FEATURE_GLSL_TEXTURE_LOD
|
|
1434
|
+
# define TEXTURE_LOD
|
|
1435
|
+
|
|
1436
|
+
#endif
|
|
1437
|
+
`;
|
|
1350
1438
|
}
|
|
1351
1439
|
|
|
1352
1440
|
return versionDefines;
|
|
@@ -1356,9 +1444,9 @@ function getVersionDefines(gl, glslVersion, isFragment) {
|
|
|
1356
1444
|
/***/ }),
|
|
1357
1445
|
|
|
1358
1446
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/lib/resolve-modules.js":
|
|
1359
|
-
|
|
1360
|
-
!*** /Users/
|
|
1361
|
-
|
|
1447
|
+
/*!*****************************************************************************************************!*\
|
|
1448
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/lib/resolve-modules.js ***!
|
|
1449
|
+
\*****************************************************************************************************/
|
|
1362
1450
|
/*! exports provided: resolveModules, TEST_EXPORTS */
|
|
1363
1451
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1364
1452
|
|
|
@@ -1422,7 +1510,7 @@ function instantiateModules(modules, seen) {
|
|
|
1422
1510
|
return module;
|
|
1423
1511
|
}
|
|
1424
1512
|
|
|
1425
|
-
Object(_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(typeof module !== 'string',
|
|
1513
|
+
Object(_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(typeof module !== 'string', `Shader module use by name is deprecated. Import shader module '${module}' and use it directly.`);
|
|
1426
1514
|
Object(_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(module.name, 'shader module has no name');
|
|
1427
1515
|
module = new _shader_module__WEBPACK_IMPORTED_MODULE_0__["default"](module);
|
|
1428
1516
|
module.dependencies = instantiateModules(module.dependencies);
|
|
@@ -1439,9 +1527,9 @@ const TEST_EXPORTS = {
|
|
|
1439
1527
|
/***/ }),
|
|
1440
1528
|
|
|
1441
1529
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/lib/shader-module.js":
|
|
1442
|
-
|
|
1443
|
-
!*** /Users/
|
|
1444
|
-
|
|
1530
|
+
/*!***************************************************************************************************!*\
|
|
1531
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/lib/shader-module.js ***!
|
|
1532
|
+
\***************************************************************************************************/
|
|
1445
1533
|
/*! exports provided: default, normalizeShaderModule */
|
|
1446
1534
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1447
1535
|
|
|
@@ -1500,7 +1588,12 @@ class ShaderModule {
|
|
|
1500
1588
|
Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(false);
|
|
1501
1589
|
}
|
|
1502
1590
|
|
|
1503
|
-
return
|
|
1591
|
+
return `\
|
|
1592
|
+
#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi, '_')}
|
|
1593
|
+
${moduleSource}\
|
|
1594
|
+
// END MODULE_${this.name}
|
|
1595
|
+
|
|
1596
|
+
`;
|
|
1504
1597
|
}
|
|
1505
1598
|
|
|
1506
1599
|
getUniforms(opts, uniforms) {
|
|
@@ -1535,11 +1628,11 @@ class ShaderModule {
|
|
|
1535
1628
|
deprecations.forEach(def => {
|
|
1536
1629
|
switch (def.type) {
|
|
1537
1630
|
case 'function':
|
|
1538
|
-
def.regex = new RegExp(
|
|
1631
|
+
def.regex = new RegExp(`\\b${def.old}\\(`);
|
|
1539
1632
|
break;
|
|
1540
1633
|
|
|
1541
1634
|
default:
|
|
1542
|
-
def.regex = new RegExp(
|
|
1635
|
+
def.regex = new RegExp(`${def.type} ${def.old};`);
|
|
1543
1636
|
}
|
|
1544
1637
|
});
|
|
1545
1638
|
return deprecations;
|
|
@@ -1554,7 +1647,7 @@ class ShaderModule {
|
|
|
1554
1647
|
|
|
1555
1648
|
if (key in opts && !propDef.private) {
|
|
1556
1649
|
if (propDef.validate) {
|
|
1557
|
-
Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(propDef.validate(opts[key], propDef),
|
|
1650
|
+
Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assert"])(propDef.validate(opts[key], propDef), `${this.name}: invalid ${key}`);
|
|
1558
1651
|
}
|
|
1559
1652
|
|
|
1560
1653
|
uniforms[key] = opts[key];
|
|
@@ -1607,9 +1700,9 @@ function normalizeInjections(injections) {
|
|
|
1607
1700
|
/***/ }),
|
|
1608
1701
|
|
|
1609
1702
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/lib/transpile-shader.js":
|
|
1610
|
-
|
|
1611
|
-
!*** /Users/
|
|
1612
|
-
|
|
1703
|
+
/*!******************************************************************************************************!*\
|
|
1704
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/lib/transpile-shader.js ***!
|
|
1705
|
+
\******************************************************************************************************/
|
|
1613
1706
|
/*! exports provided: default */
|
|
1614
1707
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1615
1708
|
|
|
@@ -1617,7 +1710,7 @@ function normalizeInjections(injections) {
|
|
|
1617
1710
|
__webpack_require__.r(__webpack_exports__);
|
|
1618
1711
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return transpileShader; });
|
|
1619
1712
|
function testVariable(qualifier) {
|
|
1620
|
-
return new RegExp(
|
|
1713
|
+
return new RegExp(`\\b${qualifier}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`, 'g');
|
|
1621
1714
|
}
|
|
1622
1715
|
|
|
1623
1716
|
const ES300_REPLACEMENTS = [[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/, '#version 300 es\n'], [/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g, 'textureLod('], [/\btexture(2D|2DProj|Cube)(EXT)?\(/g, 'texture(']];
|
|
@@ -1638,7 +1731,7 @@ function transpileShader(source, targetGLSLVersion, isVertex) {
|
|
|
1638
1731
|
return isVertex ? convertShader(source, ES100_VERTEX_REPLACEMENTS) : convertFragmentShaderTo100(source);
|
|
1639
1732
|
|
|
1640
1733
|
default:
|
|
1641
|
-
throw new Error(
|
|
1734
|
+
throw new Error(`unknown GLSL version ${targetGLSLVersion}`);
|
|
1642
1735
|
}
|
|
1643
1736
|
}
|
|
1644
1737
|
|
|
@@ -1656,10 +1749,10 @@ function convertFragmentShaderTo300(source) {
|
|
|
1656
1749
|
|
|
1657
1750
|
if (outputMatch) {
|
|
1658
1751
|
const outputName = outputMatch[1];
|
|
1659
|
-
source = source.replace(new RegExp(
|
|
1752
|
+
source = source.replace(new RegExp(`\\b${ES100_FRAGMENT_OUTPUT_NAME}\\b`, 'g'), outputName);
|
|
1660
1753
|
} else {
|
|
1661
1754
|
const outputName = 'fragmentColor';
|
|
1662
|
-
source = source.replace(REGEX_START_OF_MAIN, match =>
|
|
1755
|
+
source = source.replace(REGEX_START_OF_MAIN, match => `out vec4 ${outputName};\n${match}`).replace(new RegExp(`\\b${ES100_FRAGMENT_OUTPUT_NAME}\\b`, 'g'), outputName);
|
|
1663
1756
|
}
|
|
1664
1757
|
|
|
1665
1758
|
return source;
|
|
@@ -1671,7 +1764,7 @@ function convertFragmentShaderTo100(source) {
|
|
|
1671
1764
|
|
|
1672
1765
|
if (outputMatch) {
|
|
1673
1766
|
const outputName = outputMatch[1];
|
|
1674
|
-
source = source.replace(ES300_FRAGMENT_OUTPUT_REGEX, '').replace(new RegExp(
|
|
1767
|
+
source = source.replace(ES300_FRAGMENT_OUTPUT_REGEX, '').replace(new RegExp(`\\b${outputName}\\b`, 'g'), ES100_FRAGMENT_OUTPUT_NAME);
|
|
1675
1768
|
}
|
|
1676
1769
|
|
|
1677
1770
|
return source;
|
|
@@ -1681,9 +1774,9 @@ function convertFragmentShaderTo100(source) {
|
|
|
1681
1774
|
/***/ }),
|
|
1682
1775
|
|
|
1683
1776
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/dirlight/dirlight.js":
|
|
1684
|
-
|
|
1685
|
-
!*** /Users/
|
|
1686
|
-
|
|
1777
|
+
/*!***********************************************************************************************************!*\
|
|
1778
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/dirlight/dirlight.js ***!
|
|
1779
|
+
\***********************************************************************************************************/
|
|
1687
1780
|
/*! exports provided: dirlight */
|
|
1688
1781
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1689
1782
|
|
|
@@ -1708,7 +1801,14 @@ function getUniforms(opts = DEFAULT_MODULE_OPTIONS) {
|
|
|
1708
1801
|
}
|
|
1709
1802
|
|
|
1710
1803
|
const vs = null;
|
|
1711
|
-
const fs =
|
|
1804
|
+
const fs = `\
|
|
1805
|
+
uniform vec3 dirlight_uLightDirection;
|
|
1806
|
+
vec4 dirlight_filterColor(vec4 color) {
|
|
1807
|
+
vec3 normal = project_getNormal_World();
|
|
1808
|
+
float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));
|
|
1809
|
+
return vec4(color.rgb * d, color.a);
|
|
1810
|
+
}
|
|
1811
|
+
`;
|
|
1712
1812
|
const dirlight = {
|
|
1713
1813
|
name: 'dirlight',
|
|
1714
1814
|
vs,
|
|
@@ -1721,16 +1821,163 @@ const dirlight = {
|
|
|
1721
1821
|
/***/ }),
|
|
1722
1822
|
|
|
1723
1823
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/fp32/fp32.js":
|
|
1724
|
-
|
|
1725
|
-
!*** /Users/
|
|
1726
|
-
|
|
1824
|
+
/*!***************************************************************************************************!*\
|
|
1825
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/fp32/fp32.js ***!
|
|
1826
|
+
\***************************************************************************************************/
|
|
1727
1827
|
/*! exports provided: fp32 */
|
|
1728
1828
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1729
1829
|
|
|
1730
1830
|
"use strict";
|
|
1731
1831
|
__webpack_require__.r(__webpack_exports__);
|
|
1732
1832
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp32", function() { return fp32; });
|
|
1733
|
-
const fp32shader =
|
|
1833
|
+
const fp32shader = `\
|
|
1834
|
+
#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND
|
|
1835
|
+
const float TWO_PI = 6.2831854820251465;
|
|
1836
|
+
const float PI_2 = 1.5707963705062866;
|
|
1837
|
+
const float PI_16 = 0.1963495463132858;
|
|
1838
|
+
|
|
1839
|
+
const float SIN_TABLE_0 = 0.19509032368659973;
|
|
1840
|
+
const float SIN_TABLE_1 = 0.3826834261417389;
|
|
1841
|
+
const float SIN_TABLE_2 = 0.5555702447891235;
|
|
1842
|
+
const float SIN_TABLE_3 = 0.7071067690849304;
|
|
1843
|
+
|
|
1844
|
+
const float COS_TABLE_0 = 0.9807852506637573;
|
|
1845
|
+
const float COS_TABLE_1 = 0.9238795042037964;
|
|
1846
|
+
const float COS_TABLE_2 = 0.8314695954322815;
|
|
1847
|
+
const float COS_TABLE_3 = 0.7071067690849304;
|
|
1848
|
+
|
|
1849
|
+
const float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;
|
|
1850
|
+
const float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;
|
|
1851
|
+
const float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;
|
|
1852
|
+
const float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;
|
|
1853
|
+
|
|
1854
|
+
float sin_taylor_fp32(float a) {
|
|
1855
|
+
float r, s, t, x;
|
|
1856
|
+
|
|
1857
|
+
if (a == 0.0) {
|
|
1858
|
+
return 0.0;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
x = -a * a;
|
|
1862
|
+
s = a;
|
|
1863
|
+
r = a;
|
|
1864
|
+
|
|
1865
|
+
r = r * x;
|
|
1866
|
+
t = r * INVERSE_FACTORIAL_3;
|
|
1867
|
+
s = s + t;
|
|
1868
|
+
|
|
1869
|
+
r = r * x;
|
|
1870
|
+
t = r * INVERSE_FACTORIAL_5;
|
|
1871
|
+
s = s + t;
|
|
1872
|
+
|
|
1873
|
+
r = r * x;
|
|
1874
|
+
t = r * INVERSE_FACTORIAL_7;
|
|
1875
|
+
s = s + t;
|
|
1876
|
+
|
|
1877
|
+
r = r * x;
|
|
1878
|
+
t = r * INVERSE_FACTORIAL_9;
|
|
1879
|
+
s = s + t;
|
|
1880
|
+
|
|
1881
|
+
return s;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
void sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {
|
|
1885
|
+
if (a == 0.0) {
|
|
1886
|
+
sin_t = 0.0;
|
|
1887
|
+
cos_t = 1.0;
|
|
1888
|
+
}
|
|
1889
|
+
sin_t = sin_taylor_fp32(a);
|
|
1890
|
+
cos_t = sqrt(1.0 - sin_t * sin_t);
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
float tan_taylor_fp32(float a) {
|
|
1894
|
+
float sin_a;
|
|
1895
|
+
float cos_a;
|
|
1896
|
+
|
|
1897
|
+
if (a == 0.0) {
|
|
1898
|
+
return 0.0;
|
|
1899
|
+
}
|
|
1900
|
+
float z = floor(a / TWO_PI);
|
|
1901
|
+
float r = a - TWO_PI * z;
|
|
1902
|
+
|
|
1903
|
+
float t;
|
|
1904
|
+
float q = floor(r / PI_2 + 0.5);
|
|
1905
|
+
int j = int(q);
|
|
1906
|
+
|
|
1907
|
+
if (j < -2 || j > 2) {
|
|
1908
|
+
return 1.0 / 0.0;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
t = r - PI_2 * q;
|
|
1912
|
+
|
|
1913
|
+
q = floor(t / PI_16 + 0.5);
|
|
1914
|
+
int k = int(q);
|
|
1915
|
+
int abs_k = int(abs(float(k)));
|
|
1916
|
+
|
|
1917
|
+
if (abs_k > 4) {
|
|
1918
|
+
return 1.0 / 0.0;
|
|
1919
|
+
} else {
|
|
1920
|
+
t = t - PI_16 * q;
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
float u = 0.0;
|
|
1924
|
+
float v = 0.0;
|
|
1925
|
+
|
|
1926
|
+
float sin_t, cos_t;
|
|
1927
|
+
float s, c;
|
|
1928
|
+
sincos_taylor_fp32(t, sin_t, cos_t);
|
|
1929
|
+
|
|
1930
|
+
if (k == 0) {
|
|
1931
|
+
s = sin_t;
|
|
1932
|
+
c = cos_t;
|
|
1933
|
+
} else {
|
|
1934
|
+
if (abs(float(abs_k) - 1.0) < 0.5) {
|
|
1935
|
+
u = COS_TABLE_0;
|
|
1936
|
+
v = SIN_TABLE_0;
|
|
1937
|
+
} else if (abs(float(abs_k) - 2.0) < 0.5) {
|
|
1938
|
+
u = COS_TABLE_1;
|
|
1939
|
+
v = SIN_TABLE_1;
|
|
1940
|
+
} else if (abs(float(abs_k) - 3.0) < 0.5) {
|
|
1941
|
+
u = COS_TABLE_2;
|
|
1942
|
+
v = SIN_TABLE_2;
|
|
1943
|
+
} else if (abs(float(abs_k) - 4.0) < 0.5) {
|
|
1944
|
+
u = COS_TABLE_3;
|
|
1945
|
+
v = SIN_TABLE_3;
|
|
1946
|
+
}
|
|
1947
|
+
if (k > 0) {
|
|
1948
|
+
s = u * sin_t + v * cos_t;
|
|
1949
|
+
c = u * cos_t - v * sin_t;
|
|
1950
|
+
} else {
|
|
1951
|
+
s = u * sin_t - v * cos_t;
|
|
1952
|
+
c = u * cos_t + v * sin_t;
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
if (j == 0) {
|
|
1957
|
+
sin_a = s;
|
|
1958
|
+
cos_a = c;
|
|
1959
|
+
} else if (j == 1) {
|
|
1960
|
+
sin_a = c;
|
|
1961
|
+
cos_a = -s;
|
|
1962
|
+
} else if (j == -1) {
|
|
1963
|
+
sin_a = -c;
|
|
1964
|
+
cos_a = s;
|
|
1965
|
+
} else {
|
|
1966
|
+
sin_a = -s;
|
|
1967
|
+
cos_a = -c;
|
|
1968
|
+
}
|
|
1969
|
+
return sin_a / cos_a;
|
|
1970
|
+
}
|
|
1971
|
+
#endif
|
|
1972
|
+
|
|
1973
|
+
float tan_fp32(float a) {
|
|
1974
|
+
#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND
|
|
1975
|
+
return tan_taylor_fp32(a);
|
|
1976
|
+
#else
|
|
1977
|
+
return tan(a);
|
|
1978
|
+
#endif
|
|
1979
|
+
}
|
|
1980
|
+
`;
|
|
1734
1981
|
const fp32 = {
|
|
1735
1982
|
name: 'fp32',
|
|
1736
1983
|
vs: fp32shader,
|
|
@@ -1741,131 +1988,902 @@ const fp32 = {
|
|
|
1741
1988
|
/***/ }),
|
|
1742
1989
|
|
|
1743
1990
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-arithmetic.glsl.js":
|
|
1744
|
-
|
|
1745
|
-
!*** /Users/
|
|
1746
|
-
|
|
1991
|
+
/*!*******************************************************************************************************************!*\
|
|
1992
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-arithmetic.glsl.js ***!
|
|
1993
|
+
\*******************************************************************************************************************/
|
|
1747
1994
|
/*! exports provided: default */
|
|
1748
1995
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1749
1996
|
|
|
1750
1997
|
"use strict";
|
|
1751
1998
|
__webpack_require__.r(__webpack_exports__);
|
|
1752
|
-
/* harmony default export */ __webpack_exports__["default"] = (
|
|
1999
|
+
/* harmony default export */ __webpack_exports__["default"] = (`\
|
|
2000
|
+
uniform float ONE;
|
|
2001
|
+
vec2 split(float a) {
|
|
2002
|
+
const float SPLIT = 4097.0;
|
|
2003
|
+
float t = a * SPLIT;
|
|
2004
|
+
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
2005
|
+
float a_hi = t * ONE - (t - a);
|
|
2006
|
+
float a_lo = a * ONE - a_hi;
|
|
2007
|
+
#else
|
|
2008
|
+
float a_hi = t - (t - a);
|
|
2009
|
+
float a_lo = a - a_hi;
|
|
2010
|
+
#endif
|
|
2011
|
+
return vec2(a_hi, a_lo);
|
|
2012
|
+
}
|
|
2013
|
+
vec2 split2(vec2 a) {
|
|
2014
|
+
vec2 b = split(a.x);
|
|
2015
|
+
b.y += a.y;
|
|
2016
|
+
return b;
|
|
2017
|
+
}
|
|
2018
|
+
vec2 quickTwoSum(float a, float b) {
|
|
2019
|
+
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
2020
|
+
float sum = (a + b) * ONE;
|
|
2021
|
+
float err = b - (sum - a) * ONE;
|
|
2022
|
+
#else
|
|
2023
|
+
float sum = a + b;
|
|
2024
|
+
float err = b - (sum - a);
|
|
2025
|
+
#endif
|
|
2026
|
+
return vec2(sum, err);
|
|
2027
|
+
}
|
|
2028
|
+
vec2 twoSum(float a, float b) {
|
|
2029
|
+
float s = (a + b);
|
|
2030
|
+
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
2031
|
+
float v = (s * ONE - a) * ONE;
|
|
2032
|
+
float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);
|
|
2033
|
+
#else
|
|
2034
|
+
float v = s - a;
|
|
2035
|
+
float err = (a - (s - v)) + (b - v);
|
|
2036
|
+
#endif
|
|
2037
|
+
return vec2(s, err);
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
vec2 twoSub(float a, float b) {
|
|
2041
|
+
float s = (a - b);
|
|
2042
|
+
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
2043
|
+
float v = (s * ONE - a) * ONE;
|
|
2044
|
+
float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);
|
|
2045
|
+
#else
|
|
2046
|
+
float v = s - a;
|
|
2047
|
+
float err = (a - (s - v)) - (b + v);
|
|
2048
|
+
#endif
|
|
2049
|
+
return vec2(s, err);
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
vec2 twoSqr(float a) {
|
|
2053
|
+
float prod = a * a;
|
|
2054
|
+
vec2 a_fp64 = split(a);
|
|
2055
|
+
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
2056
|
+
float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *
|
|
2057
|
+
a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;
|
|
2058
|
+
#else
|
|
2059
|
+
float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;
|
|
2060
|
+
#endif
|
|
2061
|
+
return vec2(prod, err);
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
vec2 twoProd(float a, float b) {
|
|
2065
|
+
float prod = a * b;
|
|
2066
|
+
vec2 a_fp64 = split(a);
|
|
2067
|
+
vec2 b_fp64 = split(b);
|
|
2068
|
+
float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +
|
|
2069
|
+
a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;
|
|
2070
|
+
return vec2(prod, err);
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
vec2 sum_fp64(vec2 a, vec2 b) {
|
|
2074
|
+
vec2 s, t;
|
|
2075
|
+
s = twoSum(a.x, b.x);
|
|
2076
|
+
t = twoSum(a.y, b.y);
|
|
2077
|
+
s.y += t.x;
|
|
2078
|
+
s = quickTwoSum(s.x, s.y);
|
|
2079
|
+
s.y += t.y;
|
|
2080
|
+
s = quickTwoSum(s.x, s.y);
|
|
2081
|
+
return s;
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
vec2 sub_fp64(vec2 a, vec2 b) {
|
|
2085
|
+
vec2 s, t;
|
|
2086
|
+
s = twoSub(a.x, b.x);
|
|
2087
|
+
t = twoSub(a.y, b.y);
|
|
2088
|
+
s.y += t.x;
|
|
2089
|
+
s = quickTwoSum(s.x, s.y);
|
|
2090
|
+
s.y += t.y;
|
|
2091
|
+
s = quickTwoSum(s.x, s.y);
|
|
2092
|
+
return s;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
vec2 mul_fp64(vec2 a, vec2 b) {
|
|
2096
|
+
vec2 prod = twoProd(a.x, b.x);
|
|
2097
|
+
prod.y += a.x * b.y;
|
|
2098
|
+
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
|
|
2099
|
+
prod = split2(prod);
|
|
2100
|
+
#endif
|
|
2101
|
+
prod = quickTwoSum(prod.x, prod.y);
|
|
2102
|
+
prod.y += a.y * b.x;
|
|
2103
|
+
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
|
|
2104
|
+
prod = split2(prod);
|
|
2105
|
+
#endif
|
|
2106
|
+
prod = quickTwoSum(prod.x, prod.y);
|
|
2107
|
+
return prod;
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
vec2 div_fp64(vec2 a, vec2 b) {
|
|
2111
|
+
float xn = 1.0 / b.x;
|
|
2112
|
+
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
|
|
2113
|
+
vec2 yn = mul_fp64(a, vec2(xn, 0));
|
|
2114
|
+
#else
|
|
2115
|
+
vec2 yn = a * xn;
|
|
2116
|
+
#endif
|
|
2117
|
+
float diff = (sub_fp64(a, mul_fp64(b, yn))).x;
|
|
2118
|
+
vec2 prod = twoProd(xn, diff);
|
|
2119
|
+
return sum_fp64(yn, prod);
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
vec2 sqrt_fp64(vec2 a) {
|
|
2123
|
+
if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);
|
|
2124
|
+
if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);
|
|
2125
|
+
|
|
2126
|
+
float x = 1.0 / sqrt(a.x);
|
|
2127
|
+
float yn = a.x * x;
|
|
2128
|
+
#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
|
|
2129
|
+
vec2 yn_sqr = twoSqr(yn) * ONE;
|
|
2130
|
+
#else
|
|
2131
|
+
vec2 yn_sqr = twoSqr(yn);
|
|
2132
|
+
#endif
|
|
2133
|
+
float diff = sub_fp64(a, yn_sqr).x;
|
|
2134
|
+
vec2 prod = twoProd(x * 0.5, diff);
|
|
2135
|
+
#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
|
|
2136
|
+
return sum_fp64(split(yn), prod);
|
|
2137
|
+
#else
|
|
2138
|
+
return sum_fp64(vec2(yn, 0.0), prod);
|
|
2139
|
+
#endif
|
|
2140
|
+
}
|
|
2141
|
+
`);
|
|
1753
2142
|
//# sourceMappingURL=fp64-arithmetic.glsl.js.map
|
|
1754
2143
|
|
|
1755
2144
|
/***/ }),
|
|
1756
2145
|
|
|
1757
2146
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-functions.glsl.js":
|
|
1758
|
-
|
|
1759
|
-
!*** /Users/
|
|
1760
|
-
|
|
2147
|
+
/*!******************************************************************************************************************!*\
|
|
2148
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-functions.glsl.js ***!
|
|
2149
|
+
\******************************************************************************************************************/
|
|
1761
2150
|
/*! exports provided: default */
|
|
1762
2151
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1763
2152
|
|
|
1764
2153
|
"use strict";
|
|
1765
2154
|
__webpack_require__.r(__webpack_exports__);
|
|
1766
|
-
/* harmony default export */ __webpack_exports__["default"] = ("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(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 div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n");
|
|
1767
|
-
|
|
2155
|
+
/* harmony default export */ __webpack_exports__["default"] = (`\
|
|
2156
|
+
const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);
|
|
2157
|
+
const vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);
|
|
2158
|
+
const vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);
|
|
2159
|
+
const vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);
|
|
2160
|
+
const vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);
|
|
2161
|
+
const vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);
|
|
2162
|
+
const vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);
|
|
2163
|
+
const vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);
|
|
2164
|
+
const vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);
|
|
2165
|
+
const vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);
|
|
2166
|
+
|
|
2167
|
+
const vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);
|
|
2168
|
+
const vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);
|
|
2169
|
+
const vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);
|
|
2170
|
+
const vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);
|
|
2171
|
+
|
|
2172
|
+
const vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);
|
|
2173
|
+
const vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);
|
|
2174
|
+
const vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);
|
|
2175
|
+
const vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);
|
|
2176
|
+
|
|
2177
|
+
const vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);
|
|
2178
|
+
const vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);
|
|
2179
|
+
const vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);
|
|
2180
|
+
const vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);
|
|
2181
|
+
const vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);
|
|
2182
|
+
const vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);
|
|
2183
|
+
const vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);
|
|
2184
|
+
const vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);
|
|
2185
|
+
|
|
2186
|
+
float nint(float d) {
|
|
2187
|
+
if (d == floor(d)) return d;
|
|
2188
|
+
return floor(d + 0.5);
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
vec2 nint_fp64(vec2 a) {
|
|
2192
|
+
float hi = nint(a.x);
|
|
2193
|
+
float lo;
|
|
2194
|
+
vec2 tmp;
|
|
2195
|
+
if (hi == a.x) {
|
|
2196
|
+
lo = nint(a.y);
|
|
2197
|
+
tmp = quickTwoSum(hi, lo);
|
|
2198
|
+
} else {
|
|
2199
|
+
lo = 0.0;
|
|
2200
|
+
if (abs(hi - a.x) == 0.5 && a.y < 0.0) {
|
|
2201
|
+
hi -= 1.0;
|
|
2202
|
+
}
|
|
2203
|
+
tmp = vec2(hi, lo);
|
|
2204
|
+
}
|
|
2205
|
+
return tmp;
|
|
2206
|
+
}
|
|
1768
2207
|
|
|
1769
|
-
|
|
2208
|
+
vec2 exp_fp64(vec2 a) {
|
|
1770
2209
|
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
!*** /Users/alasarr/dev/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-utils.js ***!
|
|
1774
|
-
\********************************************************************************************************/
|
|
1775
|
-
/*! exports provided: fp64ify, fp64LowPart, fp64ifyMatrix4 */
|
|
1776
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2210
|
+
const int k_power = 4;
|
|
2211
|
+
const float k = 16.0;
|
|
1777
2212
|
|
|
1778
|
-
|
|
1779
|
-
__webpack_require__.r(__webpack_exports__);
|
|
1780
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp64ify", function() { return fp64ify; });
|
|
1781
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp64LowPart", function() { return fp64LowPart; });
|
|
1782
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp64ifyMatrix4", function() { return fp64ifyMatrix4; });
|
|
1783
|
-
function fp64ify(a, out = [], startIndex = 0) {
|
|
1784
|
-
const hiPart = Math.fround(a);
|
|
1785
|
-
const loPart = a - hiPart;
|
|
1786
|
-
out[startIndex] = hiPart;
|
|
1787
|
-
out[startIndex + 1] = loPart;
|
|
1788
|
-
return out;
|
|
1789
|
-
}
|
|
1790
|
-
function fp64LowPart(a) {
|
|
1791
|
-
return a - Math.fround(a);
|
|
1792
|
-
}
|
|
1793
|
-
function fp64ifyMatrix4(matrix) {
|
|
1794
|
-
const matrixFP64 = new Float32Array(32);
|
|
2213
|
+
const float inv_k = 1.0 / k;
|
|
1795
2214
|
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
2215
|
+
if (a.x <= -88.0) return vec2(0.0, 0.0);
|
|
2216
|
+
if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);
|
|
2217
|
+
if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);
|
|
2218
|
+
if (a.x == 1.0 && a.y == 0.0) return E_FP64;
|
|
2219
|
+
|
|
2220
|
+
float m = floor(a.x / LOG2_FP64.x + 0.5);
|
|
2221
|
+
vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;
|
|
2222
|
+
vec2 s, t, p;
|
|
2223
|
+
|
|
2224
|
+
p = mul_fp64(r, r);
|
|
2225
|
+
s = sum_fp64(r, p * 0.5);
|
|
2226
|
+
p = mul_fp64(p, r);
|
|
2227
|
+
t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);
|
|
2228
|
+
|
|
2229
|
+
s = sum_fp64(s, t);
|
|
2230
|
+
p = mul_fp64(p, r);
|
|
2231
|
+
t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);
|
|
2232
|
+
|
|
2233
|
+
s = sum_fp64(s, t);
|
|
2234
|
+
p = mul_fp64(p, r);
|
|
2235
|
+
t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);
|
|
2236
|
+
|
|
2237
|
+
|
|
2238
|
+
|
|
2239
|
+
|
|
2240
|
+
|
|
2241
|
+
|
|
2242
|
+
s = sum_fp64(s, t);
|
|
2243
|
+
for (int i = 0; i < k_power; i++) {
|
|
2244
|
+
s = sum_fp64(s * 2.0, mul_fp64(s, s));
|
|
1801
2245
|
}
|
|
1802
2246
|
|
|
1803
|
-
|
|
2247
|
+
#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)
|
|
2248
|
+
s = sum_fp64(s, vec2(ONE, 0.0));
|
|
2249
|
+
#else
|
|
2250
|
+
s = sum_fp64(s, vec2(1.0, 0.0));
|
|
2251
|
+
#endif
|
|
2252
|
+
|
|
2253
|
+
return s * pow(2.0, m);
|
|
1804
2254
|
}
|
|
1805
|
-
//# sourceMappingURL=fp64-utils.js.map
|
|
1806
2255
|
|
|
1807
|
-
|
|
2256
|
+
vec2 log_fp64(vec2 a)
|
|
2257
|
+
{
|
|
2258
|
+
if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);
|
|
2259
|
+
if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);
|
|
2260
|
+
vec2 x = vec2(log(a.x), 0.0);
|
|
2261
|
+
vec2 s;
|
|
2262
|
+
#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)
|
|
2263
|
+
s = vec2(ONE, 0.0);
|
|
2264
|
+
#else
|
|
2265
|
+
s = vec2(1.0, 0.0);
|
|
2266
|
+
#endif
|
|
1808
2267
|
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
\**************************************************************************************************/
|
|
1813
|
-
/*! exports provided: fp64ify, fp64LowPart, fp64ifyMatrix4, fp64arithmetic, fp64 */
|
|
1814
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2268
|
+
x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);
|
|
2269
|
+
return x;
|
|
2270
|
+
}
|
|
1815
2271
|
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp64arithmetic", function() { return fp64arithmetic; });
|
|
1819
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp64", function() { return fp64; });
|
|
1820
|
-
/* harmony import */ var _fp64_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fp64-utils */ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-utils.js");
|
|
1821
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fp64ify", function() { return _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ify"]; });
|
|
2272
|
+
vec2 sin_taylor_fp64(vec2 a) {
|
|
2273
|
+
vec2 r, s, t, x;
|
|
1822
2274
|
|
|
1823
|
-
|
|
2275
|
+
if (a.x == 0.0 && a.y == 0.0) {
|
|
2276
|
+
return vec2(0.0, 0.0);
|
|
2277
|
+
}
|
|
1824
2278
|
|
|
1825
|
-
|
|
2279
|
+
x = -mul_fp64(a, a);
|
|
2280
|
+
s = a;
|
|
2281
|
+
r = a;
|
|
1826
2282
|
|
|
1827
|
-
|
|
1828
|
-
|
|
2283
|
+
r = mul_fp64(r, x);
|
|
2284
|
+
t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);
|
|
2285
|
+
s = sum_fp64(s, t);
|
|
1829
2286
|
|
|
2287
|
+
r = mul_fp64(r, x);
|
|
2288
|
+
t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);
|
|
2289
|
+
s = sum_fp64(s, t);
|
|
1830
2290
|
|
|
1831
2291
|
|
|
1832
|
-
const CONST_UNIFORMS = {
|
|
1833
|
-
ONE: 1.0
|
|
1834
|
-
};
|
|
1835
2292
|
|
|
1836
2293
|
|
|
1837
|
-
function getUniforms() {
|
|
1838
|
-
return CONST_UNIFORMS;
|
|
1839
|
-
}
|
|
1840
2294
|
|
|
1841
|
-
const fp64arithmetic = {
|
|
1842
|
-
name: 'fp64-arithmetic',
|
|
1843
|
-
vs: _fp64_arithmetic_glsl__WEBPACK_IMPORTED_MODULE_1__["default"],
|
|
1844
|
-
fs: null,
|
|
1845
|
-
getUniforms,
|
|
1846
|
-
fp64ify: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ify"],
|
|
1847
|
-
fp64LowPart: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64LowPart"],
|
|
1848
|
-
fp64ifyMatrix4: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ifyMatrix4"]
|
|
1849
|
-
};
|
|
1850
|
-
const fp64 = {
|
|
1851
|
-
name: 'fp64',
|
|
1852
|
-
vs: _fp64_functions_glsl__WEBPACK_IMPORTED_MODULE_2__["default"],
|
|
1853
|
-
fs: null,
|
|
1854
|
-
dependencies: [fp64arithmetic],
|
|
1855
|
-
fp64ify: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ify"],
|
|
1856
|
-
fp64LowPart: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64LowPart"],
|
|
1857
|
-
fp64ifyMatrix4: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ifyMatrix4"]
|
|
1858
|
-
};
|
|
1859
|
-
//# sourceMappingURL=fp64.js.map
|
|
1860
2295
|
|
|
1861
|
-
|
|
2296
|
+
return s;
|
|
2297
|
+
}
|
|
1862
2298
|
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
2299
|
+
vec2 cos_taylor_fp64(vec2 a) {
|
|
2300
|
+
vec2 r, s, t, x;
|
|
2301
|
+
|
|
2302
|
+
if (a.x == 0.0 && a.y == 0.0) {
|
|
2303
|
+
return vec2(1.0, 0.0);
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
x = -mul_fp64(a, a);
|
|
2307
|
+
r = x;
|
|
2308
|
+
s = sum_fp64(vec2(1.0, 0.0), r * 0.5);
|
|
2309
|
+
|
|
2310
|
+
r = mul_fp64(r, x);
|
|
2311
|
+
t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);
|
|
2312
|
+
s = sum_fp64(s, t);
|
|
2313
|
+
|
|
2314
|
+
r = mul_fp64(r, x);
|
|
2315
|
+
t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);
|
|
2316
|
+
s = sum_fp64(s, t);
|
|
2317
|
+
|
|
2318
|
+
|
|
2319
|
+
|
|
2320
|
+
|
|
2321
|
+
|
|
2322
|
+
|
|
2323
|
+
return s;
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
void sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {
|
|
2327
|
+
if (a.x == 0.0 && a.y == 0.0) {
|
|
2328
|
+
sin_t = vec2(0.0, 0.0);
|
|
2329
|
+
cos_t = vec2(1.0, 0.0);
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
sin_t = sin_taylor_fp64(a);
|
|
2333
|
+
cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
vec2 sin_fp64(vec2 a) {
|
|
2337
|
+
if (a.x == 0.0 && a.y == 0.0) {
|
|
2338
|
+
return vec2(0.0, 0.0);
|
|
2339
|
+
}
|
|
2340
|
+
vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));
|
|
2341
|
+
vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));
|
|
2342
|
+
|
|
2343
|
+
vec2 t;
|
|
2344
|
+
float q = floor(r.x / PI_2_FP64.x + 0.5);
|
|
2345
|
+
int j = int(q);
|
|
2346
|
+
|
|
2347
|
+
if (j < -2 || j > 2) {
|
|
2348
|
+
return vec2(0.0 / 0.0, 0.0 / 0.0);
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));
|
|
2352
|
+
|
|
2353
|
+
q = floor(t.x / PI_16_FP64.x + 0.5);
|
|
2354
|
+
int k = int(q);
|
|
2355
|
+
|
|
2356
|
+
if (k == 0) {
|
|
2357
|
+
if (j == 0) {
|
|
2358
|
+
return sin_taylor_fp64(t);
|
|
2359
|
+
} else if (j == 1) {
|
|
2360
|
+
return cos_taylor_fp64(t);
|
|
2361
|
+
} else if (j == -1) {
|
|
2362
|
+
return -cos_taylor_fp64(t);
|
|
2363
|
+
} else {
|
|
2364
|
+
return -sin_taylor_fp64(t);
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
int abs_k = int(abs(float(k)));
|
|
2369
|
+
|
|
2370
|
+
if (abs_k > 4) {
|
|
2371
|
+
return vec2(0.0 / 0.0, 0.0 / 0.0);
|
|
2372
|
+
} else {
|
|
2373
|
+
t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
vec2 u = vec2(0.0, 0.0);
|
|
2377
|
+
vec2 v = vec2(0.0, 0.0);
|
|
2378
|
+
|
|
2379
|
+
#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)
|
|
2380
|
+
if (abs(float(abs_k) - 1.0) < 0.5) {
|
|
2381
|
+
u = COS_TABLE_0_FP64;
|
|
2382
|
+
v = SIN_TABLE_0_FP64;
|
|
2383
|
+
} else if (abs(float(abs_k) - 2.0) < 0.5) {
|
|
2384
|
+
u = COS_TABLE_1_FP64;
|
|
2385
|
+
v = SIN_TABLE_1_FP64;
|
|
2386
|
+
} else if (abs(float(abs_k) - 3.0) < 0.5) {
|
|
2387
|
+
u = COS_TABLE_2_FP64;
|
|
2388
|
+
v = SIN_TABLE_2_FP64;
|
|
2389
|
+
} else if (abs(float(abs_k) - 4.0) < 0.5) {
|
|
2390
|
+
u = COS_TABLE_3_FP64;
|
|
2391
|
+
v = SIN_TABLE_3_FP64;
|
|
2392
|
+
}
|
|
2393
|
+
#else
|
|
2394
|
+
if (abs_k == 1) {
|
|
2395
|
+
u = COS_TABLE_0_FP64;
|
|
2396
|
+
v = SIN_TABLE_0_FP64;
|
|
2397
|
+
} else if (abs_k == 2) {
|
|
2398
|
+
u = COS_TABLE_1_FP64;
|
|
2399
|
+
v = SIN_TABLE_1_FP64;
|
|
2400
|
+
} else if (abs_k == 3) {
|
|
2401
|
+
u = COS_TABLE_2_FP64;
|
|
2402
|
+
v = SIN_TABLE_2_FP64;
|
|
2403
|
+
} else if (abs_k == 4) {
|
|
2404
|
+
u = COS_TABLE_3_FP64;
|
|
2405
|
+
v = SIN_TABLE_3_FP64;
|
|
2406
|
+
}
|
|
2407
|
+
#endif
|
|
2408
|
+
|
|
2409
|
+
vec2 sin_t, cos_t;
|
|
2410
|
+
sincos_taylor_fp64(t, sin_t, cos_t);
|
|
2411
|
+
|
|
2412
|
+
|
|
2413
|
+
|
|
2414
|
+
vec2 result = vec2(0.0, 0.0);
|
|
2415
|
+
if (j == 0) {
|
|
2416
|
+
if (k > 0) {
|
|
2417
|
+
result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
|
|
2418
|
+
} else {
|
|
2419
|
+
result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
|
|
2420
|
+
}
|
|
2421
|
+
} else if (j == 1) {
|
|
2422
|
+
if (k > 0) {
|
|
2423
|
+
result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
|
|
2424
|
+
} else {
|
|
2425
|
+
result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
|
|
2426
|
+
}
|
|
2427
|
+
} else if (j == -1) {
|
|
2428
|
+
if (k > 0) {
|
|
2429
|
+
result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));
|
|
2430
|
+
} else {
|
|
2431
|
+
result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));
|
|
2432
|
+
}
|
|
2433
|
+
} else {
|
|
2434
|
+
if (k > 0) {
|
|
2435
|
+
result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
|
|
2436
|
+
} else {
|
|
2437
|
+
result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
return result;
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
vec2 cos_fp64(vec2 a) {
|
|
2445
|
+
if (a.x == 0.0 && a.y == 0.0) {
|
|
2446
|
+
return vec2(1.0, 0.0);
|
|
2447
|
+
}
|
|
2448
|
+
vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));
|
|
2449
|
+
vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));
|
|
2450
|
+
|
|
2451
|
+
vec2 t;
|
|
2452
|
+
float q = floor(r.x / PI_2_FP64.x + 0.5);
|
|
2453
|
+
int j = int(q);
|
|
2454
|
+
|
|
2455
|
+
if (j < -2 || j > 2) {
|
|
2456
|
+
return vec2(0.0 / 0.0, 0.0 / 0.0);
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));
|
|
2460
|
+
|
|
2461
|
+
q = floor(t.x / PI_16_FP64.x + 0.5);
|
|
2462
|
+
int k = int(q);
|
|
2463
|
+
|
|
2464
|
+
if (k == 0) {
|
|
2465
|
+
if (j == 0) {
|
|
2466
|
+
return cos_taylor_fp64(t);
|
|
2467
|
+
} else if (j == 1) {
|
|
2468
|
+
return -sin_taylor_fp64(t);
|
|
2469
|
+
} else if (j == -1) {
|
|
2470
|
+
return sin_taylor_fp64(t);
|
|
2471
|
+
} else {
|
|
2472
|
+
return -cos_taylor_fp64(t);
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
int abs_k = int(abs(float(k)));
|
|
2477
|
+
|
|
2478
|
+
if (abs_k > 4) {
|
|
2479
|
+
return vec2(0.0 / 0.0, 0.0 / 0.0);
|
|
2480
|
+
} else {
|
|
2481
|
+
t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
vec2 u = vec2(0.0, 0.0);
|
|
2485
|
+
vec2 v = vec2(0.0, 0.0);
|
|
2486
|
+
|
|
2487
|
+
#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)
|
|
2488
|
+
if (abs(float(abs_k) - 1.0) < 0.5) {
|
|
2489
|
+
u = COS_TABLE_0_FP64;
|
|
2490
|
+
v = SIN_TABLE_0_FP64;
|
|
2491
|
+
} else if (abs(float(abs_k) - 2.0) < 0.5) {
|
|
2492
|
+
u = COS_TABLE_1_FP64;
|
|
2493
|
+
v = SIN_TABLE_1_FP64;
|
|
2494
|
+
} else if (abs(float(abs_k) - 3.0) < 0.5) {
|
|
2495
|
+
u = COS_TABLE_2_FP64;
|
|
2496
|
+
v = SIN_TABLE_2_FP64;
|
|
2497
|
+
} else if (abs(float(abs_k) - 4.0) < 0.5) {
|
|
2498
|
+
u = COS_TABLE_3_FP64;
|
|
2499
|
+
v = SIN_TABLE_3_FP64;
|
|
2500
|
+
}
|
|
2501
|
+
#else
|
|
2502
|
+
if (abs_k == 1) {
|
|
2503
|
+
u = COS_TABLE_0_FP64;
|
|
2504
|
+
v = SIN_TABLE_0_FP64;
|
|
2505
|
+
} else if (abs_k == 2) {
|
|
2506
|
+
u = COS_TABLE_1_FP64;
|
|
2507
|
+
v = SIN_TABLE_1_FP64;
|
|
2508
|
+
} else if (abs_k == 3) {
|
|
2509
|
+
u = COS_TABLE_2_FP64;
|
|
2510
|
+
v = SIN_TABLE_2_FP64;
|
|
2511
|
+
} else if (abs_k == 4) {
|
|
2512
|
+
u = COS_TABLE_3_FP64;
|
|
2513
|
+
v = SIN_TABLE_3_FP64;
|
|
2514
|
+
}
|
|
2515
|
+
#endif
|
|
2516
|
+
|
|
2517
|
+
vec2 sin_t, cos_t;
|
|
2518
|
+
sincos_taylor_fp64(t, sin_t, cos_t);
|
|
2519
|
+
|
|
2520
|
+
vec2 result = vec2(0.0, 0.0);
|
|
2521
|
+
if (j == 0) {
|
|
2522
|
+
if (k > 0) {
|
|
2523
|
+
result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
|
|
2524
|
+
} else {
|
|
2525
|
+
result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
|
|
2526
|
+
}
|
|
2527
|
+
} else if (j == 1) {
|
|
2528
|
+
if (k > 0) {
|
|
2529
|
+
result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
|
|
2530
|
+
} else {
|
|
2531
|
+
result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));
|
|
2532
|
+
}
|
|
2533
|
+
} else if (j == -1) {
|
|
2534
|
+
if (k > 0) {
|
|
2535
|
+
result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
|
|
2536
|
+
} else {
|
|
2537
|
+
result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
|
|
2538
|
+
}
|
|
2539
|
+
} else {
|
|
2540
|
+
if (k > 0) {
|
|
2541
|
+
result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));
|
|
2542
|
+
} else {
|
|
2543
|
+
result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
return result;
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
vec2 tan_fp64(vec2 a) {
|
|
2551
|
+
vec2 sin_a;
|
|
2552
|
+
vec2 cos_a;
|
|
2553
|
+
|
|
2554
|
+
if (a.x == 0.0 && a.y == 0.0) {
|
|
2555
|
+
return vec2(0.0, 0.0);
|
|
2556
|
+
}
|
|
2557
|
+
vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));
|
|
2558
|
+
vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));
|
|
2559
|
+
|
|
2560
|
+
vec2 t;
|
|
2561
|
+
float q = floor(r.x / PI_2_FP64.x + 0.5);
|
|
2562
|
+
int j = int(q);
|
|
2563
|
+
|
|
2564
|
+
|
|
2565
|
+
if (j < -2 || j > 2) {
|
|
2566
|
+
return vec2(0.0 / 0.0, 0.0 / 0.0);
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));
|
|
2570
|
+
|
|
2571
|
+
q = floor(t.x / PI_16_FP64.x + 0.5);
|
|
2572
|
+
int k = int(q);
|
|
2573
|
+
int abs_k = int(abs(float(k)));
|
|
2574
|
+
|
|
2575
|
+
if (abs_k > 4) {
|
|
2576
|
+
return vec2(0.0 / 0.0, 0.0 / 0.0);
|
|
2577
|
+
} else {
|
|
2578
|
+
t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
|
|
2582
|
+
vec2 u = vec2(0.0, 0.0);
|
|
2583
|
+
vec2 v = vec2(0.0, 0.0);
|
|
2584
|
+
|
|
2585
|
+
vec2 sin_t, cos_t;
|
|
2586
|
+
vec2 s, c;
|
|
2587
|
+
sincos_taylor_fp64(t, sin_t, cos_t);
|
|
2588
|
+
|
|
2589
|
+
if (k == 0) {
|
|
2590
|
+
s = sin_t;
|
|
2591
|
+
c = cos_t;
|
|
2592
|
+
} else {
|
|
2593
|
+
#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)
|
|
2594
|
+
if (abs(float(abs_k) - 1.0) < 0.5) {
|
|
2595
|
+
u = COS_TABLE_0_FP64;
|
|
2596
|
+
v = SIN_TABLE_0_FP64;
|
|
2597
|
+
} else if (abs(float(abs_k) - 2.0) < 0.5) {
|
|
2598
|
+
u = COS_TABLE_1_FP64;
|
|
2599
|
+
v = SIN_TABLE_1_FP64;
|
|
2600
|
+
} else if (abs(float(abs_k) - 3.0) < 0.5) {
|
|
2601
|
+
u = COS_TABLE_2_FP64;
|
|
2602
|
+
v = SIN_TABLE_2_FP64;
|
|
2603
|
+
} else if (abs(float(abs_k) - 4.0) < 0.5) {
|
|
2604
|
+
u = COS_TABLE_3_FP64;
|
|
2605
|
+
v = SIN_TABLE_3_FP64;
|
|
2606
|
+
}
|
|
2607
|
+
#else
|
|
2608
|
+
if (abs_k == 1) {
|
|
2609
|
+
u = COS_TABLE_0_FP64;
|
|
2610
|
+
v = SIN_TABLE_0_FP64;
|
|
2611
|
+
} else if (abs_k == 2) {
|
|
2612
|
+
u = COS_TABLE_1_FP64;
|
|
2613
|
+
v = SIN_TABLE_1_FP64;
|
|
2614
|
+
} else if (abs_k == 3) {
|
|
2615
|
+
u = COS_TABLE_2_FP64;
|
|
2616
|
+
v = SIN_TABLE_2_FP64;
|
|
2617
|
+
} else if (abs_k == 4) {
|
|
2618
|
+
u = COS_TABLE_3_FP64;
|
|
2619
|
+
v = SIN_TABLE_3_FP64;
|
|
2620
|
+
}
|
|
2621
|
+
#endif
|
|
2622
|
+
if (k > 0) {
|
|
2623
|
+
s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
|
|
2624
|
+
c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
|
|
2625
|
+
} else {
|
|
2626
|
+
s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
|
|
2627
|
+
c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
if (j == 0) {
|
|
2632
|
+
sin_a = s;
|
|
2633
|
+
cos_a = c;
|
|
2634
|
+
} else if (j == 1) {
|
|
2635
|
+
sin_a = c;
|
|
2636
|
+
cos_a = -s;
|
|
2637
|
+
} else if (j == -1) {
|
|
2638
|
+
sin_a = -c;
|
|
2639
|
+
cos_a = s;
|
|
2640
|
+
} else {
|
|
2641
|
+
sin_a = -s;
|
|
2642
|
+
cos_a = -c;
|
|
2643
|
+
}
|
|
2644
|
+
return div_fp64(sin_a, cos_a);
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
vec2 radians_fp64(vec2 degree) {
|
|
2648
|
+
return mul_fp64(degree, PI_180_FP64);
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
vec2 mix_fp64(vec2 a, vec2 b, float x) {
|
|
2652
|
+
vec2 range = sub_fp64(b, a);
|
|
2653
|
+
return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
void vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {
|
|
2657
|
+
out_val[0] = sum_fp64(a[0], b[0]);
|
|
2658
|
+
out_val[1] = sum_fp64(a[1], b[1]);
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
void vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {
|
|
2662
|
+
out_val[0] = sub_fp64(a[0], b[0]);
|
|
2663
|
+
out_val[1] = sub_fp64(a[1], b[1]);
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2666
|
+
void vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {
|
|
2667
|
+
out_val[0] = mul_fp64(a[0], b[0]);
|
|
2668
|
+
out_val[1] = mul_fp64(a[1], b[1]);
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
void vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {
|
|
2672
|
+
out_val[0] = div_fp64(a[0], b[0]);
|
|
2673
|
+
out_val[1] = div_fp64(a[1], b[1]);
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
void vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {
|
|
2677
|
+
vec2 range[2];
|
|
2678
|
+
vec2_sub_fp64(y, x, range);
|
|
2679
|
+
vec2 portion[2];
|
|
2680
|
+
portion[0] = range[0] * a;
|
|
2681
|
+
portion[1] = range[1] * a;
|
|
2682
|
+
vec2_sum_fp64(x, portion, out_val);
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
vec2 vec2_length_fp64(vec2 x[2]) {
|
|
2686
|
+
return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
void vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {
|
|
2690
|
+
vec2 length = vec2_length_fp64(x);
|
|
2691
|
+
vec2 length_vec2[2];
|
|
2692
|
+
length_vec2[0] = length;
|
|
2693
|
+
length_vec2[1] = length;
|
|
2694
|
+
|
|
2695
|
+
vec2_div_fp64(x, length_vec2, out_val);
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
vec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {
|
|
2699
|
+
vec2 diff[2];
|
|
2700
|
+
vec2_sub_fp64(x, y, diff);
|
|
2701
|
+
return vec2_length_fp64(diff);
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2704
|
+
vec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {
|
|
2705
|
+
vec2 v[2];
|
|
2706
|
+
|
|
2707
|
+
v[0] = mul_fp64(a[0], b[0]);
|
|
2708
|
+
v[1] = mul_fp64(a[1], b[1]);
|
|
2709
|
+
|
|
2710
|
+
return sum_fp64(v[0], v[1]);
|
|
2711
|
+
}
|
|
2712
|
+
void vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {
|
|
2713
|
+
for (int i = 0; i < 3; i++) {
|
|
2714
|
+
out_val[i] = sum_fp64(a[i], b[i]);
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
void vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {
|
|
2719
|
+
for (int i = 0; i < 3; i++) {
|
|
2720
|
+
out_val[i] = sum_fp64(a[i], b[i]);
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
vec2 vec3_length_fp64(vec2 x[3]) {
|
|
2725
|
+
return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),
|
|
2726
|
+
mul_fp64(x[2], x[2])));
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
vec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {
|
|
2730
|
+
vec2 diff[3];
|
|
2731
|
+
vec3_sub_fp64(x, y, diff);
|
|
2732
|
+
return vec3_length_fp64(diff);
|
|
2733
|
+
}
|
|
2734
|
+
void vec4_fp64(vec4 a, out vec2 out_val[4]) {
|
|
2735
|
+
out_val[0].x = a[0];
|
|
2736
|
+
out_val[0].y = 0.0;
|
|
2737
|
+
|
|
2738
|
+
out_val[1].x = a[1];
|
|
2739
|
+
out_val[1].y = 0.0;
|
|
2740
|
+
|
|
2741
|
+
out_val[2].x = a[2];
|
|
2742
|
+
out_val[2].y = 0.0;
|
|
2743
|
+
|
|
2744
|
+
out_val[3].x = a[3];
|
|
2745
|
+
out_val[3].y = 0.0;
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
void vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {
|
|
2749
|
+
out_val[0] = mul_fp64(a[0], b);
|
|
2750
|
+
out_val[1] = mul_fp64(a[1], b);
|
|
2751
|
+
out_val[2] = mul_fp64(a[2], b);
|
|
2752
|
+
out_val[3] = mul_fp64(a[3], b);
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
void vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {
|
|
2756
|
+
for (int i = 0; i < 4; i++) {
|
|
2757
|
+
out_val[i] = sum_fp64(a[i], b[i]);
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
void vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {
|
|
2762
|
+
vec2 v[4];
|
|
2763
|
+
|
|
2764
|
+
v[0] = mul_fp64(a[0], b[0]);
|
|
2765
|
+
v[1] = mul_fp64(a[1], b[1]);
|
|
2766
|
+
v[2] = mul_fp64(a[2], b[2]);
|
|
2767
|
+
v[3] = mul_fp64(a[3], b[3]);
|
|
2768
|
+
|
|
2769
|
+
out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
void mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {
|
|
2773
|
+
vec2 tmp[4];
|
|
2774
|
+
|
|
2775
|
+
for (int i = 0; i < 4; i++)
|
|
2776
|
+
{
|
|
2777
|
+
for (int j = 0; j < 4; j++)
|
|
2778
|
+
{
|
|
2779
|
+
tmp[j] = b[j + i * 4];
|
|
2780
|
+
}
|
|
2781
|
+
vec4_dot_fp64(a, tmp, out_val[i]);
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
`);
|
|
2785
|
+
//# sourceMappingURL=fp64-functions.glsl.js.map
|
|
2786
|
+
|
|
2787
|
+
/***/ }),
|
|
2788
|
+
|
|
2789
|
+
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-utils.js":
|
|
2790
|
+
/*!*********************************************************************************************************!*\
|
|
2791
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-utils.js ***!
|
|
2792
|
+
\*********************************************************************************************************/
|
|
2793
|
+
/*! exports provided: fp64ify, fp64LowPart, fp64ifyMatrix4 */
|
|
2794
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2795
|
+
|
|
2796
|
+
"use strict";
|
|
2797
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2798
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp64ify", function() { return fp64ify; });
|
|
2799
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp64LowPart", function() { return fp64LowPart; });
|
|
2800
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp64ifyMatrix4", function() { return fp64ifyMatrix4; });
|
|
2801
|
+
function fp64ify(a, out = [], startIndex = 0) {
|
|
2802
|
+
const hiPart = Math.fround(a);
|
|
2803
|
+
const loPart = a - hiPart;
|
|
2804
|
+
out[startIndex] = hiPart;
|
|
2805
|
+
out[startIndex + 1] = loPart;
|
|
2806
|
+
return out;
|
|
2807
|
+
}
|
|
2808
|
+
function fp64LowPart(a) {
|
|
2809
|
+
return a - Math.fround(a);
|
|
2810
|
+
}
|
|
2811
|
+
function fp64ifyMatrix4(matrix) {
|
|
2812
|
+
const matrixFP64 = new Float32Array(32);
|
|
2813
|
+
|
|
2814
|
+
for (let i = 0; i < 4; ++i) {
|
|
2815
|
+
for (let j = 0; j < 4; ++j) {
|
|
2816
|
+
const index = i * 4 + j;
|
|
2817
|
+
fp64ify(matrix[j * 4 + i], matrixFP64, index * 2);
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
return matrixFP64;
|
|
2822
|
+
}
|
|
2823
|
+
//# sourceMappingURL=fp64-utils.js.map
|
|
2824
|
+
|
|
2825
|
+
/***/ }),
|
|
2826
|
+
|
|
2827
|
+
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64.js":
|
|
2828
|
+
/*!***************************************************************************************************!*\
|
|
2829
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64.js ***!
|
|
2830
|
+
\***************************************************************************************************/
|
|
2831
|
+
/*! exports provided: fp64ify, fp64LowPart, fp64ifyMatrix4, fp64arithmetic, fp64 */
|
|
2832
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2833
|
+
|
|
2834
|
+
"use strict";
|
|
2835
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2836
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp64arithmetic", function() { return fp64arithmetic; });
|
|
2837
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fp64", function() { return fp64; });
|
|
2838
|
+
/* harmony import */ var _fp64_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fp64-utils */ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-utils.js");
|
|
2839
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fp64ify", function() { return _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ify"]; });
|
|
2840
|
+
|
|
2841
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fp64LowPart", function() { return _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64LowPart"]; });
|
|
2842
|
+
|
|
2843
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fp64ifyMatrix4", function() { return _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ifyMatrix4"]; });
|
|
2844
|
+
|
|
2845
|
+
/* harmony import */ var _fp64_arithmetic_glsl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fp64-arithmetic.glsl */ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-arithmetic.glsl.js");
|
|
2846
|
+
/* harmony import */ var _fp64_functions_glsl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fp64-functions.glsl */ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/fp64/fp64-functions.glsl.js");
|
|
2847
|
+
|
|
2848
|
+
|
|
2849
|
+
|
|
2850
|
+
const CONST_UNIFORMS = {
|
|
2851
|
+
ONE: 1.0
|
|
2852
|
+
};
|
|
2853
|
+
|
|
2854
|
+
|
|
2855
|
+
function getUniforms() {
|
|
2856
|
+
return CONST_UNIFORMS;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
const fp64arithmetic = {
|
|
2860
|
+
name: 'fp64-arithmetic',
|
|
2861
|
+
vs: _fp64_arithmetic_glsl__WEBPACK_IMPORTED_MODULE_1__["default"],
|
|
2862
|
+
fs: null,
|
|
2863
|
+
getUniforms,
|
|
2864
|
+
fp64ify: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ify"],
|
|
2865
|
+
fp64LowPart: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64LowPart"],
|
|
2866
|
+
fp64ifyMatrix4: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ifyMatrix4"]
|
|
2867
|
+
};
|
|
2868
|
+
const fp64 = {
|
|
2869
|
+
name: 'fp64',
|
|
2870
|
+
vs: _fp64_functions_glsl__WEBPACK_IMPORTED_MODULE_2__["default"],
|
|
2871
|
+
fs: null,
|
|
2872
|
+
dependencies: [fp64arithmetic],
|
|
2873
|
+
fp64ify: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ify"],
|
|
2874
|
+
fp64LowPart: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64LowPart"],
|
|
2875
|
+
fp64ifyMatrix4: _fp64_utils__WEBPACK_IMPORTED_MODULE_0__["fp64ifyMatrix4"]
|
|
2876
|
+
};
|
|
2877
|
+
//# sourceMappingURL=fp64.js.map
|
|
2878
|
+
|
|
2879
|
+
/***/ }),
|
|
2880
|
+
|
|
2881
|
+
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/fxaa/fxaa.js":
|
|
2882
|
+
/*!***************************************************************************************************!*\
|
|
2883
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/fxaa/fxaa.js ***!
|
|
2884
|
+
\***************************************************************************************************/
|
|
2885
|
+
/*! exports provided: fxaa */
|
|
2886
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1869
2887
|
|
|
1870
2888
|
"use strict";
|
|
1871
2889
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -1899,7 +2917,541 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1899
2917
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
1900
2918
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1901
2919
|
*/
|
|
1902
|
-
const fs = "\n#define FXAA_QUALITY_PRESET 29\n\n#if (FXAA_QUALITY_PRESET == 10)\n #define FXAA_QUALITY_PS 3\n #define FXAA_QUALITY_P0 1.5\n #define FXAA_QUALITY_P1 3.0\n #define FXAA_QUALITY_P2 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 11)\n #define FXAA_QUALITY_PS 4\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 3.0\n #define FXAA_QUALITY_P3 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 12)\n #define FXAA_QUALITY_PS 5\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 4.0\n #define FXAA_QUALITY_P4 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 13)\n #define FXAA_QUALITY_PS 6\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 4.0\n #define FXAA_QUALITY_P5 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 14)\n #define FXAA_QUALITY_PS 7\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 4.0\n #define FXAA_QUALITY_P6 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 15)\n #define FXAA_QUALITY_PS 8\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 4.0\n #define FXAA_QUALITY_P7 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 20)\n #define FXAA_QUALITY_PS 3\n #define FXAA_QUALITY_P0 1.5\n #define FXAA_QUALITY_P1 2.0\n #define FXAA_QUALITY_P2 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 21)\n #define FXAA_QUALITY_PS 4\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 22)\n #define FXAA_QUALITY_PS 5\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 23)\n #define FXAA_QUALITY_PS 6\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 24)\n #define FXAA_QUALITY_PS 7\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 3.0\n #define FXAA_QUALITY_P6 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 25)\n #define FXAA_QUALITY_PS 8\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 4.0\n #define FXAA_QUALITY_P7 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 26)\n #define FXAA_QUALITY_PS 9\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 4.0\n #define FXAA_QUALITY_P8 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 27)\n #define FXAA_QUALITY_PS 10\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 4.0\n #define FXAA_QUALITY_P9 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 28)\n #define FXAA_QUALITY_PS 11\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 2.0\n #define FXAA_QUALITY_P9 4.0\n #define FXAA_QUALITY_P10 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 29)\n #define FXAA_QUALITY_PS 12\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.5\n #define FXAA_QUALITY_P2 2.0\n #define FXAA_QUALITY_P3 2.0\n #define FXAA_QUALITY_P4 2.0\n #define FXAA_QUALITY_P5 2.0\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 2.0\n #define FXAA_QUALITY_P9 2.0\n #define FXAA_QUALITY_P10 4.0\n #define FXAA_QUALITY_P11 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 39)\n #define FXAA_QUALITY_PS 12\n #define FXAA_QUALITY_P0 1.0\n #define FXAA_QUALITY_P1 1.0\n #define FXAA_QUALITY_P2 1.0\n #define FXAA_QUALITY_P3 1.0\n #define FXAA_QUALITY_P4 1.0\n #define FXAA_QUALITY_P5 1.5\n #define FXAA_QUALITY_P6 2.0\n #define FXAA_QUALITY_P7 2.0\n #define FXAA_QUALITY_P8 2.0\n #define FXAA_QUALITY_P9 2.0\n #define FXAA_QUALITY_P10 4.0\n #define FXAA_QUALITY_P11 8.0\n#endif\n\n#define FxaaBool bool\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 vec2\n#define FxaaTex sampler2D\n\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTexTop(t, p) texture2D(t, p)\n#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\n\nFxaaFloat FxaaLuma_(FxaaFloat4 rgba) { return dot(rgba.rgb, vec3(0.2126, 0.7152, 0.0722)); }\n\nFxaaFloat4 FxaaPixelShader_(\n\n\n FxaaFloat2 pos,\n\n\n\n\n FxaaTex tex,\n\n\n\n\n FxaaFloat2 fxaaQualityRcpFrame,\n\n\n\n\n\n\n\n\n\n\n FxaaFloat fxaaQualitySubpix,\n\n\n\n\n\n\n\n\n\n FxaaFloat fxaaQualityEdgeThreshold,\n\n\n\n\n\n\n\n\n\n\n\n\n\n FxaaFloat fxaaQualityEdgeThresholdMin\n) {\n FxaaFloat2 posM;\n posM.x = pos.x;\n posM.y = pos.y;\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #define lumaM rgbyM.y\n FxaaFloat lumaS = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat maxSM = max(lumaS, lumaM);\n FxaaFloat minSM = min(lumaS, lumaM);\n FxaaFloat maxESM = max(lumaE, maxSM);\n FxaaFloat minESM = min(lumaE, minSM);\n FxaaFloat maxWN = max(lumaN, lumaW);\n FxaaFloat minWN = min(lumaN, lumaW);\n FxaaFloat rangeMax = max(maxWN, maxESM);\n FxaaFloat rangeMin = min(minWN, minESM);\n FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\n FxaaFloat range = rangeMax - rangeMin;\n FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\n FxaaBool earlyExit = range < rangeMaxClamped;\n if(earlyExit)\n return rgbyM;\n FxaaFloat lumaNW = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNS = lumaN + lumaS;\n FxaaFloat lumaWE = lumaW + lumaE;\n FxaaFloat subpixRcpRange = 1.0/range;\n FxaaFloat subpixNSWE = lumaNS + lumaWE;\n FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\n FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\n FxaaFloat lumaNESE = lumaNE + lumaSE;\n FxaaFloat lumaNWNE = lumaNW + lumaNE;\n FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\n FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\n FxaaFloat lumaNWSW = lumaNW + lumaSW;\n FxaaFloat lumaSWSE = lumaSW + lumaSE;\n FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\n FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\n FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\n FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\n FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\n FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\n FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\n FxaaFloat lengthSign = fxaaQualityRcpFrame.x;\n FxaaBool horzSpan = edgeHorz >= edgeVert;\n FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\n if(!horzSpan) lumaN = lumaW;\n if(!horzSpan) lumaS = lumaE;\n if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\n FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\n FxaaFloat gradientN = lumaN - lumaM;\n FxaaFloat gradientS = lumaS - lumaM;\n FxaaFloat lumaNN = lumaN + lumaM;\n FxaaFloat lumaSS = lumaS + lumaM;\n FxaaBool pairN = abs(gradientN) >= abs(gradientS);\n FxaaFloat gradient = max(abs(gradientN), abs(gradientS));\n if(pairN) lengthSign = -lengthSign;\n FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\n FxaaFloat2 posB;\n posB.x = posM.x;\n posB.y = posM.y;\n FxaaFloat2 offNP;\n offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n if(!horzSpan) posB.x += lengthSign * 0.5;\n if( horzSpan) posB.y += lengthSign * 0.5;\n FxaaFloat2 posN;\n posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\n posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\n FxaaFloat2 posP;\n posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\n posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\n FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\n FxaaFloat lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN));\n FxaaFloat subpixE = subpixC * subpixC;\n FxaaFloat lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP));\n if(!pairN) lumaNN = lumaSS;\n FxaaFloat gradientScaled = gradient * 1.0/4.0;\n FxaaFloat lumaMM = lumaM - lumaNN * 0.5;\n FxaaFloat subpixF = subpixD * subpixE;\n FxaaBool lumaMLTZero = lumaMM < 0.0;\n lumaEndN -= lumaNN * 0.5;\n lumaEndP -= lumaNN * 0.5;\n FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\n FxaaBool doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n #if (FXAA_QUALITY_PS > 3)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n #if (FXAA_QUALITY_PS > 4)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n #if (FXAA_QUALITY_PS > 5)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n #if (FXAA_QUALITY_PS > 6)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n #if (FXAA_QUALITY_PS > 7)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n #if (FXAA_QUALITY_PS > 8)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n #if (FXAA_QUALITY_PS > 9)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n #if (FXAA_QUALITY_PS > 10)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n #if (FXAA_QUALITY_PS > 11)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n #if (FXAA_QUALITY_PS > 12)\n if(doneNP) {\n if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));\n if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));\n if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\n if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\n doneNP = (!doneN) || (!doneP);\n if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\n if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n }\n #endif\n }\n #endif\n }\n #endif\n }\n #endif\n }\n #endif\n }\n #endif\n }\n #endif\n }\n #endif\n }\n #endif\n }\n #endif\n }\n FxaaFloat dstN = posM.x - posN.x;\n FxaaFloat dstP = posP.x - posM.x;\n if(!horzSpan) dstN = posM.y - posN.y;\n if(!horzSpan) dstP = posP.y - posM.y;\n FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\n FxaaFloat spanLength = (dstP + dstN);\n FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\n FxaaFloat spanLengthRcp = 1.0/spanLength;\n FxaaBool directionN = dstN < dstP;\n FxaaFloat dst = min(dstN, dstP);\n FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\n FxaaFloat subpixG = subpixF * subpixF;\n FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\n FxaaFloat subpixH = subpixG * fxaaQualitySubpix;\n FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\n FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\n if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\n if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\n return FxaaTexTop(tex, posM);\n}\n\nvec4 fxaa_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n const float fxaa_QualitySubpix = 0.5;\n const float fxaa_QualityEdgeThreshold = 0.125;\n const float fxaa_QualityEdgeThresholdMin = 0.0833;\n\n return FxaaPixelShader_(\n texCoord,\n texture,\n vec2(1.0) / texSize,\n fxaa_QualitySubpix,\n fxaa_QualityEdgeThreshold,\n fxaa_QualityEdgeThresholdMin\n );\n}\n";
|
|
2920
|
+
const fs = `
|
|
2921
|
+
#define FXAA_QUALITY_PRESET 29
|
|
2922
|
+
|
|
2923
|
+
#if (FXAA_QUALITY_PRESET == 10)
|
|
2924
|
+
#define FXAA_QUALITY_PS 3
|
|
2925
|
+
#define FXAA_QUALITY_P0 1.5
|
|
2926
|
+
#define FXAA_QUALITY_P1 3.0
|
|
2927
|
+
#define FXAA_QUALITY_P2 12.0
|
|
2928
|
+
#endif
|
|
2929
|
+
#if (FXAA_QUALITY_PRESET == 11)
|
|
2930
|
+
#define FXAA_QUALITY_PS 4
|
|
2931
|
+
#define FXAA_QUALITY_P0 1.0
|
|
2932
|
+
#define FXAA_QUALITY_P1 1.5
|
|
2933
|
+
#define FXAA_QUALITY_P2 3.0
|
|
2934
|
+
#define FXAA_QUALITY_P3 12.0
|
|
2935
|
+
#endif
|
|
2936
|
+
#if (FXAA_QUALITY_PRESET == 12)
|
|
2937
|
+
#define FXAA_QUALITY_PS 5
|
|
2938
|
+
#define FXAA_QUALITY_P0 1.0
|
|
2939
|
+
#define FXAA_QUALITY_P1 1.5
|
|
2940
|
+
#define FXAA_QUALITY_P2 2.0
|
|
2941
|
+
#define FXAA_QUALITY_P3 4.0
|
|
2942
|
+
#define FXAA_QUALITY_P4 12.0
|
|
2943
|
+
#endif
|
|
2944
|
+
#if (FXAA_QUALITY_PRESET == 13)
|
|
2945
|
+
#define FXAA_QUALITY_PS 6
|
|
2946
|
+
#define FXAA_QUALITY_P0 1.0
|
|
2947
|
+
#define FXAA_QUALITY_P1 1.5
|
|
2948
|
+
#define FXAA_QUALITY_P2 2.0
|
|
2949
|
+
#define FXAA_QUALITY_P3 2.0
|
|
2950
|
+
#define FXAA_QUALITY_P4 4.0
|
|
2951
|
+
#define FXAA_QUALITY_P5 12.0
|
|
2952
|
+
#endif
|
|
2953
|
+
#if (FXAA_QUALITY_PRESET == 14)
|
|
2954
|
+
#define FXAA_QUALITY_PS 7
|
|
2955
|
+
#define FXAA_QUALITY_P0 1.0
|
|
2956
|
+
#define FXAA_QUALITY_P1 1.5
|
|
2957
|
+
#define FXAA_QUALITY_P2 2.0
|
|
2958
|
+
#define FXAA_QUALITY_P3 2.0
|
|
2959
|
+
#define FXAA_QUALITY_P4 2.0
|
|
2960
|
+
#define FXAA_QUALITY_P5 4.0
|
|
2961
|
+
#define FXAA_QUALITY_P6 12.0
|
|
2962
|
+
#endif
|
|
2963
|
+
#if (FXAA_QUALITY_PRESET == 15)
|
|
2964
|
+
#define FXAA_QUALITY_PS 8
|
|
2965
|
+
#define FXAA_QUALITY_P0 1.0
|
|
2966
|
+
#define FXAA_QUALITY_P1 1.5
|
|
2967
|
+
#define FXAA_QUALITY_P2 2.0
|
|
2968
|
+
#define FXAA_QUALITY_P3 2.0
|
|
2969
|
+
#define FXAA_QUALITY_P4 2.0
|
|
2970
|
+
#define FXAA_QUALITY_P5 2.0
|
|
2971
|
+
#define FXAA_QUALITY_P6 4.0
|
|
2972
|
+
#define FXAA_QUALITY_P7 12.0
|
|
2973
|
+
#endif
|
|
2974
|
+
#if (FXAA_QUALITY_PRESET == 20)
|
|
2975
|
+
#define FXAA_QUALITY_PS 3
|
|
2976
|
+
#define FXAA_QUALITY_P0 1.5
|
|
2977
|
+
#define FXAA_QUALITY_P1 2.0
|
|
2978
|
+
#define FXAA_QUALITY_P2 8.0
|
|
2979
|
+
#endif
|
|
2980
|
+
#if (FXAA_QUALITY_PRESET == 21)
|
|
2981
|
+
#define FXAA_QUALITY_PS 4
|
|
2982
|
+
#define FXAA_QUALITY_P0 1.0
|
|
2983
|
+
#define FXAA_QUALITY_P1 1.5
|
|
2984
|
+
#define FXAA_QUALITY_P2 2.0
|
|
2985
|
+
#define FXAA_QUALITY_P3 8.0
|
|
2986
|
+
#endif
|
|
2987
|
+
#if (FXAA_QUALITY_PRESET == 22)
|
|
2988
|
+
#define FXAA_QUALITY_PS 5
|
|
2989
|
+
#define FXAA_QUALITY_P0 1.0
|
|
2990
|
+
#define FXAA_QUALITY_P1 1.5
|
|
2991
|
+
#define FXAA_QUALITY_P2 2.0
|
|
2992
|
+
#define FXAA_QUALITY_P3 2.0
|
|
2993
|
+
#define FXAA_QUALITY_P4 8.0
|
|
2994
|
+
#endif
|
|
2995
|
+
#if (FXAA_QUALITY_PRESET == 23)
|
|
2996
|
+
#define FXAA_QUALITY_PS 6
|
|
2997
|
+
#define FXAA_QUALITY_P0 1.0
|
|
2998
|
+
#define FXAA_QUALITY_P1 1.5
|
|
2999
|
+
#define FXAA_QUALITY_P2 2.0
|
|
3000
|
+
#define FXAA_QUALITY_P3 2.0
|
|
3001
|
+
#define FXAA_QUALITY_P4 2.0
|
|
3002
|
+
#define FXAA_QUALITY_P5 8.0
|
|
3003
|
+
#endif
|
|
3004
|
+
#if (FXAA_QUALITY_PRESET == 24)
|
|
3005
|
+
#define FXAA_QUALITY_PS 7
|
|
3006
|
+
#define FXAA_QUALITY_P0 1.0
|
|
3007
|
+
#define FXAA_QUALITY_P1 1.5
|
|
3008
|
+
#define FXAA_QUALITY_P2 2.0
|
|
3009
|
+
#define FXAA_QUALITY_P3 2.0
|
|
3010
|
+
#define FXAA_QUALITY_P4 2.0
|
|
3011
|
+
#define FXAA_QUALITY_P5 3.0
|
|
3012
|
+
#define FXAA_QUALITY_P6 8.0
|
|
3013
|
+
#endif
|
|
3014
|
+
#if (FXAA_QUALITY_PRESET == 25)
|
|
3015
|
+
#define FXAA_QUALITY_PS 8
|
|
3016
|
+
#define FXAA_QUALITY_P0 1.0
|
|
3017
|
+
#define FXAA_QUALITY_P1 1.5
|
|
3018
|
+
#define FXAA_QUALITY_P2 2.0
|
|
3019
|
+
#define FXAA_QUALITY_P3 2.0
|
|
3020
|
+
#define FXAA_QUALITY_P4 2.0
|
|
3021
|
+
#define FXAA_QUALITY_P5 2.0
|
|
3022
|
+
#define FXAA_QUALITY_P6 4.0
|
|
3023
|
+
#define FXAA_QUALITY_P7 8.0
|
|
3024
|
+
#endif
|
|
3025
|
+
#if (FXAA_QUALITY_PRESET == 26)
|
|
3026
|
+
#define FXAA_QUALITY_PS 9
|
|
3027
|
+
#define FXAA_QUALITY_P0 1.0
|
|
3028
|
+
#define FXAA_QUALITY_P1 1.5
|
|
3029
|
+
#define FXAA_QUALITY_P2 2.0
|
|
3030
|
+
#define FXAA_QUALITY_P3 2.0
|
|
3031
|
+
#define FXAA_QUALITY_P4 2.0
|
|
3032
|
+
#define FXAA_QUALITY_P5 2.0
|
|
3033
|
+
#define FXAA_QUALITY_P6 2.0
|
|
3034
|
+
#define FXAA_QUALITY_P7 4.0
|
|
3035
|
+
#define FXAA_QUALITY_P8 8.0
|
|
3036
|
+
#endif
|
|
3037
|
+
#if (FXAA_QUALITY_PRESET == 27)
|
|
3038
|
+
#define FXAA_QUALITY_PS 10
|
|
3039
|
+
#define FXAA_QUALITY_P0 1.0
|
|
3040
|
+
#define FXAA_QUALITY_P1 1.5
|
|
3041
|
+
#define FXAA_QUALITY_P2 2.0
|
|
3042
|
+
#define FXAA_QUALITY_P3 2.0
|
|
3043
|
+
#define FXAA_QUALITY_P4 2.0
|
|
3044
|
+
#define FXAA_QUALITY_P5 2.0
|
|
3045
|
+
#define FXAA_QUALITY_P6 2.0
|
|
3046
|
+
#define FXAA_QUALITY_P7 2.0
|
|
3047
|
+
#define FXAA_QUALITY_P8 4.0
|
|
3048
|
+
#define FXAA_QUALITY_P9 8.0
|
|
3049
|
+
#endif
|
|
3050
|
+
#if (FXAA_QUALITY_PRESET == 28)
|
|
3051
|
+
#define FXAA_QUALITY_PS 11
|
|
3052
|
+
#define FXAA_QUALITY_P0 1.0
|
|
3053
|
+
#define FXAA_QUALITY_P1 1.5
|
|
3054
|
+
#define FXAA_QUALITY_P2 2.0
|
|
3055
|
+
#define FXAA_QUALITY_P3 2.0
|
|
3056
|
+
#define FXAA_QUALITY_P4 2.0
|
|
3057
|
+
#define FXAA_QUALITY_P5 2.0
|
|
3058
|
+
#define FXAA_QUALITY_P6 2.0
|
|
3059
|
+
#define FXAA_QUALITY_P7 2.0
|
|
3060
|
+
#define FXAA_QUALITY_P8 2.0
|
|
3061
|
+
#define FXAA_QUALITY_P9 4.0
|
|
3062
|
+
#define FXAA_QUALITY_P10 8.0
|
|
3063
|
+
#endif
|
|
3064
|
+
#if (FXAA_QUALITY_PRESET == 29)
|
|
3065
|
+
#define FXAA_QUALITY_PS 12
|
|
3066
|
+
#define FXAA_QUALITY_P0 1.0
|
|
3067
|
+
#define FXAA_QUALITY_P1 1.5
|
|
3068
|
+
#define FXAA_QUALITY_P2 2.0
|
|
3069
|
+
#define FXAA_QUALITY_P3 2.0
|
|
3070
|
+
#define FXAA_QUALITY_P4 2.0
|
|
3071
|
+
#define FXAA_QUALITY_P5 2.0
|
|
3072
|
+
#define FXAA_QUALITY_P6 2.0
|
|
3073
|
+
#define FXAA_QUALITY_P7 2.0
|
|
3074
|
+
#define FXAA_QUALITY_P8 2.0
|
|
3075
|
+
#define FXAA_QUALITY_P9 2.0
|
|
3076
|
+
#define FXAA_QUALITY_P10 4.0
|
|
3077
|
+
#define FXAA_QUALITY_P11 8.0
|
|
3078
|
+
#endif
|
|
3079
|
+
#if (FXAA_QUALITY_PRESET == 39)
|
|
3080
|
+
#define FXAA_QUALITY_PS 12
|
|
3081
|
+
#define FXAA_QUALITY_P0 1.0
|
|
3082
|
+
#define FXAA_QUALITY_P1 1.0
|
|
3083
|
+
#define FXAA_QUALITY_P2 1.0
|
|
3084
|
+
#define FXAA_QUALITY_P3 1.0
|
|
3085
|
+
#define FXAA_QUALITY_P4 1.0
|
|
3086
|
+
#define FXAA_QUALITY_P5 1.5
|
|
3087
|
+
#define FXAA_QUALITY_P6 2.0
|
|
3088
|
+
#define FXAA_QUALITY_P7 2.0
|
|
3089
|
+
#define FXAA_QUALITY_P8 2.0
|
|
3090
|
+
#define FXAA_QUALITY_P9 2.0
|
|
3091
|
+
#define FXAA_QUALITY_P10 4.0
|
|
3092
|
+
#define FXAA_QUALITY_P11 8.0
|
|
3093
|
+
#endif
|
|
3094
|
+
|
|
3095
|
+
#define FxaaBool bool
|
|
3096
|
+
#define FxaaFloat float
|
|
3097
|
+
#define FxaaFloat2 vec2
|
|
3098
|
+
#define FxaaFloat3 vec3
|
|
3099
|
+
#define FxaaFloat4 vec4
|
|
3100
|
+
#define FxaaHalf float
|
|
3101
|
+
#define FxaaHalf2 vec2
|
|
3102
|
+
#define FxaaHalf3 vec3
|
|
3103
|
+
#define FxaaHalf4 vec4
|
|
3104
|
+
#define FxaaInt2 vec2
|
|
3105
|
+
#define FxaaTex sampler2D
|
|
3106
|
+
|
|
3107
|
+
#define FxaaSat(x) clamp(x, 0.0, 1.0)
|
|
3108
|
+
#define FxaaTexTop(t, p) texture2D(t, p)
|
|
3109
|
+
#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))
|
|
3110
|
+
|
|
3111
|
+
FxaaFloat FxaaLuma_(FxaaFloat4 rgba) { return dot(rgba.rgb, vec3(0.2126, 0.7152, 0.0722)); }
|
|
3112
|
+
|
|
3113
|
+
FxaaFloat4 FxaaPixelShader_(
|
|
3114
|
+
|
|
3115
|
+
|
|
3116
|
+
FxaaFloat2 pos,
|
|
3117
|
+
|
|
3118
|
+
|
|
3119
|
+
|
|
3120
|
+
|
|
3121
|
+
FxaaTex tex,
|
|
3122
|
+
|
|
3123
|
+
|
|
3124
|
+
|
|
3125
|
+
|
|
3126
|
+
FxaaFloat2 fxaaQualityRcpFrame,
|
|
3127
|
+
|
|
3128
|
+
|
|
3129
|
+
|
|
3130
|
+
|
|
3131
|
+
|
|
3132
|
+
|
|
3133
|
+
|
|
3134
|
+
|
|
3135
|
+
|
|
3136
|
+
|
|
3137
|
+
FxaaFloat fxaaQualitySubpix,
|
|
3138
|
+
|
|
3139
|
+
|
|
3140
|
+
|
|
3141
|
+
|
|
3142
|
+
|
|
3143
|
+
|
|
3144
|
+
|
|
3145
|
+
|
|
3146
|
+
|
|
3147
|
+
FxaaFloat fxaaQualityEdgeThreshold,
|
|
3148
|
+
|
|
3149
|
+
|
|
3150
|
+
|
|
3151
|
+
|
|
3152
|
+
|
|
3153
|
+
|
|
3154
|
+
|
|
3155
|
+
|
|
3156
|
+
|
|
3157
|
+
|
|
3158
|
+
|
|
3159
|
+
|
|
3160
|
+
|
|
3161
|
+
FxaaFloat fxaaQualityEdgeThresholdMin
|
|
3162
|
+
) {
|
|
3163
|
+
FxaaFloat2 posM;
|
|
3164
|
+
posM.x = pos.x;
|
|
3165
|
+
posM.y = pos.y;
|
|
3166
|
+
FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
|
|
3167
|
+
#define lumaM rgbyM.y
|
|
3168
|
+
FxaaFloat lumaS = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
|
|
3169
|
+
FxaaFloat lumaE = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
|
|
3170
|
+
FxaaFloat lumaN = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
|
|
3171
|
+
FxaaFloat lumaW = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
|
|
3172
|
+
FxaaFloat maxSM = max(lumaS, lumaM);
|
|
3173
|
+
FxaaFloat minSM = min(lumaS, lumaM);
|
|
3174
|
+
FxaaFloat maxESM = max(lumaE, maxSM);
|
|
3175
|
+
FxaaFloat minESM = min(lumaE, minSM);
|
|
3176
|
+
FxaaFloat maxWN = max(lumaN, lumaW);
|
|
3177
|
+
FxaaFloat minWN = min(lumaN, lumaW);
|
|
3178
|
+
FxaaFloat rangeMax = max(maxWN, maxESM);
|
|
3179
|
+
FxaaFloat rangeMin = min(minWN, minESM);
|
|
3180
|
+
FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
|
|
3181
|
+
FxaaFloat range = rangeMax - rangeMin;
|
|
3182
|
+
FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
|
|
3183
|
+
FxaaBool earlyExit = range < rangeMaxClamped;
|
|
3184
|
+
if(earlyExit)
|
|
3185
|
+
return rgbyM;
|
|
3186
|
+
FxaaFloat lumaNW = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
|
|
3187
|
+
FxaaFloat lumaSE = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
|
|
3188
|
+
FxaaFloat lumaNE = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
|
|
3189
|
+
FxaaFloat lumaSW = FxaaLuma_(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
|
|
3190
|
+
FxaaFloat lumaNS = lumaN + lumaS;
|
|
3191
|
+
FxaaFloat lumaWE = lumaW + lumaE;
|
|
3192
|
+
FxaaFloat subpixRcpRange = 1.0/range;
|
|
3193
|
+
FxaaFloat subpixNSWE = lumaNS + lumaWE;
|
|
3194
|
+
FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
|
|
3195
|
+
FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
|
|
3196
|
+
FxaaFloat lumaNESE = lumaNE + lumaSE;
|
|
3197
|
+
FxaaFloat lumaNWNE = lumaNW + lumaNE;
|
|
3198
|
+
FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
|
|
3199
|
+
FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
|
|
3200
|
+
FxaaFloat lumaNWSW = lumaNW + lumaSW;
|
|
3201
|
+
FxaaFloat lumaSWSE = lumaSW + lumaSE;
|
|
3202
|
+
FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
|
|
3203
|
+
FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
|
|
3204
|
+
FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
|
|
3205
|
+
FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
|
|
3206
|
+
FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
|
|
3207
|
+
FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
|
|
3208
|
+
FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
|
|
3209
|
+
FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
|
|
3210
|
+
FxaaBool horzSpan = edgeHorz >= edgeVert;
|
|
3211
|
+
FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
|
|
3212
|
+
if(!horzSpan) lumaN = lumaW;
|
|
3213
|
+
if(!horzSpan) lumaS = lumaE;
|
|
3214
|
+
if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
|
|
3215
|
+
FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
|
|
3216
|
+
FxaaFloat gradientN = lumaN - lumaM;
|
|
3217
|
+
FxaaFloat gradientS = lumaS - lumaM;
|
|
3218
|
+
FxaaFloat lumaNN = lumaN + lumaM;
|
|
3219
|
+
FxaaFloat lumaSS = lumaS + lumaM;
|
|
3220
|
+
FxaaBool pairN = abs(gradientN) >= abs(gradientS);
|
|
3221
|
+
FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
|
|
3222
|
+
if(pairN) lengthSign = -lengthSign;
|
|
3223
|
+
FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
|
|
3224
|
+
FxaaFloat2 posB;
|
|
3225
|
+
posB.x = posM.x;
|
|
3226
|
+
posB.y = posM.y;
|
|
3227
|
+
FxaaFloat2 offNP;
|
|
3228
|
+
offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
|
|
3229
|
+
offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
|
|
3230
|
+
if(!horzSpan) posB.x += lengthSign * 0.5;
|
|
3231
|
+
if( horzSpan) posB.y += lengthSign * 0.5;
|
|
3232
|
+
FxaaFloat2 posN;
|
|
3233
|
+
posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
|
|
3234
|
+
posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
|
|
3235
|
+
FxaaFloat2 posP;
|
|
3236
|
+
posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
|
|
3237
|
+
posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
|
|
3238
|
+
FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
|
|
3239
|
+
FxaaFloat lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN));
|
|
3240
|
+
FxaaFloat subpixE = subpixC * subpixC;
|
|
3241
|
+
FxaaFloat lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP));
|
|
3242
|
+
if(!pairN) lumaNN = lumaSS;
|
|
3243
|
+
FxaaFloat gradientScaled = gradient * 1.0/4.0;
|
|
3244
|
+
FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
|
|
3245
|
+
FxaaFloat subpixF = subpixD * subpixE;
|
|
3246
|
+
FxaaBool lumaMLTZero = lumaMM < 0.0;
|
|
3247
|
+
lumaEndN -= lumaNN * 0.5;
|
|
3248
|
+
lumaEndP -= lumaNN * 0.5;
|
|
3249
|
+
FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
|
|
3250
|
+
FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
|
|
3251
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
|
|
3252
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
|
|
3253
|
+
FxaaBool doneNP = (!doneN) || (!doneP);
|
|
3254
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
|
|
3255
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
|
|
3256
|
+
if(doneNP) {
|
|
3257
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3258
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3259
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3260
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3261
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3262
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3263
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
|
|
3264
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
|
|
3265
|
+
doneNP = (!doneN) || (!doneP);
|
|
3266
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
|
|
3267
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
|
|
3268
|
+
#if (FXAA_QUALITY_PS > 3)
|
|
3269
|
+
if(doneNP) {
|
|
3270
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3271
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3272
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3273
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3274
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3275
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3276
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
|
|
3277
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
|
|
3278
|
+
doneNP = (!doneN) || (!doneP);
|
|
3279
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
|
|
3280
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
|
|
3281
|
+
#if (FXAA_QUALITY_PS > 4)
|
|
3282
|
+
if(doneNP) {
|
|
3283
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3284
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3285
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3286
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3287
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3288
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3289
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
|
|
3290
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
|
|
3291
|
+
doneNP = (!doneN) || (!doneP);
|
|
3292
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
|
|
3293
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
|
|
3294
|
+
#if (FXAA_QUALITY_PS > 5)
|
|
3295
|
+
if(doneNP) {
|
|
3296
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3297
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3298
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3299
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3300
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3301
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3302
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
|
|
3303
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
|
|
3304
|
+
doneNP = (!doneN) || (!doneP);
|
|
3305
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
|
|
3306
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
|
|
3307
|
+
#if (FXAA_QUALITY_PS > 6)
|
|
3308
|
+
if(doneNP) {
|
|
3309
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3310
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3311
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3312
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3313
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3314
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3315
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
|
|
3316
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
|
|
3317
|
+
doneNP = (!doneN) || (!doneP);
|
|
3318
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
|
|
3319
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
|
|
3320
|
+
#if (FXAA_QUALITY_PS > 7)
|
|
3321
|
+
if(doneNP) {
|
|
3322
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3323
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3324
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3325
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3326
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3327
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3328
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
|
|
3329
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
|
|
3330
|
+
doneNP = (!doneN) || (!doneP);
|
|
3331
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
|
|
3332
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
|
|
3333
|
+
#if (FXAA_QUALITY_PS > 8)
|
|
3334
|
+
if(doneNP) {
|
|
3335
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3336
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3337
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3338
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3339
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3340
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3341
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
|
|
3342
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
|
|
3343
|
+
doneNP = (!doneN) || (!doneP);
|
|
3344
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
|
|
3345
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
|
|
3346
|
+
#if (FXAA_QUALITY_PS > 9)
|
|
3347
|
+
if(doneNP) {
|
|
3348
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3349
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3350
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3351
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3352
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3353
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3354
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
|
|
3355
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
|
|
3356
|
+
doneNP = (!doneN) || (!doneP);
|
|
3357
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
|
|
3358
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
|
|
3359
|
+
#if (FXAA_QUALITY_PS > 10)
|
|
3360
|
+
if(doneNP) {
|
|
3361
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3362
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3363
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3364
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3365
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3366
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3367
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
|
|
3368
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
|
|
3369
|
+
doneNP = (!doneN) || (!doneP);
|
|
3370
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
|
|
3371
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
|
|
3372
|
+
#if (FXAA_QUALITY_PS > 11)
|
|
3373
|
+
if(doneNP) {
|
|
3374
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3375
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3376
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3377
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3378
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3379
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3380
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
|
|
3381
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
|
|
3382
|
+
doneNP = (!doneN) || (!doneP);
|
|
3383
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
|
|
3384
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
|
|
3385
|
+
#if (FXAA_QUALITY_PS > 12)
|
|
3386
|
+
if(doneNP) {
|
|
3387
|
+
if(!doneN) lumaEndN = FxaaLuma_(FxaaTexTop(tex, posN.xy));
|
|
3388
|
+
if(!doneP) lumaEndP = FxaaLuma_(FxaaTexTop(tex, posP.xy));
|
|
3389
|
+
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
3390
|
+
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
3391
|
+
doneN = abs(lumaEndN) >= gradientScaled;
|
|
3392
|
+
doneP = abs(lumaEndP) >= gradientScaled;
|
|
3393
|
+
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
|
|
3394
|
+
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
|
|
3395
|
+
doneNP = (!doneN) || (!doneP);
|
|
3396
|
+
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
|
|
3397
|
+
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
|
|
3398
|
+
}
|
|
3399
|
+
#endif
|
|
3400
|
+
}
|
|
3401
|
+
#endif
|
|
3402
|
+
}
|
|
3403
|
+
#endif
|
|
3404
|
+
}
|
|
3405
|
+
#endif
|
|
3406
|
+
}
|
|
3407
|
+
#endif
|
|
3408
|
+
}
|
|
3409
|
+
#endif
|
|
3410
|
+
}
|
|
3411
|
+
#endif
|
|
3412
|
+
}
|
|
3413
|
+
#endif
|
|
3414
|
+
}
|
|
3415
|
+
#endif
|
|
3416
|
+
}
|
|
3417
|
+
#endif
|
|
3418
|
+
}
|
|
3419
|
+
FxaaFloat dstN = posM.x - posN.x;
|
|
3420
|
+
FxaaFloat dstP = posP.x - posM.x;
|
|
3421
|
+
if(!horzSpan) dstN = posM.y - posN.y;
|
|
3422
|
+
if(!horzSpan) dstP = posP.y - posM.y;
|
|
3423
|
+
FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
|
|
3424
|
+
FxaaFloat spanLength = (dstP + dstN);
|
|
3425
|
+
FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
|
|
3426
|
+
FxaaFloat spanLengthRcp = 1.0/spanLength;
|
|
3427
|
+
FxaaBool directionN = dstN < dstP;
|
|
3428
|
+
FxaaFloat dst = min(dstN, dstP);
|
|
3429
|
+
FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
|
|
3430
|
+
FxaaFloat subpixG = subpixF * subpixF;
|
|
3431
|
+
FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
|
|
3432
|
+
FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
|
|
3433
|
+
FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
|
|
3434
|
+
FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
|
|
3435
|
+
if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
|
|
3436
|
+
if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
|
|
3437
|
+
return FxaaTexTop(tex, posM);
|
|
3438
|
+
}
|
|
3439
|
+
|
|
3440
|
+
vec4 fxaa_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
3441
|
+
const float fxaa_QualitySubpix = 0.5;
|
|
3442
|
+
const float fxaa_QualityEdgeThreshold = 0.125;
|
|
3443
|
+
const float fxaa_QualityEdgeThresholdMin = 0.0833;
|
|
3444
|
+
|
|
3445
|
+
return FxaaPixelShader_(
|
|
3446
|
+
texCoord,
|
|
3447
|
+
texture,
|
|
3448
|
+
vec2(1.0) / texSize,
|
|
3449
|
+
fxaa_QualitySubpix,
|
|
3450
|
+
fxaa_QualityEdgeThreshold,
|
|
3451
|
+
fxaa_QualityEdgeThresholdMin
|
|
3452
|
+
);
|
|
3453
|
+
}
|
|
3454
|
+
`;
|
|
1903
3455
|
const fxaa = {
|
|
1904
3456
|
name: 'fxaa',
|
|
1905
3457
|
uniforms: {},
|
|
@@ -1913,16 +3465,33 @@ const fxaa = {
|
|
|
1913
3465
|
/***/ }),
|
|
1914
3466
|
|
|
1915
3467
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/brightnesscontrast.js":
|
|
1916
|
-
|
|
1917
|
-
!*** /Users/
|
|
1918
|
-
|
|
3468
|
+
/*!*********************************************************************************************************************************!*\
|
|
3469
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/brightnesscontrast.js ***!
|
|
3470
|
+
\*********************************************************************************************************************************/
|
|
1919
3471
|
/*! exports provided: brightnessContrast */
|
|
1920
3472
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1921
3473
|
|
|
1922
3474
|
"use strict";
|
|
1923
3475
|
__webpack_require__.r(__webpack_exports__);
|
|
1924
3476
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "brightnessContrast", function() { return brightnessContrast; });
|
|
1925
|
-
const fs =
|
|
3477
|
+
const fs = `\
|
|
3478
|
+
uniform float brightness;
|
|
3479
|
+
uniform float contrast;
|
|
3480
|
+
|
|
3481
|
+
vec4 brightnessContrast_filterColor(vec4 color) {
|
|
3482
|
+
color.rgb += brightness;
|
|
3483
|
+
if (contrast > 0.0) {
|
|
3484
|
+
color.rgb = (color.rgb - 0.5) / (1.0 - contrast) + 0.5;
|
|
3485
|
+
} else {
|
|
3486
|
+
color.rgb = (color.rgb - 0.5) * (1.0 + contrast) + 0.5;
|
|
3487
|
+
}
|
|
3488
|
+
return color;
|
|
3489
|
+
}
|
|
3490
|
+
|
|
3491
|
+
vec4 brightnessContrast_filterColor(vec4 color, vec2 texSize, vec2 texCoords) {
|
|
3492
|
+
return brightnessContrast_filterColor(color);
|
|
3493
|
+
}
|
|
3494
|
+
`;
|
|
1926
3495
|
const uniforms = {
|
|
1927
3496
|
brightness: {
|
|
1928
3497
|
value: 0,
|
|
@@ -1948,16 +3517,37 @@ const brightnessContrast = {
|
|
|
1948
3517
|
/***/ }),
|
|
1949
3518
|
|
|
1950
3519
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/denoise.js":
|
|
1951
|
-
|
|
1952
|
-
!*** /Users/
|
|
1953
|
-
|
|
3520
|
+
/*!**********************************************************************************************************************!*\
|
|
3521
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/denoise.js ***!
|
|
3522
|
+
\**********************************************************************************************************************/
|
|
1954
3523
|
/*! exports provided: denoise */
|
|
1955
3524
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1956
3525
|
|
|
1957
3526
|
"use strict";
|
|
1958
3527
|
__webpack_require__.r(__webpack_exports__);
|
|
1959
3528
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "denoise", function() { return denoise; });
|
|
1960
|
-
const fs =
|
|
3529
|
+
const fs = `\
|
|
3530
|
+
uniform float strength;
|
|
3531
|
+
|
|
3532
|
+
vec4 denoise_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
3533
|
+
float adjustedExponent = 3. + 200. * pow(1. - strength, 4.);
|
|
3534
|
+
|
|
3535
|
+
vec4 center = texture2D(texture, texCoord);
|
|
3536
|
+
vec4 color = vec4(0.0);
|
|
3537
|
+
float total = 0.0;
|
|
3538
|
+
for (float x = -4.0; x <= 4.0; x += 1.0) {
|
|
3539
|
+
for (float y = -4.0; y <= 4.0; y += 1.0) {
|
|
3540
|
+
vec4 sample = texture2D(texture, texCoord + vec2(x, y) / texSize);
|
|
3541
|
+
float weight = 1.0 - abs(dot(sample.rgb - center.rgb, vec3(0.25)));
|
|
3542
|
+
weight = pow(weight, adjustedExponent);
|
|
3543
|
+
color += sample * weight;
|
|
3544
|
+
total += weight;
|
|
3545
|
+
}
|
|
3546
|
+
}
|
|
3547
|
+
|
|
3548
|
+
return color / total;
|
|
3549
|
+
}
|
|
3550
|
+
`;
|
|
1961
3551
|
const uniforms = {
|
|
1962
3552
|
strength: {
|
|
1963
3553
|
value: 0.5,
|
|
@@ -1981,16 +3571,43 @@ const denoise = {
|
|
|
1981
3571
|
/***/ }),
|
|
1982
3572
|
|
|
1983
3573
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/huesaturation.js":
|
|
1984
|
-
|
|
1985
|
-
!*** /Users/
|
|
1986
|
-
|
|
3574
|
+
/*!****************************************************************************************************************************!*\
|
|
3575
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/huesaturation.js ***!
|
|
3576
|
+
\****************************************************************************************************************************/
|
|
1987
3577
|
/*! exports provided: hueSaturation */
|
|
1988
3578
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1989
3579
|
|
|
1990
3580
|
"use strict";
|
|
1991
3581
|
__webpack_require__.r(__webpack_exports__);
|
|
1992
3582
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hueSaturation", function() { return hueSaturation; });
|
|
1993
|
-
const fs =
|
|
3583
|
+
const fs = `\
|
|
3584
|
+
uniform float hue;
|
|
3585
|
+
uniform float saturation;
|
|
3586
|
+
|
|
3587
|
+
vec4 hueSaturation_filterColor(vec4 color) {
|
|
3588
|
+
float angle = hue * 3.14159265;
|
|
3589
|
+
float s = sin(angle), c = cos(angle);
|
|
3590
|
+
vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;
|
|
3591
|
+
float len = length(color.rgb);
|
|
3592
|
+
color.rgb = vec3(
|
|
3593
|
+
dot(color.rgb, weights.xyz),
|
|
3594
|
+
dot(color.rgb, weights.zxy),
|
|
3595
|
+
dot(color.rgb, weights.yzx)
|
|
3596
|
+
);
|
|
3597
|
+
float average = (color.r + color.g + color.b) / 3.0;
|
|
3598
|
+
if (saturation > 0.0) {
|
|
3599
|
+
color.rgb += (average - color.rgb) * (1.0 - 1.0 / (1.001 - saturation));
|
|
3600
|
+
} else {
|
|
3601
|
+
color.rgb += (average - color.rgb) * (-saturation);
|
|
3602
|
+
}
|
|
3603
|
+
|
|
3604
|
+
return color;
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
vec4 hueSaturation_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
3608
|
+
return hueSaturation_filterColor(color);
|
|
3609
|
+
}
|
|
3610
|
+
`;
|
|
1994
3611
|
const uniforms = {
|
|
1995
3612
|
hue: {
|
|
1996
3613
|
value: 0,
|
|
@@ -2016,16 +3633,34 @@ const hueSaturation = {
|
|
|
2016
3633
|
/***/ }),
|
|
2017
3634
|
|
|
2018
3635
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/noise.js":
|
|
2019
|
-
|
|
2020
|
-
!*** /Users/
|
|
2021
|
-
|
|
3636
|
+
/*!********************************************************************************************************************!*\
|
|
3637
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/noise.js ***!
|
|
3638
|
+
\********************************************************************************************************************/
|
|
2022
3639
|
/*! exports provided: noise */
|
|
2023
3640
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2024
3641
|
|
|
2025
3642
|
"use strict";
|
|
2026
3643
|
__webpack_require__.r(__webpack_exports__);
|
|
2027
3644
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "noise", function() { return noise; });
|
|
2028
|
-
const fs =
|
|
3645
|
+
const fs = `\
|
|
3646
|
+
uniform float amount;
|
|
3647
|
+
|
|
3648
|
+
float rand(vec2 co) {
|
|
3649
|
+
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3652
|
+
vec4 noise_filterColor(vec4 color, vec2 texCoord) {
|
|
3653
|
+
float diff = (rand(texCoord) - 0.5) * amount;
|
|
3654
|
+
color.r += diff;
|
|
3655
|
+
color.g += diff;
|
|
3656
|
+
color.b += diff;
|
|
3657
|
+
return color;
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
vec4 noise_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
3661
|
+
return noise_filterColor(color, texCoord);
|
|
3662
|
+
}
|
|
3663
|
+
`;
|
|
2029
3664
|
const uniforms = {
|
|
2030
3665
|
amount: {
|
|
2031
3666
|
value: 0.5,
|
|
@@ -2046,16 +3681,35 @@ const noise = {
|
|
|
2046
3681
|
/***/ }),
|
|
2047
3682
|
|
|
2048
3683
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/sepia.js":
|
|
2049
|
-
|
|
2050
|
-
!*** /Users/
|
|
2051
|
-
|
|
3684
|
+
/*!********************************************************************************************************************!*\
|
|
3685
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/sepia.js ***!
|
|
3686
|
+
\********************************************************************************************************************/
|
|
2052
3687
|
/*! exports provided: sepia */
|
|
2053
3688
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2054
3689
|
|
|
2055
3690
|
"use strict";
|
|
2056
3691
|
__webpack_require__.r(__webpack_exports__);
|
|
2057
3692
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sepia", function() { return sepia; });
|
|
2058
|
-
const fs =
|
|
3693
|
+
const fs = `\
|
|
3694
|
+
uniform float amount;
|
|
3695
|
+
|
|
3696
|
+
vec4 sepia_filterColor(vec4 color) {
|
|
3697
|
+
float r = color.r;
|
|
3698
|
+
float g = color.g;
|
|
3699
|
+
float b = color.b;
|
|
3700
|
+
|
|
3701
|
+
color.r =
|
|
3702
|
+
min(1.0, (r * (1.0 - (0.607 * amount))) + (g * (0.769 * amount)) + (b * (0.189 * amount)));
|
|
3703
|
+
color.g = min(1.0, (r * 0.349 * amount) + (g * (1.0 - (0.314 * amount))) + (b * 0.168 * amount));
|
|
3704
|
+
color.b = min(1.0, (r * 0.272 * amount) + (g * 0.534 * amount) + (b * (1.0 - (0.869 * amount))));
|
|
3705
|
+
|
|
3706
|
+
return color;
|
|
3707
|
+
}
|
|
3708
|
+
|
|
3709
|
+
vec4 sepia_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
3710
|
+
return sepia_filterColor(color);
|
|
3711
|
+
}
|
|
3712
|
+
`;
|
|
2059
3713
|
const uniforms = {
|
|
2060
3714
|
amount: {
|
|
2061
3715
|
value: 0.5,
|
|
@@ -2076,16 +3730,30 @@ const sepia = {
|
|
|
2076
3730
|
/***/ }),
|
|
2077
3731
|
|
|
2078
3732
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/vibrance.js":
|
|
2079
|
-
|
|
2080
|
-
!*** /Users/
|
|
2081
|
-
|
|
3733
|
+
/*!***********************************************************************************************************************!*\
|
|
3734
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/vibrance.js ***!
|
|
3735
|
+
\***********************************************************************************************************************/
|
|
2082
3736
|
/*! exports provided: vibrance */
|
|
2083
3737
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2084
3738
|
|
|
2085
3739
|
"use strict";
|
|
2086
3740
|
__webpack_require__.r(__webpack_exports__);
|
|
2087
3741
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vibrance", function() { return vibrance; });
|
|
2088
|
-
const fs =
|
|
3742
|
+
const fs = `\
|
|
3743
|
+
uniform float amount;
|
|
3744
|
+
|
|
3745
|
+
vec4 vibrance_filterColor(vec4 color) {
|
|
3746
|
+
float average = (color.r + color.g + color.b) / 3.0;
|
|
3747
|
+
float mx = max(color.r, max(color.g, color.b));
|
|
3748
|
+
float amt = (mx - average) * (-amount * 3.0);
|
|
3749
|
+
color.rgb = mix(color.rgb, vec3(mx), amt);
|
|
3750
|
+
return color;
|
|
3751
|
+
}
|
|
3752
|
+
|
|
3753
|
+
vec4 vibrance_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
3754
|
+
return vibrance_filterColor(color);
|
|
3755
|
+
}
|
|
3756
|
+
`;
|
|
2089
3757
|
const uniforms = {
|
|
2090
3758
|
amount: {
|
|
2091
3759
|
value: 0,
|
|
@@ -2106,16 +3774,29 @@ const vibrance = {
|
|
|
2106
3774
|
/***/ }),
|
|
2107
3775
|
|
|
2108
3776
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/vignette.js":
|
|
2109
|
-
|
|
2110
|
-
!*** /Users/
|
|
2111
|
-
|
|
3777
|
+
/*!***********************************************************************************************************************!*\
|
|
3778
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-adjust-filters/vignette.js ***!
|
|
3779
|
+
\***********************************************************************************************************************/
|
|
2112
3780
|
/*! exports provided: vignette */
|
|
2113
3781
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2114
3782
|
|
|
2115
3783
|
"use strict";
|
|
2116
3784
|
__webpack_require__.r(__webpack_exports__);
|
|
2117
3785
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vignette", function() { return vignette; });
|
|
2118
|
-
const fs =
|
|
3786
|
+
const fs = `\
|
|
3787
|
+
uniform float radius;
|
|
3788
|
+
uniform float amount;
|
|
3789
|
+
|
|
3790
|
+
vec4 vignette_filterColor(vec4 color, vec2 texCoord) {
|
|
3791
|
+
float dist = distance(texCoord, vec2(0.5, 0.5));
|
|
3792
|
+
float ratio = smoothstep(0.8, radius * 0.799, dist * (amount + radius));
|
|
3793
|
+
return color.rgba * ratio + (1.0 - ratio)*vec4(0.0, 0.0, 0.0, 1.0);
|
|
3794
|
+
}
|
|
3795
|
+
|
|
3796
|
+
vec4 vignette_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
3797
|
+
return vignette_filterColor(color, texCoord);
|
|
3798
|
+
}
|
|
3799
|
+
`;
|
|
2119
3800
|
const uniforms = {
|
|
2120
3801
|
radius: {
|
|
2121
3802
|
value: 0.5,
|
|
@@ -2141,9 +3822,9 @@ const vignette = {
|
|
|
2141
3822
|
/***/ }),
|
|
2142
3823
|
|
|
2143
3824
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-blur-filters/tiltshift.js":
|
|
2144
|
-
|
|
2145
|
-
!*** /Users/
|
|
2146
|
-
|
|
3825
|
+
/*!**********************************************************************************************************************!*\
|
|
3826
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-blur-filters/tiltshift.js ***!
|
|
3827
|
+
\**********************************************************************************************************************/
|
|
2147
3828
|
/*! exports provided: tiltShift */
|
|
2148
3829
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2149
3830
|
|
|
@@ -2152,7 +3833,43 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2152
3833
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tiltShift", function() { return tiltShift; });
|
|
2153
3834
|
/* harmony import */ var _utils_random__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/random */ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/utils/random.js");
|
|
2154
3835
|
|
|
2155
|
-
const fs =
|
|
3836
|
+
const fs = `\
|
|
3837
|
+
uniform float blurRadius;
|
|
3838
|
+
uniform float gradientRadius;
|
|
3839
|
+
uniform vec2 start;
|
|
3840
|
+
uniform vec2 end;
|
|
3841
|
+
uniform bool invert;
|
|
3842
|
+
|
|
3843
|
+
vec2 tiltShift_getDelta(vec2 texSize) {
|
|
3844
|
+
vec2 vector = normalize((end - start) * texSize);
|
|
3845
|
+
return invert ? vec2(-vector.y, vector.x) : vector;
|
|
3846
|
+
}
|
|
3847
|
+
|
|
3848
|
+
vec4 tiltShift_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
3849
|
+
vec4 color = vec4(0.0);
|
|
3850
|
+
float total = 0.0;
|
|
3851
|
+
float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);
|
|
3852
|
+
|
|
3853
|
+
vec2 normal = normalize(vec2((start.y - end.y) * texSize.y, (end.x - start.x) * texSize.x));
|
|
3854
|
+
float radius = smoothstep(0.0, 1.0,
|
|
3855
|
+
abs(dot(texCoord * texSize - start * texSize, normal)) / gradientRadius) * blurRadius;
|
|
3856
|
+
|
|
3857
|
+
for (float t = -30.0; t <= 30.0; t++) {
|
|
3858
|
+
float percent = (t + offset - 0.5) / 30.0;
|
|
3859
|
+
float weight = 1.0 - abs(percent);
|
|
3860
|
+
vec4 sample = texture2D(texture, texCoord + tiltShift_getDelta(texSize) / texSize * percent * radius);
|
|
3861
|
+
sample.rgb *= sample.a;
|
|
3862
|
+
|
|
3863
|
+
color += sample * weight;
|
|
3864
|
+
total += weight;
|
|
3865
|
+
}
|
|
3866
|
+
|
|
3867
|
+
color = color / total;
|
|
3868
|
+
color.rgb /= color.a + 0.00001;
|
|
3869
|
+
|
|
3870
|
+
return color;
|
|
3871
|
+
}
|
|
3872
|
+
`;
|
|
2156
3873
|
const uniforms = {
|
|
2157
3874
|
blurRadius: {
|
|
2158
3875
|
value: 15,
|
|
@@ -2193,9 +3910,9 @@ const tiltShift = {
|
|
|
2193
3910
|
/***/ }),
|
|
2194
3911
|
|
|
2195
3912
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-blur-filters/triangleblur.js":
|
|
2196
|
-
|
|
2197
|
-
!*** /Users/
|
|
2198
|
-
|
|
3913
|
+
/*!*************************************************************************************************************************!*\
|
|
3914
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-blur-filters/triangleblur.js ***!
|
|
3915
|
+
\*************************************************************************************************************************/
|
|
2199
3916
|
/*! exports provided: triangleBlur */
|
|
2200
3917
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2201
3918
|
|
|
@@ -2204,7 +3921,33 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2204
3921
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triangleBlur", function() { return triangleBlur; });
|
|
2205
3922
|
/* harmony import */ var _utils_random__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/random */ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/utils/random.js");
|
|
2206
3923
|
|
|
2207
|
-
const fs =
|
|
3924
|
+
const fs = `\
|
|
3925
|
+
uniform float radius;
|
|
3926
|
+
uniform vec2 delta;
|
|
3927
|
+
|
|
3928
|
+
vec4 triangleBlur_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
3929
|
+
vec2 adjustedDelta = delta * radius / texSize;
|
|
3930
|
+
|
|
3931
|
+
vec4 color = vec4(0.0);
|
|
3932
|
+
float total = 0.0;
|
|
3933
|
+
float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);
|
|
3934
|
+
|
|
3935
|
+
for (float t = -30.0; t <= 30.0; t++) {
|
|
3936
|
+
float percent = (t + offset - 0.5) / 30.0;
|
|
3937
|
+
float weight = 1.0 - abs(percent);
|
|
3938
|
+
vec4 sample = texture2D(texture, texCoord + adjustedDelta * percent);
|
|
3939
|
+
sample.rgb *= sample.a;
|
|
3940
|
+
|
|
3941
|
+
color += sample * weight;
|
|
3942
|
+
total += weight;
|
|
3943
|
+
}
|
|
3944
|
+
|
|
3945
|
+
color = color / total;
|
|
3946
|
+
color.rgb /= color.a + 0.00001;
|
|
3947
|
+
|
|
3948
|
+
return color;
|
|
3949
|
+
}
|
|
3950
|
+
`;
|
|
2208
3951
|
const uniforms = {
|
|
2209
3952
|
radius: {
|
|
2210
3953
|
value: 20,
|
|
@@ -2238,9 +3981,9 @@ const triangleBlur = {
|
|
|
2238
3981
|
/***/ }),
|
|
2239
3982
|
|
|
2240
3983
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-blur-filters/zoomblur.js":
|
|
2241
|
-
|
|
2242
|
-
!*** /Users/
|
|
2243
|
-
|
|
3984
|
+
/*!*********************************************************************************************************************!*\
|
|
3985
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-blur-filters/zoomblur.js ***!
|
|
3986
|
+
\*********************************************************************************************************************/
|
|
2244
3987
|
/*! exports provided: zoomBlur */
|
|
2245
3988
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2246
3989
|
|
|
@@ -2249,7 +3992,32 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2249
3992
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zoomBlur", function() { return zoomBlur; });
|
|
2250
3993
|
/* harmony import */ var _utils_random__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/random */ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/utils/random.js");
|
|
2251
3994
|
|
|
2252
|
-
const fs =
|
|
3995
|
+
const fs = `
|
|
3996
|
+
uniform vec2 center;
|
|
3997
|
+
uniform float strength;
|
|
3998
|
+
|
|
3999
|
+
vec4 zoomBlur_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
4000
|
+
vec4 color = vec4(0.0);
|
|
4001
|
+
float total = 0.0;
|
|
4002
|
+
vec2 toCenter = center * texSize - texCoord * texSize;
|
|
4003
|
+
float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);
|
|
4004
|
+
|
|
4005
|
+
for (float t = 0.0; t <= 40.0; t++) {
|
|
4006
|
+
float percent = (t + offset) / 40.0;
|
|
4007
|
+
float weight = 4.0 * (percent - percent * percent);
|
|
4008
|
+
vec4 sample = texture2D(texture, texCoord + toCenter * percent * strength / texSize);
|
|
4009
|
+
sample.rgb *= sample.a;
|
|
4010
|
+
|
|
4011
|
+
color += sample * weight;
|
|
4012
|
+
total += weight;
|
|
4013
|
+
}
|
|
4014
|
+
|
|
4015
|
+
color = color / total;
|
|
4016
|
+
color.rgb /= color.a + 0.00001;
|
|
4017
|
+
|
|
4018
|
+
return color;
|
|
4019
|
+
}
|
|
4020
|
+
`;
|
|
2253
4021
|
const uniforms = {
|
|
2254
4022
|
center: [0.5, 0.5],
|
|
2255
4023
|
strength: {
|
|
@@ -2272,16 +4040,49 @@ const zoomBlur = {
|
|
|
2272
4040
|
/***/ }),
|
|
2273
4041
|
|
|
2274
4042
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/colorhalftone.js":
|
|
2275
|
-
|
|
2276
|
-
!*** /Users/
|
|
2277
|
-
|
|
4043
|
+
/*!*************************************************************************************************************************!*\
|
|
4044
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/colorhalftone.js ***!
|
|
4045
|
+
\*************************************************************************************************************************/
|
|
2278
4046
|
/*! exports provided: colorHalftone */
|
|
2279
4047
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2280
4048
|
|
|
2281
4049
|
"use strict";
|
|
2282
4050
|
__webpack_require__.r(__webpack_exports__);
|
|
2283
4051
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorHalftone", function() { return colorHalftone; });
|
|
2284
|
-
const fs =
|
|
4052
|
+
const fs = `\
|
|
4053
|
+
uniform vec2 center;
|
|
4054
|
+
uniform float angle;
|
|
4055
|
+
uniform float size;
|
|
4056
|
+
|
|
4057
|
+
float scale = 3.1514 / size;
|
|
4058
|
+
|
|
4059
|
+
float pattern(float angle, vec2 texSize, vec2 texCoord) {
|
|
4060
|
+
float s = sin(angle), c = cos(angle);
|
|
4061
|
+
vec2 tex = texCoord * texSize - center * texSize;
|
|
4062
|
+
vec2 point = vec2(
|
|
4063
|
+
c * tex.x - s * tex.y,
|
|
4064
|
+
s * tex.x + c * tex.y
|
|
4065
|
+
) * scale;
|
|
4066
|
+
return (sin(point.x) * sin(point.y)) * 4.0;
|
|
4067
|
+
}
|
|
4068
|
+
|
|
4069
|
+
vec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
4070
|
+
vec3 cmy = 1.0 - color.rgb;
|
|
4071
|
+
float k = min(cmy.x, min(cmy.y, cmy.z));
|
|
4072
|
+
cmy = (cmy - k) / (1.0 - k);
|
|
4073
|
+
cmy = clamp(
|
|
4074
|
+
cmy * 10.0 - 3.0 + vec3(
|
|
4075
|
+
pattern(angle + 0.26179, texSize, texCoord),
|
|
4076
|
+
pattern(angle + 1.30899, texSize, texCoord),
|
|
4077
|
+
pattern(angle, texSize, texCoord)
|
|
4078
|
+
),
|
|
4079
|
+
0.0,
|
|
4080
|
+
1.0
|
|
4081
|
+
);
|
|
4082
|
+
k = clamp(k * 10.0 - 5.0 + pattern(angle + 0.78539, texSize, texCoord), 0.0, 1.0);
|
|
4083
|
+
return vec4(1.0 - cmy - k, color.a);
|
|
4084
|
+
}
|
|
4085
|
+
`;
|
|
2285
4086
|
const uniforms = {
|
|
2286
4087
|
center: [0.5, 0.5],
|
|
2287
4088
|
angle: {
|
|
@@ -2309,16 +4110,37 @@ const colorHalftone = {
|
|
|
2309
4110
|
/***/ }),
|
|
2310
4111
|
|
|
2311
4112
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/dotscreen.js":
|
|
2312
|
-
|
|
2313
|
-
!*** /Users/
|
|
2314
|
-
|
|
4113
|
+
/*!*********************************************************************************************************************!*\
|
|
4114
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/dotscreen.js ***!
|
|
4115
|
+
\*********************************************************************************************************************/
|
|
2315
4116
|
/*! exports provided: dotScreen */
|
|
2316
4117
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2317
4118
|
|
|
2318
4119
|
"use strict";
|
|
2319
4120
|
__webpack_require__.r(__webpack_exports__);
|
|
2320
4121
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dotScreen", function() { return dotScreen; });
|
|
2321
|
-
const fs =
|
|
4122
|
+
const fs = `\
|
|
4123
|
+
uniform vec2 center;
|
|
4124
|
+
uniform float angle;
|
|
4125
|
+
uniform float size;
|
|
4126
|
+
|
|
4127
|
+
float pattern(vec2 texSize, vec2 texCoord) {
|
|
4128
|
+
float scale = 3.1415 / size;
|
|
4129
|
+
|
|
4130
|
+
float s = sin(angle), c = cos(angle);
|
|
4131
|
+
vec2 tex = texCoord * texSize - center * texSize;
|
|
4132
|
+
vec2 point = vec2(
|
|
4133
|
+
c * tex.x - s * tex.y,
|
|
4134
|
+
s * tex.x + c * tex.y
|
|
4135
|
+
) * scale;
|
|
4136
|
+
return (sin(point.x) * sin(point.y)) * 4.0;
|
|
4137
|
+
}
|
|
4138
|
+
|
|
4139
|
+
vec4 dotScreen_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
4140
|
+
float average = (color.r + color.g + color.b) / 3.0;
|
|
4141
|
+
return vec4(vec3(average * 10.0 - 5.0 + pattern(texSize, texCoord)), color.a);
|
|
4142
|
+
}
|
|
4143
|
+
`;
|
|
2322
4144
|
const uniforms = {
|
|
2323
4145
|
center: [0.5, 0.5],
|
|
2324
4146
|
angle: {
|
|
@@ -2346,9 +4168,9 @@ const dotScreen = {
|
|
|
2346
4168
|
/***/ }),
|
|
2347
4169
|
|
|
2348
4170
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/edgework.js":
|
|
2349
|
-
|
|
2350
|
-
!*** /Users/
|
|
2351
|
-
|
|
4171
|
+
/*!********************************************************************************************************************!*\
|
|
4172
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/edgework.js ***!
|
|
4173
|
+
\********************************************************************************************************************/
|
|
2352
4174
|
/*! exports provided: edgeWork */
|
|
2353
4175
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2354
4176
|
|
|
@@ -2357,7 +4179,56 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2357
4179
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "edgeWork", function() { return edgeWork; });
|
|
2358
4180
|
/* harmony import */ var _utils_random__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/random */ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/utils/random.js");
|
|
2359
4181
|
|
|
2360
|
-
const fs =
|
|
4182
|
+
const fs = `\
|
|
4183
|
+
uniform float radius;
|
|
4184
|
+
uniform vec2 delta;
|
|
4185
|
+
|
|
4186
|
+
vec4 edgeWork_sampleColor1(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
4187
|
+
vec2 relativeDelta = radius * delta / texSize;
|
|
4188
|
+
|
|
4189
|
+
vec2 color = vec2(0.0);
|
|
4190
|
+
vec2 total = vec2(0.0);
|
|
4191
|
+
float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);
|
|
4192
|
+
|
|
4193
|
+
for (float t = -30.0; t <= 30.0; t++) {
|
|
4194
|
+
float percent = (t + offset - 0.5) / 30.0;
|
|
4195
|
+
float weight = 1.0 - abs(percent);
|
|
4196
|
+
vec3 sampleColor = texture2D(source, texCoord + relativeDelta * percent).rgb;
|
|
4197
|
+
float average = (sampleColor.r + sampleColor.g + sampleColor.b) / 3.0;
|
|
4198
|
+
color.x += average * weight;
|
|
4199
|
+
total.x += weight;
|
|
4200
|
+
if (abs(t) < 15.0) {
|
|
4201
|
+
weight = weight * 2.0 - 1.0;
|
|
4202
|
+
color.y += average * weight;
|
|
4203
|
+
total.y += weight;
|
|
4204
|
+
}
|
|
4205
|
+
}
|
|
4206
|
+
return vec4(color / total, 0.0, 1.0);
|
|
4207
|
+
}
|
|
4208
|
+
|
|
4209
|
+
vec4 edgeWork_sampleColor2(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
4210
|
+
vec2 relativeDelta = radius * delta / texSize;
|
|
4211
|
+
|
|
4212
|
+
vec2 color = vec2(0.0);
|
|
4213
|
+
vec2 total = vec2(0.0);
|
|
4214
|
+
float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);
|
|
4215
|
+
|
|
4216
|
+
for (float t = -30.0; t <= 30.0; t++) {
|
|
4217
|
+
float percent = (t + offset - 0.5) / 30.0;
|
|
4218
|
+
float weight = 1.0 - abs(percent);
|
|
4219
|
+
vec2 sampleColor = texture2D(source, texCoord + relativeDelta * percent).xy;
|
|
4220
|
+
color.x += sampleColor.x * weight;
|
|
4221
|
+
total.x += weight;
|
|
4222
|
+
if (abs(t) < 15.0) {
|
|
4223
|
+
weight = weight * 2.0 - 1.0;
|
|
4224
|
+
color.y += sampleColor.y * weight;
|
|
4225
|
+
total.y += weight;
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4228
|
+
float c = clamp(10000.0 * (color.y / total.y - color.x / total.x) + 0.5, 0.0, 1.0);
|
|
4229
|
+
return vec4(c, c, c, 1.0);
|
|
4230
|
+
}
|
|
4231
|
+
`;
|
|
2361
4232
|
const uniforms = {
|
|
2362
4233
|
radius: {
|
|
2363
4234
|
value: 2,
|
|
@@ -2391,16 +4262,57 @@ const edgeWork = {
|
|
|
2391
4262
|
/***/ }),
|
|
2392
4263
|
|
|
2393
4264
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/hexagonalpixelate.js":
|
|
2394
|
-
|
|
2395
|
-
!*** /Users/
|
|
2396
|
-
|
|
4265
|
+
/*!*****************************************************************************************************************************!*\
|
|
4266
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/hexagonalpixelate.js ***!
|
|
4267
|
+
\*****************************************************************************************************************************/
|
|
2397
4268
|
/*! exports provided: hexagonalPixelate */
|
|
2398
4269
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2399
4270
|
|
|
2400
4271
|
"use strict";
|
|
2401
4272
|
__webpack_require__.r(__webpack_exports__);
|
|
2402
4273
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hexagonalPixelate", function() { return hexagonalPixelate; });
|
|
2403
|
-
const fs =
|
|
4274
|
+
const fs = `\
|
|
4275
|
+
uniform vec2 center;
|
|
4276
|
+
uniform float scale;
|
|
4277
|
+
|
|
4278
|
+
vec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
4279
|
+
vec2 tex = (texCoord * texSize - center * texSize) / scale;
|
|
4280
|
+
tex.y /= 0.866025404;
|
|
4281
|
+
tex.x -= tex.y * 0.5;
|
|
4282
|
+
|
|
4283
|
+
vec2 a;
|
|
4284
|
+
if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) {
|
|
4285
|
+
a = vec2(floor(tex.x), floor(tex.y));
|
|
4286
|
+
}
|
|
4287
|
+
else a = vec2(ceil(tex.x), ceil(tex.y));
|
|
4288
|
+
vec2 b = vec2(ceil(tex.x), floor(tex.y));
|
|
4289
|
+
vec2 c = vec2(floor(tex.x), ceil(tex.y));
|
|
4290
|
+
|
|
4291
|
+
vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y);
|
|
4292
|
+
vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y);
|
|
4293
|
+
vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y);
|
|
4294
|
+
vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y);
|
|
4295
|
+
|
|
4296
|
+
float alen = length(TEX - A);
|
|
4297
|
+
float blen = length(TEX - B);
|
|
4298
|
+
float clen = length(TEX - C);
|
|
4299
|
+
|
|
4300
|
+
vec2 choice;
|
|
4301
|
+
if (alen < blen) {
|
|
4302
|
+
if (alen < clen) choice = a;
|
|
4303
|
+
else choice = c;
|
|
4304
|
+
} else {
|
|
4305
|
+
if (blen < clen) choice = b;
|
|
4306
|
+
else choice = c;
|
|
4307
|
+
}
|
|
4308
|
+
|
|
4309
|
+
choice.x += choice.y * 0.5;
|
|
4310
|
+
choice.y *= 0.866025404;
|
|
4311
|
+
choice *= scale / texSize;
|
|
4312
|
+
|
|
4313
|
+
return texture2D(texture, choice + center);
|
|
4314
|
+
}
|
|
4315
|
+
`;
|
|
2404
4316
|
const uniforms = {
|
|
2405
4317
|
center: {
|
|
2406
4318
|
value: [0.5, 0.5],
|
|
@@ -2426,16 +4338,42 @@ const hexagonalPixelate = {
|
|
|
2426
4338
|
/***/ }),
|
|
2427
4339
|
|
|
2428
4340
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/ink.js":
|
|
2429
|
-
|
|
2430
|
-
!*** /Users/
|
|
2431
|
-
|
|
4341
|
+
/*!***************************************************************************************************************!*\
|
|
4342
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/ink.js ***!
|
|
4343
|
+
\***************************************************************************************************************/
|
|
2432
4344
|
/*! exports provided: ink */
|
|
2433
4345
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2434
4346
|
|
|
2435
4347
|
"use strict";
|
|
2436
4348
|
__webpack_require__.r(__webpack_exports__);
|
|
2437
4349
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ink", function() { return ink; });
|
|
2438
|
-
const fs =
|
|
4350
|
+
const fs = `\
|
|
4351
|
+
uniform float strength;
|
|
4352
|
+
|
|
4353
|
+
vec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
4354
|
+
vec2 dx = vec2(1.0 / texSize.x, 0.0);
|
|
4355
|
+
vec2 dy = vec2(0.0, 1.0 / texSize.y);
|
|
4356
|
+
vec4 color = texture2D(texture, texCoord);
|
|
4357
|
+
float bigTotal = 0.0;
|
|
4358
|
+
float smallTotal = 0.0;
|
|
4359
|
+
vec3 bigAverage = vec3(0.0);
|
|
4360
|
+
vec3 smallAverage = vec3(0.0);
|
|
4361
|
+
for (float x = -2.0; x <= 2.0; x += 1.0) {
|
|
4362
|
+
for (float y = -2.0; y <= 2.0; y += 1.0) {
|
|
4363
|
+
vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb;
|
|
4364
|
+
bigAverage += sample;
|
|
4365
|
+
bigTotal += 1.0;
|
|
4366
|
+
if (abs(x) + abs(y) < 2.0) {
|
|
4367
|
+
smallAverage += sample;
|
|
4368
|
+
smallTotal += 1.0;
|
|
4369
|
+
}
|
|
4370
|
+
}
|
|
4371
|
+
}
|
|
4372
|
+
vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal);
|
|
4373
|
+
float power = strength * strength * strength * strength * strength;
|
|
4374
|
+
return vec4(color.rgb - dot(edge, edge) * power * 100000.0, color.a);
|
|
4375
|
+
}
|
|
4376
|
+
`;
|
|
2439
4377
|
const uniforms = {
|
|
2440
4378
|
strength: {
|
|
2441
4379
|
value: 0.25,
|
|
@@ -2456,16 +4394,35 @@ const ink = {
|
|
|
2456
4394
|
/***/ }),
|
|
2457
4395
|
|
|
2458
4396
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/magnify.js":
|
|
2459
|
-
|
|
2460
|
-
!*** /Users/
|
|
2461
|
-
|
|
4397
|
+
/*!*******************************************************************************************************************!*\
|
|
4398
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-fun-filters/magnify.js ***!
|
|
4399
|
+
\*******************************************************************************************************************/
|
|
2462
4400
|
/*! exports provided: magnify */
|
|
2463
4401
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2464
4402
|
|
|
2465
4403
|
"use strict";
|
|
2466
4404
|
__webpack_require__.r(__webpack_exports__);
|
|
2467
4405
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "magnify", function() { return magnify; });
|
|
2468
|
-
const fs =
|
|
4406
|
+
const fs = `\
|
|
4407
|
+
uniform vec2 screenXY;
|
|
4408
|
+
uniform float radiusPixels;
|
|
4409
|
+
uniform float zoom;
|
|
4410
|
+
uniform float borderWidthPixels;
|
|
4411
|
+
uniform vec4 borderColor;
|
|
4412
|
+
|
|
4413
|
+
vec4 magnify_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
4414
|
+
vec2 pos = vec2(screenXY.x, 1.0 - screenXY.y);
|
|
4415
|
+
float dist = distance(texCoord * texSize, pos * texSize);
|
|
4416
|
+
if (dist < radiusPixels) {
|
|
4417
|
+
return texture2D(texture, (texCoord - pos) / zoom + pos);
|
|
4418
|
+
}
|
|
4419
|
+
|
|
4420
|
+
if (dist <= radiusPixels + borderWidthPixels) {
|
|
4421
|
+
return borderColor;
|
|
4422
|
+
}
|
|
4423
|
+
return texture2D(texture, texCoord);
|
|
4424
|
+
}
|
|
4425
|
+
`;
|
|
2469
4426
|
const uniforms = {
|
|
2470
4427
|
screenXY: [0, 0],
|
|
2471
4428
|
radiusPixels: 200,
|
|
@@ -2486,9 +4443,9 @@ const magnify = {
|
|
|
2486
4443
|
/***/ }),
|
|
2487
4444
|
|
|
2488
4445
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-warp-filters/bulgepinch.js":
|
|
2489
|
-
|
|
2490
|
-
!*** /Users/
|
|
2491
|
-
|
|
4446
|
+
/*!***********************************************************************************************************************!*\
|
|
4447
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-warp-filters/bulgepinch.js ***!
|
|
4448
|
+
\***********************************************************************************************************************/
|
|
2492
4449
|
/*! exports provided: bulgePinch */
|
|
2493
4450
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2494
4451
|
|
|
@@ -2497,7 +4454,33 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2497
4454
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bulgePinch", function() { return bulgePinch; });
|
|
2498
4455
|
/* harmony import */ var _warp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./warp */ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-warp-filters/warp.js");
|
|
2499
4456
|
|
|
2500
|
-
const fs =
|
|
4457
|
+
const fs = `\
|
|
4458
|
+
uniform float radius;
|
|
4459
|
+
uniform float strength;
|
|
4460
|
+
uniform vec2 center;
|
|
4461
|
+
|
|
4462
|
+
vec2 bulgePinch_warp(vec2 coord, vec2 texCenter) {
|
|
4463
|
+
coord -= texCenter;
|
|
4464
|
+
float distance = length(coord);
|
|
4465
|
+
if (distance < radius) {
|
|
4466
|
+
float percent = distance / radius;
|
|
4467
|
+
if (strength > 0.0) {
|
|
4468
|
+
coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);
|
|
4469
|
+
} else {
|
|
4470
|
+
coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);
|
|
4471
|
+
}
|
|
4472
|
+
}
|
|
4473
|
+
coord += texCenter;
|
|
4474
|
+
return coord;
|
|
4475
|
+
}
|
|
4476
|
+
|
|
4477
|
+
vec4 bulgePinch_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
4478
|
+
vec2 coord = texCoord * texSize;
|
|
4479
|
+
coord = bulgePinch_warp(coord, center * texSize);
|
|
4480
|
+
|
|
4481
|
+
return warp_sampleColor(texture, texSize, coord);
|
|
4482
|
+
}
|
|
4483
|
+
`;
|
|
2501
4484
|
const uniforms = {
|
|
2502
4485
|
center: [0.5, 0.5],
|
|
2503
4486
|
radius: {
|
|
@@ -2525,9 +4508,9 @@ const bulgePinch = {
|
|
|
2525
4508
|
/***/ }),
|
|
2526
4509
|
|
|
2527
4510
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-warp-filters/swirl.js":
|
|
2528
|
-
|
|
2529
|
-
!*** /Users/
|
|
2530
|
-
|
|
4511
|
+
/*!******************************************************************************************************************!*\
|
|
4512
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-warp-filters/swirl.js ***!
|
|
4513
|
+
\******************************************************************************************************************/
|
|
2531
4514
|
/*! exports provided: swirl */
|
|
2532
4515
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2533
4516
|
|
|
@@ -2536,7 +4519,35 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2536
4519
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "swirl", function() { return swirl; });
|
|
2537
4520
|
/* harmony import */ var _warp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./warp */ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-warp-filters/warp.js");
|
|
2538
4521
|
|
|
2539
|
-
const fs =
|
|
4522
|
+
const fs = `\
|
|
4523
|
+
uniform float radius;
|
|
4524
|
+
uniform float angle;
|
|
4525
|
+
uniform vec2 center;
|
|
4526
|
+
|
|
4527
|
+
vec2 swirl_warp(vec2 coord, vec2 texCenter) {
|
|
4528
|
+
coord -= texCenter;
|
|
4529
|
+
float distance = length(coord);
|
|
4530
|
+
if (distance < radius) {
|
|
4531
|
+
float percent = (radius - distance) / radius;
|
|
4532
|
+
float theta = percent * percent * angle;
|
|
4533
|
+
float s = sin(theta);
|
|
4534
|
+
float c = cos(theta);
|
|
4535
|
+
coord = vec2(
|
|
4536
|
+
coord.x * c - coord.y * s,
|
|
4537
|
+
coord.x * s + coord.y * c
|
|
4538
|
+
);
|
|
4539
|
+
}
|
|
4540
|
+
coord += texCenter;
|
|
4541
|
+
return coord;
|
|
4542
|
+
}
|
|
4543
|
+
|
|
4544
|
+
vec4 swirl_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
4545
|
+
vec2 coord = texCoord * texSize;
|
|
4546
|
+
coord = swirl_warp(coord, center * texSize);
|
|
4547
|
+
|
|
4548
|
+
return warp_sampleColor(texture, texSize, coord);
|
|
4549
|
+
}
|
|
4550
|
+
`;
|
|
2540
4551
|
const uniforms = {
|
|
2541
4552
|
center: [0.5, 0.5],
|
|
2542
4553
|
radius: {
|
|
@@ -2564,16 +4575,26 @@ const swirl = {
|
|
|
2564
4575
|
/***/ }),
|
|
2565
4576
|
|
|
2566
4577
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/image-warp-filters/warp.js":
|
|
2567
|
-
|
|
2568
|
-
!*** /Users/
|
|
2569
|
-
|
|
4578
|
+
/*!*****************************************************************************************************************!*\
|
|
4579
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/image-warp-filters/warp.js ***!
|
|
4580
|
+
\*****************************************************************************************************************/
|
|
2570
4581
|
/*! exports provided: warp */
|
|
2571
4582
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2572
4583
|
|
|
2573
4584
|
"use strict";
|
|
2574
4585
|
__webpack_require__.r(__webpack_exports__);
|
|
2575
4586
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "warp", function() { return warp; });
|
|
2576
|
-
const fs =
|
|
4587
|
+
const fs = `\
|
|
4588
|
+
vec4 warp_sampleColor(sampler2D texture, vec2 texSize, vec2 coord) {
|
|
4589
|
+
vec4 color = texture2D(texture, coord / texSize);
|
|
4590
|
+
vec2 clampedCoord = clamp(coord, vec2(0.0), texSize);
|
|
4591
|
+
if (coord != clampedCoord) {
|
|
4592
|
+
color.a *= max(0.0, 1.0 - length(coord - clampedCoord));
|
|
4593
|
+
}
|
|
4594
|
+
|
|
4595
|
+
return color;
|
|
4596
|
+
}
|
|
4597
|
+
`;
|
|
2577
4598
|
const warp = {
|
|
2578
4599
|
name: 'warp',
|
|
2579
4600
|
fs
|
|
@@ -2583,9 +4604,9 @@ const warp = {
|
|
|
2583
4604
|
/***/ }),
|
|
2584
4605
|
|
|
2585
4606
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/index.js":
|
|
2586
|
-
|
|
2587
|
-
!*** /Users/
|
|
2588
|
-
|
|
4607
|
+
/*!***********************************************************************************************!*\
|
|
4608
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/index.js ***!
|
|
4609
|
+
\***********************************************************************************************/
|
|
2589
4610
|
/*! exports provided: random, fp32, fp64, fp64arithmetic, project, lights, dirlight, picking, gouraudLighting, phongLighting, pbr, tiltShift, triangleBlur, zoomBlur, brightnessContrast, denoise, hueSaturation, noise, sepia, vibrance, vignette, colorHalftone, dotScreen, edgeWork, hexagonalPixelate, ink, magnify, bulgePinch, swirl, _warp, fxaa, _transform */
|
|
2590
4611
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2591
4612
|
|
|
@@ -2720,23 +4741,56 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2720
4741
|
/***/ }),
|
|
2721
4742
|
|
|
2722
4743
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.glsl.js":
|
|
2723
|
-
|
|
2724
|
-
!*** /Users/
|
|
2725
|
-
|
|
4744
|
+
/*!************************************************************************************************************!*\
|
|
4745
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.glsl.js ***!
|
|
4746
|
+
\************************************************************************************************************/
|
|
2726
4747
|
/*! exports provided: default */
|
|
2727
4748
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2728
4749
|
|
|
2729
4750
|
"use strict";
|
|
2730
4751
|
__webpack_require__.r(__webpack_exports__);
|
|
2731
|
-
/* harmony default export */ __webpack_exports__["default"] = (
|
|
4752
|
+
/* harmony default export */ __webpack_exports__["default"] = (`\
|
|
4753
|
+
#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))
|
|
4754
|
+
|
|
4755
|
+
struct AmbientLight {
|
|
4756
|
+
vec3 color;
|
|
4757
|
+
};
|
|
4758
|
+
|
|
4759
|
+
struct PointLight {
|
|
4760
|
+
vec3 color;
|
|
4761
|
+
vec3 position;
|
|
4762
|
+
vec3 attenuation;
|
|
4763
|
+
};
|
|
4764
|
+
|
|
4765
|
+
struct DirectionalLight {
|
|
4766
|
+
vec3 color;
|
|
4767
|
+
vec3 direction;
|
|
4768
|
+
};
|
|
4769
|
+
|
|
4770
|
+
uniform AmbientLight lighting_uAmbientLight;
|
|
4771
|
+
uniform PointLight lighting_uPointLight[MAX_LIGHTS];
|
|
4772
|
+
uniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];
|
|
4773
|
+
uniform int lighting_uPointLightCount;
|
|
4774
|
+
uniform int lighting_uDirectionalLightCount;
|
|
4775
|
+
|
|
4776
|
+
uniform bool lighting_uEnabled;
|
|
4777
|
+
|
|
4778
|
+
float getPointLightAttenuation(PointLight pointLight, float distance) {
|
|
4779
|
+
return pointLight.attenuation.x
|
|
4780
|
+
+ pointLight.attenuation.y * distance
|
|
4781
|
+
+ pointLight.attenuation.z * distance * distance;
|
|
4782
|
+
}
|
|
4783
|
+
|
|
4784
|
+
#endif
|
|
4785
|
+
`);
|
|
2732
4786
|
//# sourceMappingURL=lights.glsl.js.map
|
|
2733
4787
|
|
|
2734
4788
|
/***/ }),
|
|
2735
4789
|
|
|
2736
4790
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.js":
|
|
2737
|
-
|
|
2738
|
-
!*** /Users/
|
|
2739
|
-
|
|
4791
|
+
/*!*******************************************************************************************************!*\
|
|
4792
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/lights/lights.js ***!
|
|
4793
|
+
\*******************************************************************************************************/
|
|
2740
4794
|
/*! exports provided: lights */
|
|
2741
4795
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2742
4796
|
|
|
@@ -2770,14 +4824,14 @@ function getLightSourceUniforms({
|
|
|
2770
4824
|
}
|
|
2771
4825
|
|
|
2772
4826
|
pointLights.forEach((pointLight, index) => {
|
|
2773
|
-
lightSourceUniforms[
|
|
2774
|
-
lightSourceUniforms[
|
|
2775
|
-
lightSourceUniforms[
|
|
4827
|
+
lightSourceUniforms[`lighting_uPointLight[${index}].color`] = convertColor(pointLight);
|
|
4828
|
+
lightSourceUniforms[`lighting_uPointLight[${index}].position`] = pointLight.position;
|
|
4829
|
+
lightSourceUniforms[`lighting_uPointLight[${index}].attenuation`] = pointLight.attenuation || [1, 0, 0];
|
|
2776
4830
|
});
|
|
2777
4831
|
lightSourceUniforms.lighting_uPointLightCount = pointLights.length;
|
|
2778
4832
|
directionalLights.forEach((directionalLight, index) => {
|
|
2779
|
-
lightSourceUniforms[
|
|
2780
|
-
lightSourceUniforms[
|
|
4833
|
+
lightSourceUniforms[`lighting_uDirectionalLight[${index}].color`] = convertColor(directionalLight);
|
|
4834
|
+
lightSourceUniforms[`lighting_uDirectionalLight[${index}].direction`] = directionalLight.direction;
|
|
2781
4835
|
});
|
|
2782
4836
|
lightSourceUniforms.lighting_uDirectionalLightCount = directionalLights.length;
|
|
2783
4837
|
return lightSourceUniforms;
|
|
@@ -2807,100 +4861,513 @@ function getUniforms(opts = INITIAL_MODULE_OPTIONS) {
|
|
|
2807
4861
|
});
|
|
2808
4862
|
}
|
|
2809
4863
|
|
|
2810
|
-
if ('lights' in opts) {
|
|
2811
|
-
const lightSources = {
|
|
2812
|
-
pointLights: [],
|
|
2813
|
-
directionalLights: []
|
|
2814
|
-
};
|
|
4864
|
+
if ('lights' in opts) {
|
|
4865
|
+
const lightSources = {
|
|
4866
|
+
pointLights: [],
|
|
4867
|
+
directionalLights: []
|
|
4868
|
+
};
|
|
4869
|
+
|
|
4870
|
+
for (const light of opts.lights || []) {
|
|
4871
|
+
switch (light.type) {
|
|
4872
|
+
case 'ambient':
|
|
4873
|
+
lightSources.ambientLight = light;
|
|
4874
|
+
break;
|
|
4875
|
+
|
|
4876
|
+
case 'directional':
|
|
4877
|
+
lightSources.directionalLights.push(light);
|
|
4878
|
+
break;
|
|
4879
|
+
|
|
4880
|
+
case 'point':
|
|
4881
|
+
lightSources.pointLights.push(light);
|
|
4882
|
+
break;
|
|
4883
|
+
|
|
4884
|
+
default:
|
|
4885
|
+
}
|
|
4886
|
+
}
|
|
4887
|
+
|
|
4888
|
+
return getUniforms({
|
|
4889
|
+
lightSources
|
|
4890
|
+
});
|
|
4891
|
+
}
|
|
4892
|
+
|
|
4893
|
+
return {};
|
|
4894
|
+
}
|
|
4895
|
+
|
|
4896
|
+
const lights = {
|
|
4897
|
+
name: 'lights',
|
|
4898
|
+
vs: _lights_glsl__WEBPACK_IMPORTED_MODULE_0__["default"],
|
|
4899
|
+
fs: _lights_glsl__WEBPACK_IMPORTED_MODULE_0__["default"],
|
|
4900
|
+
getUniforms,
|
|
4901
|
+
defines: {
|
|
4902
|
+
MAX_LIGHTS: 3
|
|
4903
|
+
}
|
|
4904
|
+
};
|
|
4905
|
+
//# sourceMappingURL=lights.js.map
|
|
4906
|
+
|
|
4907
|
+
/***/ }),
|
|
4908
|
+
|
|
4909
|
+
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/module-injectors.js":
|
|
4910
|
+
/*!**********************************************************************************************************!*\
|
|
4911
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/module-injectors.js ***!
|
|
4912
|
+
\**********************************************************************************************************/
|
|
4913
|
+
/*! exports provided: MODULE_INJECTORS_VS, MODULE_INJECTORS_FS */
|
|
4914
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4915
|
+
|
|
4916
|
+
"use strict";
|
|
4917
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4918
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MODULE_INJECTORS_VS", function() { return MODULE_INJECTORS_VS; });
|
|
4919
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MODULE_INJECTORS_FS", function() { return MODULE_INJECTORS_FS; });
|
|
4920
|
+
const MODULE_INJECTORS_VS = `\
|
|
4921
|
+
#ifdef MODULE_LOGDEPTH
|
|
4922
|
+
logdepth_adjustPosition(gl_Position);
|
|
4923
|
+
#endif
|
|
4924
|
+
`;
|
|
4925
|
+
const MODULE_INJECTORS_FS = `\
|
|
4926
|
+
#ifdef MODULE_MATERIAL
|
|
4927
|
+
gl_FragColor = material_filterColor(gl_FragColor);
|
|
4928
|
+
#endif
|
|
4929
|
+
|
|
4930
|
+
#ifdef MODULE_LIGHTING
|
|
4931
|
+
gl_FragColor = lighting_filterColor(gl_FragColor);
|
|
4932
|
+
#endif
|
|
4933
|
+
|
|
4934
|
+
#ifdef MODULE_FOG
|
|
4935
|
+
gl_FragColor = fog_filterColor(gl_FragColor);
|
|
4936
|
+
#endif
|
|
4937
|
+
|
|
4938
|
+
#ifdef MODULE_PICKING
|
|
4939
|
+
gl_FragColor = picking_filterHighlightColor(gl_FragColor);
|
|
4940
|
+
gl_FragColor = picking_filterPickingColor(gl_FragColor);
|
|
4941
|
+
#endif
|
|
4942
|
+
|
|
4943
|
+
#ifdef MODULE_LOGDEPTH
|
|
4944
|
+
logdepth_setFragDepth();
|
|
4945
|
+
#endif
|
|
4946
|
+
`;
|
|
4947
|
+
//# sourceMappingURL=module-injectors.js.map
|
|
4948
|
+
|
|
4949
|
+
/***/ }),
|
|
4950
|
+
|
|
4951
|
+
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/pbr/pbr-fragment.glsl.js":
|
|
4952
|
+
/*!***************************************************************************************************************!*\
|
|
4953
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/pbr/pbr-fragment.glsl.js ***!
|
|
4954
|
+
\***************************************************************************************************************/
|
|
4955
|
+
/*! exports provided: default */
|
|
4956
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4957
|
+
|
|
4958
|
+
"use strict";
|
|
4959
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4960
|
+
/* harmony default export */ __webpack_exports__["default"] = (`\
|
|
4961
|
+
#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)
|
|
4962
|
+
# error PBR fragment shader: Texture LOD is not available
|
|
4963
|
+
#endif
|
|
4964
|
+
|
|
4965
|
+
#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)
|
|
4966
|
+
# error PBR fragment shader: Derivatives are not available
|
|
4967
|
+
#endif
|
|
4968
|
+
|
|
4969
|
+
|
|
4970
|
+
#if (__VERSION__ < 300)
|
|
4971
|
+
#define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)
|
|
4972
|
+
#else
|
|
4973
|
+
#define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)
|
|
4974
|
+
#endif
|
|
4975
|
+
|
|
4976
|
+
precision highp float;
|
|
4977
|
+
|
|
4978
|
+
uniform bool pbr_uUnlit;
|
|
4979
|
+
|
|
4980
|
+
#ifdef USE_IBL
|
|
4981
|
+
uniform samplerCube u_DiffuseEnvSampler;
|
|
4982
|
+
uniform samplerCube u_SpecularEnvSampler;
|
|
4983
|
+
uniform sampler2D u_brdfLUT;
|
|
4984
|
+
uniform vec2 u_ScaleIBLAmbient;
|
|
4985
|
+
#endif
|
|
4986
|
+
|
|
4987
|
+
#ifdef HAS_BASECOLORMAP
|
|
4988
|
+
uniform sampler2D u_BaseColorSampler;
|
|
4989
|
+
#endif
|
|
4990
|
+
#ifdef HAS_NORMALMAP
|
|
4991
|
+
uniform sampler2D u_NormalSampler;
|
|
4992
|
+
uniform float u_NormalScale;
|
|
4993
|
+
#endif
|
|
4994
|
+
#ifdef HAS_EMISSIVEMAP
|
|
4995
|
+
uniform sampler2D u_EmissiveSampler;
|
|
4996
|
+
uniform vec3 u_EmissiveFactor;
|
|
4997
|
+
#endif
|
|
4998
|
+
#ifdef HAS_METALROUGHNESSMAP
|
|
4999
|
+
uniform sampler2D u_MetallicRoughnessSampler;
|
|
5000
|
+
#endif
|
|
5001
|
+
#ifdef HAS_OCCLUSIONMAP
|
|
5002
|
+
uniform sampler2D u_OcclusionSampler;
|
|
5003
|
+
uniform float u_OcclusionStrength;
|
|
5004
|
+
#endif
|
|
5005
|
+
|
|
5006
|
+
#ifdef ALPHA_CUTOFF
|
|
5007
|
+
uniform float u_AlphaCutoff;
|
|
5008
|
+
#endif
|
|
5009
|
+
|
|
5010
|
+
uniform vec2 u_MetallicRoughnessValues;
|
|
5011
|
+
uniform vec4 u_BaseColorFactor;
|
|
5012
|
+
|
|
5013
|
+
uniform vec3 u_Camera;
|
|
5014
|
+
#ifdef PBR_DEBUG
|
|
5015
|
+
uniform vec4 u_ScaleDiffBaseMR;
|
|
5016
|
+
uniform vec4 u_ScaleFGDSpec;
|
|
5017
|
+
#endif
|
|
5018
|
+
|
|
5019
|
+
varying vec3 pbr_vPosition;
|
|
5020
|
+
|
|
5021
|
+
varying vec2 pbr_vUV;
|
|
5022
|
+
|
|
5023
|
+
#ifdef HAS_NORMALS
|
|
5024
|
+
#ifdef HAS_TANGENTS
|
|
5025
|
+
varying mat3 pbr_vTBN;
|
|
5026
|
+
#else
|
|
5027
|
+
varying vec3 pbr_vNormal;
|
|
5028
|
+
#endif
|
|
5029
|
+
#endif
|
|
5030
|
+
|
|
5031
|
+
|
|
5032
|
+
struct PBRInfo
|
|
5033
|
+
{
|
|
5034
|
+
float NdotL;
|
|
5035
|
+
float NdotV;
|
|
5036
|
+
float NdotH;
|
|
5037
|
+
float LdotH;
|
|
5038
|
+
float VdotH;
|
|
5039
|
+
float perceptualRoughness;
|
|
5040
|
+
float metalness;
|
|
5041
|
+
vec3 reflectance0;
|
|
5042
|
+
vec3 reflectance90;
|
|
5043
|
+
float alphaRoughness;
|
|
5044
|
+
vec3 diffuseColor;
|
|
5045
|
+
vec3 specularColor;
|
|
5046
|
+
vec3 n;
|
|
5047
|
+
vec3 v;
|
|
5048
|
+
};
|
|
5049
|
+
|
|
5050
|
+
const float M_PI = 3.141592653589793;
|
|
5051
|
+
const float c_MinRoughness = 0.04;
|
|
5052
|
+
|
|
5053
|
+
vec4 SRGBtoLINEAR(vec4 srgbIn)
|
|
5054
|
+
{
|
|
5055
|
+
#ifdef MANUAL_SRGB
|
|
5056
|
+
#ifdef SRGB_FAST_APPROXIMATION
|
|
5057
|
+
vec3 linOut = pow(srgbIn.xyz,vec3(2.2));
|
|
5058
|
+
#else
|
|
5059
|
+
vec3 bLess = step(vec3(0.04045),srgbIn.xyz);
|
|
5060
|
+
vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );
|
|
5061
|
+
#endif
|
|
5062
|
+
return vec4(linOut,srgbIn.w);;
|
|
5063
|
+
#else
|
|
5064
|
+
return srgbIn;
|
|
5065
|
+
#endif
|
|
5066
|
+
}
|
|
5067
|
+
|
|
5068
|
+
vec3 getNormal()
|
|
5069
|
+
{
|
|
5070
|
+
#ifndef HAS_TANGENTS
|
|
5071
|
+
vec3 pos_dx = dFdx(pbr_vPosition);
|
|
5072
|
+
vec3 pos_dy = dFdy(pbr_vPosition);
|
|
5073
|
+
vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));
|
|
5074
|
+
vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));
|
|
5075
|
+
vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);
|
|
5076
|
+
|
|
5077
|
+
#ifdef HAS_NORMALS
|
|
5078
|
+
vec3 ng = normalize(pbr_vNormal);
|
|
5079
|
+
#else
|
|
5080
|
+
vec3 ng = cross(pos_dx, pos_dy);
|
|
5081
|
+
#endif
|
|
5082
|
+
|
|
5083
|
+
t = normalize(t - ng * dot(ng, t));
|
|
5084
|
+
vec3 b = normalize(cross(ng, t));
|
|
5085
|
+
mat3 tbn = mat3(t, b, ng);
|
|
5086
|
+
#else
|
|
5087
|
+
mat3 tbn = pbr_vTBN;
|
|
5088
|
+
#endif
|
|
5089
|
+
|
|
5090
|
+
#ifdef HAS_NORMALMAP
|
|
5091
|
+
vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;
|
|
5092
|
+
n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));
|
|
5093
|
+
#else
|
|
5094
|
+
vec3 n = normalize(tbn[2].xyz);
|
|
5095
|
+
#endif
|
|
5096
|
+
|
|
5097
|
+
return n;
|
|
5098
|
+
}
|
|
5099
|
+
|
|
5100
|
+
|
|
5101
|
+
#ifdef USE_IBL
|
|
5102
|
+
vec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)
|
|
5103
|
+
{
|
|
5104
|
+
float mipCount = 9.0;
|
|
5105
|
+
float lod = (pbrInputs.perceptualRoughness * mipCount);
|
|
5106
|
+
vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,
|
|
5107
|
+
vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;
|
|
5108
|
+
vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;
|
|
5109
|
+
|
|
5110
|
+
#ifdef USE_TEX_LOD
|
|
5111
|
+
vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;
|
|
5112
|
+
#else
|
|
5113
|
+
vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;
|
|
5114
|
+
#endif
|
|
5115
|
+
|
|
5116
|
+
vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;
|
|
5117
|
+
vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);
|
|
5118
|
+
diffuse *= u_ScaleIBLAmbient.x;
|
|
5119
|
+
specular *= u_ScaleIBLAmbient.y;
|
|
5120
|
+
|
|
5121
|
+
return diffuse + specular;
|
|
5122
|
+
}
|
|
5123
|
+
#endif
|
|
5124
|
+
|
|
5125
|
+
|
|
5126
|
+
vec3 diffuse(PBRInfo pbrInputs)
|
|
5127
|
+
{
|
|
5128
|
+
return pbrInputs.diffuseColor / M_PI;
|
|
5129
|
+
}
|
|
5130
|
+
|
|
5131
|
+
vec3 specularReflection(PBRInfo pbrInputs)
|
|
5132
|
+
{
|
|
5133
|
+
return pbrInputs.reflectance0 +
|
|
5134
|
+
(pbrInputs.reflectance90 - pbrInputs.reflectance0) *
|
|
5135
|
+
pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);
|
|
5136
|
+
}
|
|
5137
|
+
|
|
5138
|
+
|
|
5139
|
+
|
|
5140
|
+
float geometricOcclusion(PBRInfo pbrInputs)
|
|
5141
|
+
{
|
|
5142
|
+
float NdotL = pbrInputs.NdotL;
|
|
5143
|
+
float NdotV = pbrInputs.NdotV;
|
|
5144
|
+
float r = pbrInputs.alphaRoughness;
|
|
5145
|
+
|
|
5146
|
+
float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));
|
|
5147
|
+
float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));
|
|
5148
|
+
return attenuationL * attenuationV;
|
|
5149
|
+
}
|
|
5150
|
+
|
|
5151
|
+
|
|
5152
|
+
|
|
5153
|
+
|
|
5154
|
+
|
|
5155
|
+
float microfacetDistribution(PBRInfo pbrInputs)
|
|
5156
|
+
{
|
|
5157
|
+
float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;
|
|
5158
|
+
float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;
|
|
5159
|
+
return roughnessSq / (M_PI * f * f);
|
|
5160
|
+
}
|
|
5161
|
+
|
|
5162
|
+
void PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {
|
|
5163
|
+
pbrInputs.NdotL = 1.0;
|
|
5164
|
+
pbrInputs.NdotH = 0.0;
|
|
5165
|
+
pbrInputs.LdotH = 0.0;
|
|
5166
|
+
pbrInputs.VdotH = 1.0;
|
|
5167
|
+
}
|
|
5168
|
+
|
|
5169
|
+
void PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {
|
|
5170
|
+
vec3 n = pbrInputs.n;
|
|
5171
|
+
vec3 v = pbrInputs.v;
|
|
5172
|
+
vec3 l = normalize(lightDirection);
|
|
5173
|
+
vec3 h = normalize(l+v);
|
|
5174
|
+
|
|
5175
|
+
pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);
|
|
5176
|
+
pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);
|
|
5177
|
+
pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);
|
|
5178
|
+
pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);
|
|
5179
|
+
}
|
|
5180
|
+
|
|
5181
|
+
void PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {
|
|
5182
|
+
vec3 light_direction = normalize(pointLight.position - pbr_vPosition);
|
|
5183
|
+
PBRInfo_setDirectionalLight(pbrInputs, light_direction);
|
|
5184
|
+
}
|
|
5185
|
+
|
|
5186
|
+
vec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {
|
|
5187
|
+
vec3 F = specularReflection(pbrInputs);
|
|
5188
|
+
float G = geometricOcclusion(pbrInputs);
|
|
5189
|
+
float D = microfacetDistribution(pbrInputs);
|
|
5190
|
+
vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);
|
|
5191
|
+
vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);
|
|
5192
|
+
return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);
|
|
5193
|
+
}
|
|
5194
|
+
|
|
5195
|
+
vec4 pbr_filterColor(vec4 colorUnused)
|
|
5196
|
+
{
|
|
5197
|
+
#ifdef HAS_BASECOLORMAP
|
|
5198
|
+
vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;
|
|
5199
|
+
#else
|
|
5200
|
+
vec4 baseColor = u_BaseColorFactor;
|
|
5201
|
+
#endif
|
|
5202
|
+
|
|
5203
|
+
#ifdef ALPHA_CUTOFF
|
|
5204
|
+
if (baseColor.a < u_AlphaCutoff) {
|
|
5205
|
+
discard;
|
|
5206
|
+
}
|
|
5207
|
+
#endif
|
|
5208
|
+
|
|
5209
|
+
vec3 color = vec3(0, 0, 0);
|
|
5210
|
+
|
|
5211
|
+
if(pbr_uUnlit){
|
|
5212
|
+
color.rgb = baseColor.rgb;
|
|
5213
|
+
}
|
|
5214
|
+
else{
|
|
2815
5215
|
|
|
2816
|
-
for (const light of opts.lights || []) {
|
|
2817
|
-
switch (light.type) {
|
|
2818
|
-
case 'ambient':
|
|
2819
|
-
lightSources.ambientLight = light;
|
|
2820
|
-
break;
|
|
2821
5216
|
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
5217
|
+
float perceptualRoughness = u_MetallicRoughnessValues.y;
|
|
5218
|
+
float metallic = u_MetallicRoughnessValues.x;
|
|
5219
|
+
#ifdef HAS_METALROUGHNESSMAP
|
|
2825
5220
|
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
5221
|
+
vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);
|
|
5222
|
+
perceptualRoughness = mrSample.g * perceptualRoughness;
|
|
5223
|
+
metallic = mrSample.b * metallic;
|
|
5224
|
+
#endif
|
|
5225
|
+
perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);
|
|
5226
|
+
metallic = clamp(metallic, 0.0, 1.0);
|
|
5227
|
+
|
|
5228
|
+
float alphaRoughness = perceptualRoughness * perceptualRoughness;
|
|
5229
|
+
|
|
5230
|
+
vec3 f0 = vec3(0.04);
|
|
5231
|
+
vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);
|
|
5232
|
+
diffuseColor *= 1.0 - metallic;
|
|
5233
|
+
vec3 specularColor = mix(f0, baseColor.rgb, metallic);
|
|
5234
|
+
float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);
|
|
5235
|
+
|
|
5236
|
+
|
|
5237
|
+
|
|
5238
|
+
float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);
|
|
5239
|
+
vec3 specularEnvironmentR0 = specularColor.rgb;
|
|
5240
|
+
vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;
|
|
5241
|
+
|
|
5242
|
+
vec3 n = getNormal();
|
|
5243
|
+
vec3 v = normalize(u_Camera - pbr_vPosition);
|
|
5244
|
+
|
|
5245
|
+
float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);
|
|
5246
|
+
vec3 reflection = -normalize(reflect(v, n));
|
|
5247
|
+
|
|
5248
|
+
PBRInfo pbrInputs = PBRInfo(
|
|
5249
|
+
0.0,
|
|
5250
|
+
NdotV,
|
|
5251
|
+
0.0,
|
|
5252
|
+
0.0,
|
|
5253
|
+
0.0,
|
|
5254
|
+
perceptualRoughness,
|
|
5255
|
+
metallic,
|
|
5256
|
+
specularEnvironmentR0,
|
|
5257
|
+
specularEnvironmentR90,
|
|
5258
|
+
alphaRoughness,
|
|
5259
|
+
diffuseColor,
|
|
5260
|
+
specularColor,
|
|
5261
|
+
n,
|
|
5262
|
+
v
|
|
5263
|
+
);
|
|
2829
5264
|
|
|
2830
|
-
|
|
5265
|
+
#ifdef USE_LIGHTS
|
|
5266
|
+
PBRInfo_setAmbientLight(pbrInputs);
|
|
5267
|
+
color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);
|
|
5268
|
+
SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {
|
|
5269
|
+
if (i < lighting_uDirectionalLightCount) {
|
|
5270
|
+
PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);
|
|
5271
|
+
color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);
|
|
2831
5272
|
}
|
|
2832
5273
|
}
|
|
5274
|
+
SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {
|
|
5275
|
+
if (i < lighting_uPointLightCount) {
|
|
5276
|
+
PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);
|
|
5277
|
+
float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));
|
|
5278
|
+
color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);
|
|
5279
|
+
}
|
|
5280
|
+
}
|
|
5281
|
+
#endif
|
|
5282
|
+
#ifdef USE_IBL
|
|
5283
|
+
color += getIBLContribution(pbrInputs, n, reflection);
|
|
5284
|
+
#endif
|
|
5285
|
+
#ifdef HAS_OCCLUSIONMAP
|
|
5286
|
+
float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;
|
|
5287
|
+
color = mix(color, color * ao, u_OcclusionStrength);
|
|
5288
|
+
#endif
|
|
2833
5289
|
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
5290
|
+
#ifdef HAS_EMISSIVEMAP
|
|
5291
|
+
vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;
|
|
5292
|
+
color += emissive;
|
|
5293
|
+
#endif
|
|
2838
5294
|
|
|
2839
|
-
|
|
2840
|
-
}
|
|
5295
|
+
#ifdef PBR_DEBUG
|
|
2841
5296
|
|
|
2842
|
-
const lights = {
|
|
2843
|
-
name: 'lights',
|
|
2844
|
-
vs: _lights_glsl__WEBPACK_IMPORTED_MODULE_0__["default"],
|
|
2845
|
-
fs: _lights_glsl__WEBPACK_IMPORTED_MODULE_0__["default"],
|
|
2846
|
-
getUniforms,
|
|
2847
|
-
defines: {
|
|
2848
|
-
MAX_LIGHTS: 3
|
|
2849
|
-
}
|
|
2850
|
-
};
|
|
2851
|
-
//# sourceMappingURL=lights.js.map
|
|
2852
5297
|
|
|
2853
|
-
/***/ }),
|
|
2854
5298
|
|
|
2855
|
-
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/module-injectors.js":
|
|
2856
|
-
/*!*********************************************************************************************************!*\
|
|
2857
|
-
!*** /Users/alasarr/dev/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/module-injectors.js ***!
|
|
2858
|
-
\*********************************************************************************************************/
|
|
2859
|
-
/*! exports provided: MODULE_INJECTORS_VS, MODULE_INJECTORS_FS */
|
|
2860
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2861
5299
|
|
|
2862
|
-
"use strict";
|
|
2863
|
-
__webpack_require__.r(__webpack_exports__);
|
|
2864
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MODULE_INJECTORS_VS", function() { return MODULE_INJECTORS_VS; });
|
|
2865
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MODULE_INJECTORS_FS", function() { return MODULE_INJECTORS_FS; });
|
|
2866
|
-
const MODULE_INJECTORS_VS = "#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n";
|
|
2867
|
-
const MODULE_INJECTORS_FS = "#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n";
|
|
2868
|
-
//# sourceMappingURL=module-injectors.js.map
|
|
2869
5300
|
|
|
2870
|
-
|
|
5301
|
+
color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);
|
|
5302
|
+
color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);
|
|
5303
|
+
color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);
|
|
5304
|
+
#endif
|
|
2871
5305
|
|
|
2872
|
-
|
|
2873
|
-
/*!**************************************************************************************************************!*\
|
|
2874
|
-
!*** /Users/alasarr/dev/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/pbr/pbr-fragment.glsl.js ***!
|
|
2875
|
-
\**************************************************************************************************************/
|
|
2876
|
-
/*! exports provided: default */
|
|
2877
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5306
|
+
}
|
|
2878
5307
|
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
5308
|
+
return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);
|
|
5309
|
+
}
|
|
5310
|
+
`);
|
|
2882
5311
|
//# sourceMappingURL=pbr-fragment.glsl.js.map
|
|
2883
5312
|
|
|
2884
5313
|
/***/ }),
|
|
2885
5314
|
|
|
2886
5315
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/pbr/pbr-vertex.glsl.js":
|
|
2887
|
-
|
|
2888
|
-
!*** /Users/
|
|
2889
|
-
|
|
5316
|
+
/*!*************************************************************************************************************!*\
|
|
5317
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/pbr/pbr-vertex.glsl.js ***!
|
|
5318
|
+
\*************************************************************************************************************/
|
|
2890
5319
|
/*! exports provided: default */
|
|
2891
5320
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2892
5321
|
|
|
2893
5322
|
"use strict";
|
|
2894
5323
|
__webpack_require__.r(__webpack_exports__);
|
|
2895
|
-
/* harmony default export */ __webpack_exports__["default"] = (
|
|
5324
|
+
/* harmony default export */ __webpack_exports__["default"] = (`\
|
|
5325
|
+
uniform mat4 u_MVPMatrix;
|
|
5326
|
+
uniform mat4 u_ModelMatrix;
|
|
5327
|
+
uniform mat4 u_NormalMatrix;
|
|
5328
|
+
|
|
5329
|
+
varying vec3 pbr_vPosition;
|
|
5330
|
+
varying vec2 pbr_vUV;
|
|
5331
|
+
|
|
5332
|
+
#ifdef HAS_NORMALS
|
|
5333
|
+
# ifdef HAS_TANGENTS
|
|
5334
|
+
varying mat3 pbr_vTBN;
|
|
5335
|
+
# else
|
|
5336
|
+
varying vec3 pbr_vNormal;
|
|
5337
|
+
# endif
|
|
5338
|
+
#endif
|
|
5339
|
+
|
|
5340
|
+
void pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)
|
|
5341
|
+
{
|
|
5342
|
+
vec4 pos = u_ModelMatrix * position;
|
|
5343
|
+
pbr_vPosition = vec3(pos.xyz) / pos.w;
|
|
5344
|
+
|
|
5345
|
+
#ifdef HAS_NORMALS
|
|
5346
|
+
#ifdef HAS_TANGENTS
|
|
5347
|
+
vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));
|
|
5348
|
+
vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));
|
|
5349
|
+
vec3 bitangentW = cross(normalW, tangentW) * tangent.w;
|
|
5350
|
+
pbr_vTBN = mat3(tangentW, bitangentW, normalW);
|
|
5351
|
+
#else
|
|
5352
|
+
pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));
|
|
5353
|
+
#endif
|
|
5354
|
+
#endif
|
|
5355
|
+
|
|
5356
|
+
#ifdef HAS_UV
|
|
5357
|
+
pbr_vUV = uv;
|
|
5358
|
+
#else
|
|
5359
|
+
pbr_vUV = vec2(0.,0.);
|
|
5360
|
+
#endif
|
|
5361
|
+
}
|
|
5362
|
+
`);
|
|
2896
5363
|
//# sourceMappingURL=pbr-vertex.glsl.js.map
|
|
2897
5364
|
|
|
2898
5365
|
/***/ }),
|
|
2899
5366
|
|
|
2900
5367
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/pbr/pbr.js":
|
|
2901
|
-
|
|
2902
|
-
!*** /Users/
|
|
2903
|
-
|
|
5368
|
+
/*!*************************************************************************************************!*\
|
|
5369
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/pbr/pbr.js ***!
|
|
5370
|
+
\*************************************************************************************************/
|
|
2904
5371
|
/*! exports provided: pbr */
|
|
2905
5372
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2906
5373
|
|
|
@@ -2927,23 +5394,97 @@ const pbr = {
|
|
|
2927
5394
|
/***/ }),
|
|
2928
5395
|
|
|
2929
5396
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.glsl.js":
|
|
2930
|
-
|
|
2931
|
-
!*** /Users/
|
|
2932
|
-
|
|
5397
|
+
/*!****************************************************************************************************************************!*\
|
|
5398
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.glsl.js ***!
|
|
5399
|
+
\****************************************************************************************************************************/
|
|
2933
5400
|
/*! exports provided: default */
|
|
2934
5401
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2935
5402
|
|
|
2936
5403
|
"use strict";
|
|
2937
5404
|
__webpack_require__.r(__webpack_exports__);
|
|
2938
|
-
/* harmony default export */ __webpack_exports__["default"] = (
|
|
5405
|
+
/* harmony default export */ __webpack_exports__["default"] = (`\
|
|
5406
|
+
|
|
5407
|
+
uniform float lighting_uAmbient;
|
|
5408
|
+
uniform float lighting_uDiffuse;
|
|
5409
|
+
uniform float lighting_uShininess;
|
|
5410
|
+
uniform vec3 lighting_uSpecularColor;
|
|
5411
|
+
|
|
5412
|
+
vec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {
|
|
5413
|
+
vec3 halfway_direction = normalize(light_direction + view_direction);
|
|
5414
|
+
float lambertian = dot(light_direction, normal_worldspace);
|
|
5415
|
+
float specular = 0.0;
|
|
5416
|
+
if (lambertian > 0.0) {
|
|
5417
|
+
float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);
|
|
5418
|
+
specular = pow(specular_angle, lighting_uShininess);
|
|
5419
|
+
}
|
|
5420
|
+
lambertian = max(lambertian, 0.0);
|
|
5421
|
+
return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;
|
|
5422
|
+
}
|
|
5423
|
+
|
|
5424
|
+
vec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {
|
|
5425
|
+
vec3 lightColor = surfaceColor;
|
|
5426
|
+
|
|
5427
|
+
if (lighting_uEnabled) {
|
|
5428
|
+
vec3 view_direction = normalize(cameraPosition - position_worldspace);
|
|
5429
|
+
lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;
|
|
5430
|
+
|
|
5431
|
+
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
5432
|
+
if (i >= lighting_uPointLightCount) {
|
|
5433
|
+
break;
|
|
5434
|
+
}
|
|
5435
|
+
PointLight pointLight = lighting_uPointLight[i];
|
|
5436
|
+
vec3 light_position_worldspace = pointLight.position;
|
|
5437
|
+
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
5438
|
+
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
5439
|
+
}
|
|
5440
|
+
|
|
5441
|
+
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
5442
|
+
if (i >= lighting_uDirectionalLightCount) {
|
|
5443
|
+
break;
|
|
5444
|
+
}
|
|
5445
|
+
DirectionalLight directionalLight = lighting_uDirectionalLight[i];
|
|
5446
|
+
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
5447
|
+
}
|
|
5448
|
+
}
|
|
5449
|
+
return lightColor;
|
|
5450
|
+
}
|
|
5451
|
+
|
|
5452
|
+
vec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {
|
|
5453
|
+
vec3 lightColor = vec3(0, 0, 0);
|
|
5454
|
+
vec3 surfaceColor = vec3(0, 0, 0);
|
|
5455
|
+
|
|
5456
|
+
if (lighting_uEnabled) {
|
|
5457
|
+
vec3 view_direction = normalize(cameraPosition - position_worldspace);
|
|
5458
|
+
|
|
5459
|
+
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
5460
|
+
if (i >= lighting_uPointLightCount) {
|
|
5461
|
+
break;
|
|
5462
|
+
}
|
|
5463
|
+
PointLight pointLight = lighting_uPointLight[i];
|
|
5464
|
+
vec3 light_position_worldspace = pointLight.position;
|
|
5465
|
+
vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
|
|
5466
|
+
lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
|
|
5467
|
+
}
|
|
5468
|
+
|
|
5469
|
+
for (int i = 0; i < MAX_LIGHTS; i++) {
|
|
5470
|
+
if (i >= lighting_uDirectionalLightCount) {
|
|
5471
|
+
break;
|
|
5472
|
+
}
|
|
5473
|
+
DirectionalLight directionalLight = lighting_uDirectionalLight[i];
|
|
5474
|
+
lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
|
|
5475
|
+
}
|
|
5476
|
+
}
|
|
5477
|
+
return lightColor;
|
|
5478
|
+
}
|
|
5479
|
+
`);
|
|
2939
5480
|
//# sourceMappingURL=phong-lighting.glsl.js.map
|
|
2940
5481
|
|
|
2941
5482
|
/***/ }),
|
|
2942
5483
|
|
|
2943
5484
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.js":
|
|
2944
|
-
|
|
2945
|
-
!*** /Users/
|
|
2946
|
-
|
|
5485
|
+
/*!***********************************************************************************************************************!*\
|
|
5486
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/phong-lighting/phong-lighting.js ***!
|
|
5487
|
+
\***********************************************************************************************************************/
|
|
2947
5488
|
/*! exports provided: gouraudLighting, phongLighting */
|
|
2948
5489
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2949
5490
|
|
|
@@ -3013,9 +5554,9 @@ const phongLighting = {
|
|
|
3013
5554
|
/***/ }),
|
|
3014
5555
|
|
|
3015
5556
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/picking/picking.js":
|
|
3016
|
-
|
|
3017
|
-
!*** /Users/
|
|
3018
|
-
|
|
5557
|
+
/*!*********************************************************************************************************!*\
|
|
5558
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/picking/picking.js ***!
|
|
5559
|
+
\*********************************************************************************************************/
|
|
3019
5560
|
/*! exports provided: picking */
|
|
3020
5561
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3021
5562
|
|
|
@@ -3061,8 +5602,92 @@ function getUniforms(opts = DEFAULT_MODULE_OPTIONS) {
|
|
|
3061
5602
|
return uniforms;
|
|
3062
5603
|
}
|
|
3063
5604
|
|
|
3064
|
-
const vs =
|
|
3065
|
-
|
|
5605
|
+
const vs = `\
|
|
5606
|
+
uniform bool picking_uActive;
|
|
5607
|
+
uniform bool picking_uAttribute;
|
|
5608
|
+
uniform vec3 picking_uSelectedColor;
|
|
5609
|
+
uniform bool picking_uSelectedColorValid;
|
|
5610
|
+
|
|
5611
|
+
out vec4 picking_vRGBcolor_Avalid;
|
|
5612
|
+
|
|
5613
|
+
const float COLOR_SCALE = 1. / 255.;
|
|
5614
|
+
|
|
5615
|
+
bool picking_isColorValid(vec3 color) {
|
|
5616
|
+
return dot(color, vec3(1.0)) > 0.001;
|
|
5617
|
+
}
|
|
5618
|
+
|
|
5619
|
+
bool isVertexPicked(vec3 vertexColor) {
|
|
5620
|
+
return
|
|
5621
|
+
picking_uSelectedColorValid &&
|
|
5622
|
+
!picking_isColorValid(abs(vertexColor - picking_uSelectedColor));
|
|
5623
|
+
}
|
|
5624
|
+
|
|
5625
|
+
void picking_setPickingColor(vec3 pickingColor) {
|
|
5626
|
+
if (picking_uActive) {
|
|
5627
|
+
picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));
|
|
5628
|
+
|
|
5629
|
+
if (!picking_uAttribute) {
|
|
5630
|
+
picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;
|
|
5631
|
+
}
|
|
5632
|
+
} else {
|
|
5633
|
+
picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));
|
|
5634
|
+
}
|
|
5635
|
+
}
|
|
5636
|
+
|
|
5637
|
+
void picking_setPickingAttribute(float value) {
|
|
5638
|
+
if (picking_uAttribute) {
|
|
5639
|
+
picking_vRGBcolor_Avalid.r = value;
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
void picking_setPickingAttribute(vec2 value) {
|
|
5643
|
+
if (picking_uAttribute) {
|
|
5644
|
+
picking_vRGBcolor_Avalid.rg = value;
|
|
5645
|
+
}
|
|
5646
|
+
}
|
|
5647
|
+
void picking_setPickingAttribute(vec3 value) {
|
|
5648
|
+
if (picking_uAttribute) {
|
|
5649
|
+
picking_vRGBcolor_Avalid.rgb = value;
|
|
5650
|
+
}
|
|
5651
|
+
}
|
|
5652
|
+
`;
|
|
5653
|
+
const fs = `\
|
|
5654
|
+
uniform bool picking_uActive;
|
|
5655
|
+
uniform vec3 picking_uSelectedColor;
|
|
5656
|
+
uniform vec4 picking_uHighlightColor;
|
|
5657
|
+
|
|
5658
|
+
in vec4 picking_vRGBcolor_Avalid;
|
|
5659
|
+
vec4 picking_filterHighlightColor(vec4 color) {
|
|
5660
|
+
if (picking_uActive) {
|
|
5661
|
+
return color;
|
|
5662
|
+
}
|
|
5663
|
+
bool selected = bool(picking_vRGBcolor_Avalid.a);
|
|
5664
|
+
|
|
5665
|
+
if (selected) {
|
|
5666
|
+
float highLightAlpha = picking_uHighlightColor.a;
|
|
5667
|
+
float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);
|
|
5668
|
+
float highLightRatio = highLightAlpha / blendedAlpha;
|
|
5669
|
+
|
|
5670
|
+
vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);
|
|
5671
|
+
return vec4(blendedRGB, blendedAlpha);
|
|
5672
|
+
} else {
|
|
5673
|
+
return color;
|
|
5674
|
+
}
|
|
5675
|
+
}
|
|
5676
|
+
vec4 picking_filterPickingColor(vec4 color) {
|
|
5677
|
+
if (picking_uActive) {
|
|
5678
|
+
if (picking_vRGBcolor_Avalid.a == 0.0) {
|
|
5679
|
+
discard;
|
|
5680
|
+
}
|
|
5681
|
+
return picking_vRGBcolor_Avalid;
|
|
5682
|
+
}
|
|
5683
|
+
return color;
|
|
5684
|
+
}
|
|
5685
|
+
vec4 picking_filterColor(vec4 color) {
|
|
5686
|
+
vec4 highightColor = picking_filterHighlightColor(color);
|
|
5687
|
+
return picking_filterPickingColor(highightColor);
|
|
5688
|
+
}
|
|
5689
|
+
|
|
5690
|
+
`;
|
|
3066
5691
|
const picking = {
|
|
3067
5692
|
name: 'picking',
|
|
3068
5693
|
vs,
|
|
@@ -3074,9 +5699,9 @@ const picking = {
|
|
|
3074
5699
|
/***/ }),
|
|
3075
5700
|
|
|
3076
5701
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/project/project.js":
|
|
3077
|
-
|
|
3078
|
-
!*** /Users/
|
|
3079
|
-
|
|
5702
|
+
/*!*********************************************************************************************************!*\
|
|
5703
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/project/project.js ***!
|
|
5704
|
+
\*********************************************************************************************************/
|
|
3080
5705
|
/*! exports provided: project */
|
|
3081
5706
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3082
5707
|
|
|
@@ -3119,9 +5744,74 @@ function getUniforms(opts = DEFAULT_MODULE_OPTIONS, prevUniforms = {}) {
|
|
|
3119
5744
|
return uniforms;
|
|
3120
5745
|
}
|
|
3121
5746
|
|
|
3122
|
-
const common =
|
|
3123
|
-
|
|
3124
|
-
|
|
5747
|
+
const common = `\
|
|
5748
|
+
varying vec4 project_vPositionWorld;
|
|
5749
|
+
varying vec3 project_vNormalWorld;
|
|
5750
|
+
|
|
5751
|
+
vec4 project_getPosition_World() {
|
|
5752
|
+
return project_vPositionWorld;
|
|
5753
|
+
}
|
|
5754
|
+
|
|
5755
|
+
vec3 project_getNormal_World() {
|
|
5756
|
+
return project_vNormalWorld;
|
|
5757
|
+
}
|
|
5758
|
+
`;
|
|
5759
|
+
const vs = `\
|
|
5760
|
+
${common}
|
|
5761
|
+
uniform mat4 modelMatrix;
|
|
5762
|
+
uniform mat4 viewMatrix;
|
|
5763
|
+
uniform mat4 projectionMatrix;
|
|
5764
|
+
uniform mat4 viewProjectionMatrix;
|
|
5765
|
+
uniform vec3 cameraPositionWorld;
|
|
5766
|
+
|
|
5767
|
+
struct World {
|
|
5768
|
+
vec3 position;
|
|
5769
|
+
vec3 normal;
|
|
5770
|
+
};
|
|
5771
|
+
|
|
5772
|
+
World world;
|
|
5773
|
+
|
|
5774
|
+
void project_setPosition(vec4 position) {
|
|
5775
|
+
project_vPositionWorld = position;
|
|
5776
|
+
}
|
|
5777
|
+
|
|
5778
|
+
void project_setNormal(vec3 normal) {
|
|
5779
|
+
project_vNormalWorld = normal;
|
|
5780
|
+
}
|
|
5781
|
+
|
|
5782
|
+
void project_setPositionAndNormal_World(vec3 position, vec3 normal) {
|
|
5783
|
+
world.position = position;
|
|
5784
|
+
world.normal = normal;
|
|
5785
|
+
}
|
|
5786
|
+
|
|
5787
|
+
void project_setPositionAndNormal_Model(vec3 position, vec3 normal) {
|
|
5788
|
+
world.position = (modelMatrix * vec4(position, 1.)).xyz;
|
|
5789
|
+
world.normal = mat3(modelMatrix) * normal;
|
|
5790
|
+
}
|
|
5791
|
+
|
|
5792
|
+
vec4 project_model_to_clipspace(vec4 position) {
|
|
5793
|
+
return viewProjectionMatrix * modelMatrix * position;
|
|
5794
|
+
}
|
|
5795
|
+
|
|
5796
|
+
vec4 project_model_to_clipspace(vec3 position) {
|
|
5797
|
+
return viewProjectionMatrix * modelMatrix * vec4(position, 1.);
|
|
5798
|
+
}
|
|
5799
|
+
|
|
5800
|
+
vec4 project_world_to_clipspace(vec3 position) {
|
|
5801
|
+
return viewProjectionMatrix * vec4(position, 1.);
|
|
5802
|
+
}
|
|
5803
|
+
|
|
5804
|
+
vec4 project_view_to_clipspace(vec3 position) {
|
|
5805
|
+
return projectionMatrix * vec4(position, 1.);
|
|
5806
|
+
}
|
|
5807
|
+
|
|
5808
|
+
vec4 project_to_clipspace(vec3 position) {
|
|
5809
|
+
return viewProjectionMatrix * vec4(position, 1.);
|
|
5810
|
+
}
|
|
5811
|
+
`;
|
|
5812
|
+
const fs = `
|
|
5813
|
+
${common}\
|
|
5814
|
+
`;
|
|
3125
5815
|
const project = {
|
|
3126
5816
|
name: 'project',
|
|
3127
5817
|
getUniforms,
|
|
@@ -3133,16 +5823,43 @@ const project = {
|
|
|
3133
5823
|
/***/ }),
|
|
3134
5824
|
|
|
3135
5825
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/transform/transform.js":
|
|
3136
|
-
|
|
3137
|
-
!*** /Users/
|
|
3138
|
-
|
|
5826
|
+
/*!*************************************************************************************************************!*\
|
|
5827
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/transform/transform.js ***!
|
|
5828
|
+
\*************************************************************************************************************/
|
|
3139
5829
|
/*! exports provided: transform */
|
|
3140
5830
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3141
5831
|
|
|
3142
5832
|
"use strict";
|
|
3143
5833
|
__webpack_require__.r(__webpack_exports__);
|
|
3144
5834
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return transform; });
|
|
3145
|
-
const vs =
|
|
5835
|
+
const vs = `\
|
|
5836
|
+
attribute float transform_elementID;
|
|
5837
|
+
vec2 transform_getPixelSizeHalf(vec2 size) {
|
|
5838
|
+
return vec2(1.) / (2. * size);
|
|
5839
|
+
}
|
|
5840
|
+
|
|
5841
|
+
vec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {
|
|
5842
|
+
float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);
|
|
5843
|
+
float xIndex = transform_elementID - (yIndex * texSize[0]);
|
|
5844
|
+
return vec2(xIndex, yIndex);
|
|
5845
|
+
}
|
|
5846
|
+
vec2 transform_getTexCoord(vec2 size) {
|
|
5847
|
+
vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);
|
|
5848
|
+
vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);
|
|
5849
|
+
vec2 coord = indices / size + pixelSizeHalf;
|
|
5850
|
+
return coord;
|
|
5851
|
+
}
|
|
5852
|
+
vec2 transform_getPos(vec2 size) {
|
|
5853
|
+
vec2 texCoord = transform_getTexCoord(size);
|
|
5854
|
+
vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);
|
|
5855
|
+
return pos;
|
|
5856
|
+
}
|
|
5857
|
+
vec4 transform_getInput(sampler2D texSampler, vec2 size) {
|
|
5858
|
+
vec2 texCoord = transform_getTexCoord(size);
|
|
5859
|
+
vec4 textureColor = texture2D(texSampler, texCoord);
|
|
5860
|
+
return textureColor;
|
|
5861
|
+
}
|
|
5862
|
+
`;
|
|
3146
5863
|
const transform = {
|
|
3147
5864
|
name: 'transform',
|
|
3148
5865
|
vs,
|
|
@@ -3153,16 +5870,20 @@ const transform = {
|
|
|
3153
5870
|
/***/ }),
|
|
3154
5871
|
|
|
3155
5872
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/modules/utils/random.js":
|
|
3156
|
-
|
|
3157
|
-
!*** /Users/
|
|
3158
|
-
|
|
5873
|
+
/*!******************************************************************************************************!*\
|
|
5874
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/modules/utils/random.js ***!
|
|
5875
|
+
\******************************************************************************************************/
|
|
3159
5876
|
/*! exports provided: random */
|
|
3160
5877
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3161
5878
|
|
|
3162
5879
|
"use strict";
|
|
3163
5880
|
__webpack_require__.r(__webpack_exports__);
|
|
3164
5881
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; });
|
|
3165
|
-
const fs =
|
|
5882
|
+
const fs = `\
|
|
5883
|
+
float random(vec3 scale, float seed) {
|
|
5884
|
+
return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);
|
|
5885
|
+
}
|
|
5886
|
+
`;
|
|
3166
5887
|
const random = {
|
|
3167
5888
|
name: 'random',
|
|
3168
5889
|
fs
|
|
@@ -3172,9 +5893,9 @@ const random = {
|
|
|
3172
5893
|
/***/ }),
|
|
3173
5894
|
|
|
3174
5895
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js":
|
|
3175
|
-
|
|
3176
|
-
!*** /Users/
|
|
3177
|
-
|
|
5896
|
+
/*!**********************************************************************************************!*\
|
|
5897
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/utils/assert.js ***!
|
|
5898
|
+
\**********************************************************************************************/
|
|
3178
5899
|
/*! exports provided: default */
|
|
3179
5900
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3180
5901
|
|
|
@@ -3191,9 +5912,9 @@ function assert(condition, message) {
|
|
|
3191
5912
|
/***/ }),
|
|
3192
5913
|
|
|
3193
5914
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/utils/index.js":
|
|
3194
|
-
|
|
3195
|
-
!*** /Users/
|
|
3196
|
-
|
|
5915
|
+
/*!*********************************************************************************************!*\
|
|
5916
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/utils/index.js ***!
|
|
5917
|
+
\*********************************************************************************************/
|
|
3197
5918
|
/*! exports provided: assert */
|
|
3198
5919
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3199
5920
|
|
|
@@ -3208,9 +5929,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3208
5929
|
/***/ }),
|
|
3209
5930
|
|
|
3210
5931
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/utils/is-old-ie.js":
|
|
3211
|
-
|
|
3212
|
-
!*** /Users/
|
|
3213
|
-
|
|
5932
|
+
/*!*************************************************************************************************!*\
|
|
5933
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/utils/is-old-ie.js ***!
|
|
5934
|
+
\*************************************************************************************************/
|
|
3214
5935
|
/*! exports provided: default */
|
|
3215
5936
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3216
5937
|
|
|
@@ -3229,9 +5950,9 @@ function isOldIE(opts = {}) {
|
|
|
3229
5950
|
/***/ }),
|
|
3230
5951
|
|
|
3231
5952
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/utils/shader-utils.js":
|
|
3232
|
-
|
|
3233
|
-
!*** /Users/
|
|
3234
|
-
|
|
5953
|
+
/*!****************************************************************************************************!*\
|
|
5954
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/utils/shader-utils.js ***!
|
|
5955
|
+
\****************************************************************************************************/
|
|
3235
5956
|
/*! exports provided: getQualifierDetails, getPassthroughFS, typeToChannelSuffix, typeToChannelCount, convertToVec4 */
|
|
3236
5957
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3237
5958
|
|
|
@@ -3244,9 +5965,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3244
5965
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToVec4", function() { return convertToVec4; });
|
|
3245
5966
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../node_modules/@luma.gl/shadertools/dist/esm/utils/index.js");
|
|
3246
5967
|
|
|
3247
|
-
const FS100 =
|
|
3248
|
-
const FS_GLES =
|
|
3249
|
-
|
|
5968
|
+
const FS100 = `void main() {gl_FragColor = vec4(0);}`;
|
|
5969
|
+
const FS_GLES = `\
|
|
5970
|
+
out vec4 transform_output;
|
|
5971
|
+
void main() {
|
|
5972
|
+
transform_output = vec4(0);
|
|
5973
|
+
}`;
|
|
5974
|
+
const FS300 = `#version 300 es\n${FS_GLES}`;
|
|
3250
5975
|
function getQualifierDetails(line, qualifiers) {
|
|
3251
5976
|
qualifiers = Array.isArray(qualifiers) ? qualifiers : [qualifiers];
|
|
3252
5977
|
const words = line.replace(/^\s+/, '').split(/\s+/);
|
|
@@ -3275,7 +6000,7 @@ function getPassthroughFS(options = {}) {
|
|
|
3275
6000
|
if (version === 300) {
|
|
3276
6001
|
return FS300;
|
|
3277
6002
|
} else if (version > 300) {
|
|
3278
|
-
return
|
|
6003
|
+
return `#version ${version}\n${FS_GLES}`;
|
|
3279
6004
|
}
|
|
3280
6005
|
|
|
3281
6006
|
return FS100;
|
|
@@ -3284,10 +6009,20 @@ function getPassthroughFS(options = {}) {
|
|
|
3284
6009
|
const outputValue = convertToVec4(input, inputType);
|
|
3285
6010
|
|
|
3286
6011
|
if (version >= 300) {
|
|
3287
|
-
return
|
|
6012
|
+
return `\
|
|
6013
|
+
#version ${version} ${version === 300 ? 'es' : ''}
|
|
6014
|
+
in ${inputType} ${input};
|
|
6015
|
+
out vec4 ${output};
|
|
6016
|
+
void main() {
|
|
6017
|
+
${output} = ${outputValue};
|
|
6018
|
+
}`;
|
|
3288
6019
|
}
|
|
3289
6020
|
|
|
3290
|
-
return
|
|
6021
|
+
return `\
|
|
6022
|
+
varying ${inputType} ${input};
|
|
6023
|
+
void main() {
|
|
6024
|
+
gl_FragColor = ${outputValue};
|
|
6025
|
+
}`;
|
|
3291
6026
|
}
|
|
3292
6027
|
function typeToChannelSuffix(type) {
|
|
3293
6028
|
switch (type) {
|
|
@@ -3330,13 +6065,13 @@ function typeToChannelCount(type) {
|
|
|
3330
6065
|
function convertToVec4(variable, type) {
|
|
3331
6066
|
switch (type) {
|
|
3332
6067
|
case 'float':
|
|
3333
|
-
return
|
|
6068
|
+
return `vec4(${variable}, 0.0, 0.0, 1.0)`;
|
|
3334
6069
|
|
|
3335
6070
|
case 'vec2':
|
|
3336
|
-
return
|
|
6071
|
+
return `vec4(${variable}, 0.0, 1.0)`;
|
|
3337
6072
|
|
|
3338
6073
|
case 'vec3':
|
|
3339
|
-
return
|
|
6074
|
+
return `vec4(${variable}, 1.0)`;
|
|
3340
6075
|
|
|
3341
6076
|
case 'vec4':
|
|
3342
6077
|
return variable;
|
|
@@ -3351,9 +6086,9 @@ function convertToVec4(variable, type) {
|
|
|
3351
6086
|
/***/ }),
|
|
3352
6087
|
|
|
3353
6088
|
/***/ "../../node_modules/@luma.gl/shadertools/dist/esm/utils/webgl-info.js":
|
|
3354
|
-
|
|
3355
|
-
!*** /Users/
|
|
3356
|
-
|
|
6089
|
+
/*!**************************************************************************************************!*\
|
|
6090
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@luma.gl/shadertools/dist/esm/utils/webgl-info.js ***!
|
|
6091
|
+
\**************************************************************************************************/
|
|
3357
6092
|
/*! exports provided: FEATURES, getContextInfo, canCompileGLGSExtension, hasFeatures */
|
|
3358
6093
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3359
6094
|
|
|
@@ -3437,7 +6172,7 @@ function canCompileGLGSExtension(gl, cap, opts = {}) {
|
|
|
3437
6172
|
|
|
3438
6173
|
const extensionName = feature[0];
|
|
3439
6174
|
const behavior = opts.behavior || 'enable';
|
|
3440
|
-
const source =
|
|
6175
|
+
const source = `#extension GL_${extensionName} : ${behavior}\nvoid main(void) {}`;
|
|
3441
6176
|
const shader = gl.createShader(35633);
|
|
3442
6177
|
gl.shaderSource(shader, source);
|
|
3443
6178
|
gl.compileShader(shader);
|
|
@@ -3465,9 +6200,9 @@ function hasFeatures(gl, features) {
|
|
|
3465
6200
|
/***/ }),
|
|
3466
6201
|
|
|
3467
6202
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js":
|
|
3468
|
-
|
|
3469
|
-
!*** /Users/
|
|
3470
|
-
|
|
6203
|
+
/*!**************************************************************************************************!*\
|
|
6204
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/base/math-array.js ***!
|
|
6205
|
+
\**************************************************************************************************/
|
|
3471
6206
|
/*! exports provided: default */
|
|
3472
6207
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3473
6208
|
|
|
@@ -3746,9 +6481,9 @@ class MathArray extends _extendableBuiltin(Array) {
|
|
|
3746
6481
|
/***/ }),
|
|
3747
6482
|
|
|
3748
6483
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js":
|
|
3749
|
-
|
|
3750
|
-
!*** /Users/
|
|
3751
|
-
|
|
6484
|
+
/*!**********************************************************************************************!*\
|
|
6485
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/base/matrix.js ***!
|
|
6486
|
+
\**********************************************************************************************/
|
|
3752
6487
|
/*! exports provided: default */
|
|
3753
6488
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3754
6489
|
|
|
@@ -3836,9 +6571,9 @@ class Matrix extends _math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
3836
6571
|
/***/ }),
|
|
3837
6572
|
|
|
3838
6573
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js":
|
|
3839
|
-
|
|
3840
|
-
!*** /Users/
|
|
3841
|
-
|
|
6574
|
+
/*!**********************************************************************************************!*\
|
|
6575
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/base/vector.js ***!
|
|
6576
|
+
\**********************************************************************************************/
|
|
3842
6577
|
/*! exports provided: default */
|
|
3843
6578
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3844
6579
|
|
|
@@ -4002,9 +6737,9 @@ class Vector extends _math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
4002
6737
|
/***/ }),
|
|
4003
6738
|
|
|
4004
6739
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/euler.js":
|
|
4005
|
-
|
|
4006
|
-
!*** /Users/
|
|
4007
|
-
|
|
6740
|
+
/*!****************************************************************************************!*\
|
|
6741
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/euler.js ***!
|
|
6742
|
+
\****************************************************************************************/
|
|
4008
6743
|
/*! exports provided: default */
|
|
4009
6744
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4010
6745
|
|
|
@@ -4563,9 +7298,9 @@ class Euler extends _base_math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
4563
7298
|
/***/ }),
|
|
4564
7299
|
|
|
4565
7300
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js":
|
|
4566
|
-
|
|
4567
|
-
!*** /Users/
|
|
4568
|
-
|
|
7301
|
+
/*!******************************************************************************************!*\
|
|
7302
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/matrix3.js ***!
|
|
7303
|
+
\******************************************************************************************/
|
|
4569
7304
|
/*! exports provided: default */
|
|
4570
7305
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4571
7306
|
|
|
@@ -4766,9 +7501,9 @@ class Matrix3 extends _base_matrix__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
4766
7501
|
/***/ }),
|
|
4767
7502
|
|
|
4768
7503
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js":
|
|
4769
|
-
|
|
4770
|
-
!*** /Users/
|
|
4771
|
-
|
|
7504
|
+
/*!******************************************************************************************!*\
|
|
7505
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/matrix4.js ***!
|
|
7506
|
+
\******************************************************************************************/
|
|
4772
7507
|
/*! exports provided: default */
|
|
4773
7508
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4774
7509
|
|
|
@@ -5241,9 +7976,9 @@ class Matrix4 extends _base_matrix__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
|
5241
7976
|
/***/ }),
|
|
5242
7977
|
|
|
5243
7978
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/pose.js":
|
|
5244
|
-
|
|
5245
|
-
!*** /Users/
|
|
5246
|
-
|
|
7979
|
+
/*!***************************************************************************************!*\
|
|
7980
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/pose.js ***!
|
|
7981
|
+
\***************************************************************************************/
|
|
5247
7982
|
/*! exports provided: default */
|
|
5248
7983
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5249
7984
|
|
|
@@ -5377,9 +8112,9 @@ class Pose {
|
|
|
5377
8112
|
/***/ }),
|
|
5378
8113
|
|
|
5379
8114
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js":
|
|
5380
|
-
|
|
5381
|
-
!*** /Users/
|
|
5382
|
-
|
|
8115
|
+
/*!*********************************************************************************************!*\
|
|
8116
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/quaternion.js ***!
|
|
8117
|
+
\*********************************************************************************************/
|
|
5383
8118
|
/*! exports provided: default */
|
|
5384
8119
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5385
8120
|
|
|
@@ -5625,9 +8360,9 @@ class Quaternion extends _base_math_array__WEBPACK_IMPORTED_MODULE_0__["default"
|
|
|
5625
8360
|
/***/ }),
|
|
5626
8361
|
|
|
5627
8362
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/spherical-coordinates.js":
|
|
5628
|
-
|
|
5629
|
-
!*** /Users/
|
|
5630
|
-
|
|
8363
|
+
/*!********************************************************************************************************!*\
|
|
8364
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/spherical-coordinates.js ***!
|
|
8365
|
+
\********************************************************************************************************/
|
|
5631
8366
|
/*! exports provided: default */
|
|
5632
8367
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5633
8368
|
|
|
@@ -5787,9 +8522,9 @@ class SphericalCoordinates {
|
|
|
5787
8522
|
/***/ }),
|
|
5788
8523
|
|
|
5789
8524
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector2.js":
|
|
5790
|
-
|
|
5791
|
-
!*** /Users/
|
|
5792
|
-
|
|
8525
|
+
/*!******************************************************************************************!*\
|
|
8526
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/vector2.js ***!
|
|
8527
|
+
\******************************************************************************************/
|
|
5793
8528
|
/*! exports provided: default */
|
|
5794
8529
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5795
8530
|
|
|
@@ -5899,9 +8634,9 @@ class Vector2 extends _base_vector__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
5899
8634
|
/***/ }),
|
|
5900
8635
|
|
|
5901
8636
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector3.js":
|
|
5902
|
-
|
|
5903
|
-
!*** /Users/
|
|
5904
|
-
|
|
8637
|
+
/*!******************************************************************************************!*\
|
|
8638
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/vector3.js ***!
|
|
8639
|
+
\******************************************************************************************/
|
|
5905
8640
|
/*! exports provided: default */
|
|
5906
8641
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5907
8642
|
|
|
@@ -6057,9 +8792,9 @@ class Vector3 extends _base_vector__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
6057
8792
|
/***/ }),
|
|
6058
8793
|
|
|
6059
8794
|
/***/ "../../node_modules/@math.gl/core/dist/esm/classes/vector4.js":
|
|
6060
|
-
|
|
6061
|
-
!*** /Users/
|
|
6062
|
-
|
|
8795
|
+
/*!******************************************************************************************!*\
|
|
8796
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/classes/vector4.js ***!
|
|
8797
|
+
\******************************************************************************************/
|
|
6063
8798
|
/*! exports provided: default */
|
|
6064
8799
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6065
8800
|
|
|
@@ -6192,9 +8927,9 @@ class Vector4 extends _base_vector__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
6192
8927
|
/***/ }),
|
|
6193
8928
|
|
|
6194
8929
|
/***/ "../../node_modules/@math.gl/core/dist/esm/index.js":
|
|
6195
|
-
|
|
6196
|
-
!*** /Users/
|
|
6197
|
-
|
|
8930
|
+
/*!********************************************************************************!*\
|
|
8931
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/index.js ***!
|
|
8932
|
+
\********************************************************************************/
|
|
6198
8933
|
/*! 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 */
|
|
6199
8934
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6200
8935
|
|
|
@@ -6314,9 +9049,9 @@ global_.mathgl = {
|
|
|
6314
9049
|
/***/ }),
|
|
6315
9050
|
|
|
6316
9051
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/assert.js":
|
|
6317
|
-
|
|
6318
|
-
!*** /Users/
|
|
6319
|
-
|
|
9052
|
+
/*!*************************************************************************************!*\
|
|
9053
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/lib/assert.js ***!
|
|
9054
|
+
\*************************************************************************************/
|
|
6320
9055
|
/*! exports provided: default */
|
|
6321
9056
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6322
9057
|
|
|
@@ -6333,9 +9068,9 @@ function assert(condition, message) {
|
|
|
6333
9068
|
/***/ }),
|
|
6334
9069
|
|
|
6335
9070
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/common.js":
|
|
6336
|
-
|
|
6337
|
-
!*** /Users/
|
|
6338
|
-
|
|
9071
|
+
/*!*************************************************************************************!*\
|
|
9072
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/lib/common.js ***!
|
|
9073
|
+
\*************************************************************************************/
|
|
6339
9074
|
/*! exports provided: config, configure, formatValue, isArray, clone, toRadians, toDegrees, radians, degrees, sin, cos, tan, asin, acos, atan, clamp, lerp, equals, exactEquals, withEpsilon */
|
|
6340
9075
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6341
9076
|
|
|
@@ -6550,9 +9285,9 @@ function withEpsilon(EPSILON, func) {
|
|
|
6550
9285
|
/***/ }),
|
|
6551
9286
|
|
|
6552
9287
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js":
|
|
6553
|
-
|
|
6554
|
-
!*** /Users/
|
|
6555
|
-
|
|
9288
|
+
/*!***********************************************************************************************!*\
|
|
9289
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/lib/gl-matrix-extras.js ***!
|
|
9290
|
+
\***********************************************************************************************/
|
|
6556
9291
|
/*! exports provided: vec2_transformMat4AsVector, vec3_transformMat4AsVector, vec3_transformMat2, vec4_transformMat2, vec4_transformMat3 */
|
|
6557
9292
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6558
9293
|
|
|
@@ -6613,9 +9348,9 @@ function vec4_transformMat3(out, a, m) {
|
|
|
6613
9348
|
/***/ }),
|
|
6614
9349
|
|
|
6615
9350
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/math-utils.js":
|
|
6616
|
-
|
|
6617
|
-
!*** /Users/
|
|
6618
|
-
|
|
9351
|
+
/*!*****************************************************************************************!*\
|
|
9352
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/lib/math-utils.js ***!
|
|
9353
|
+
\*****************************************************************************************/
|
|
6619
9354
|
/*! exports provided: default */
|
|
6620
9355
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6621
9356
|
|
|
@@ -6652,9 +9387,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6652
9387
|
/***/ }),
|
|
6653
9388
|
|
|
6654
9389
|
/***/ "../../node_modules/@math.gl/core/dist/esm/lib/validators.js":
|
|
6655
|
-
|
|
6656
|
-
!*** /Users/
|
|
6657
|
-
|
|
9390
|
+
/*!*****************************************************************************************!*\
|
|
9391
|
+
!*** /Users/missx/Source/deck.gl/node_modules/@math.gl/core/dist/esm/lib/validators.js ***!
|
|
9392
|
+
\*****************************************************************************************/
|
|
6658
9393
|
/*! exports provided: validateVector, checkNumber, checkVector, deprecated */
|
|
6659
9394
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6660
9395
|
|
|
@@ -6705,9 +9440,9 @@ function deprecated(method, version) {
|
|
|
6705
9440
|
/***/ }),
|
|
6706
9441
|
|
|
6707
9442
|
/***/ "../../node_modules/gl-matrix/esm/common.js":
|
|
6708
|
-
|
|
6709
|
-
!*** /Users/
|
|
6710
|
-
|
|
9443
|
+
/*!************************************************************************!*\
|
|
9444
|
+
!*** /Users/missx/Source/deck.gl/node_modules/gl-matrix/esm/common.js ***!
|
|
9445
|
+
\************************************************************************/
|
|
6711
9446
|
/*! exports provided: EPSILON, ARRAY_TYPE, RANDOM, setMatrixArrayType, toRadian, equals */
|
|
6712
9447
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6713
9448
|
|
|
@@ -6773,9 +9508,9 @@ if (!Math.hypot) Math.hypot = function () {
|
|
|
6773
9508
|
/***/ }),
|
|
6774
9509
|
|
|
6775
9510
|
/***/ "../../node_modules/gl-matrix/esm/mat3.js":
|
|
6776
|
-
|
|
6777
|
-
!*** /Users/
|
|
6778
|
-
|
|
9511
|
+
/*!**********************************************************************!*\
|
|
9512
|
+
!*** /Users/missx/Source/deck.gl/node_modules/gl-matrix/esm/mat3.js ***!
|
|
9513
|
+
\**********************************************************************/
|
|
6779
9514
|
/*! 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 */
|
|
6780
9515
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6781
9516
|
|
|
@@ -7596,9 +10331,9 @@ var sub = subtract;
|
|
|
7596
10331
|
/***/ }),
|
|
7597
10332
|
|
|
7598
10333
|
/***/ "../../node_modules/gl-matrix/esm/mat4.js":
|
|
7599
|
-
|
|
7600
|
-
!*** /Users/
|
|
7601
|
-
|
|
10334
|
+
/*!**********************************************************************!*\
|
|
10335
|
+
!*** /Users/missx/Source/deck.gl/node_modules/gl-matrix/esm/mat4.js ***!
|
|
10336
|
+
\**********************************************************************/
|
|
7602
10337
|
/*! 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 */
|
|
7603
10338
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7604
10339
|
|
|
@@ -9470,9 +12205,9 @@ var sub = subtract;
|
|
|
9470
12205
|
/***/ }),
|
|
9471
12206
|
|
|
9472
12207
|
/***/ "../../node_modules/gl-matrix/esm/quat.js":
|
|
9473
|
-
|
|
9474
|
-
!*** /Users/
|
|
9475
|
-
|
|
12208
|
+
/*!**********************************************************************!*\
|
|
12209
|
+
!*** /Users/missx/Source/deck.gl/node_modules/gl-matrix/esm/quat.js ***!
|
|
12210
|
+
\**********************************************************************/
|
|
9476
12211
|
/*! 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 */
|
|
9477
12212
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9478
12213
|
|
|
@@ -10235,9 +12970,9 @@ var setAxes = function () {
|
|
|
10235
12970
|
/***/ }),
|
|
10236
12971
|
|
|
10237
12972
|
/***/ "../../node_modules/gl-matrix/esm/vec2.js":
|
|
10238
|
-
|
|
10239
|
-
!*** /Users/
|
|
10240
|
-
|
|
12973
|
+
/*!**********************************************************************!*\
|
|
12974
|
+
!*** /Users/missx/Source/deck.gl/node_modules/gl-matrix/esm/vec2.js ***!
|
|
12975
|
+
\**********************************************************************/
|
|
10241
12976
|
/*! 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 */
|
|
10242
12977
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10243
12978
|
|
|
@@ -10917,9 +13652,9 @@ var forEach = function () {
|
|
|
10917
13652
|
/***/ }),
|
|
10918
13653
|
|
|
10919
13654
|
/***/ "../../node_modules/gl-matrix/esm/vec3.js":
|
|
10920
|
-
|
|
10921
|
-
!*** /Users/
|
|
10922
|
-
|
|
13655
|
+
/*!**********************************************************************!*\
|
|
13656
|
+
!*** /Users/missx/Source/deck.gl/node_modules/gl-matrix/esm/vec3.js ***!
|
|
13657
|
+
\**********************************************************************/
|
|
10923
13658
|
/*! 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 */
|
|
10924
13659
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10925
13660
|
|
|
@@ -11765,9 +14500,9 @@ var forEach = function () {
|
|
|
11765
14500
|
/***/ }),
|
|
11766
14501
|
|
|
11767
14502
|
/***/ "../../node_modules/gl-matrix/esm/vec4.js":
|
|
11768
|
-
|
|
11769
|
-
!*** /Users/
|
|
11770
|
-
|
|
14503
|
+
/*!**********************************************************************!*\
|
|
14504
|
+
!*** /Users/missx/Source/deck.gl/node_modules/gl-matrix/esm/vec4.js ***!
|
|
14505
|
+
\**********************************************************************/
|
|
11771
14506
|
/*! 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 */
|
|
11772
14507
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
11773
14508
|
|