@mapcatch/util 2.0.4 → 2.0.5-b
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/README.md +44 -0
- package/dist/catchUtil.min.esm.js +56 -102
- package/dist/catchUtil.min.js +2 -2
- package/package.json +26 -2
- package/src/constants/crs.js +42098 -42098
- package/src/constants/default_layers.js +42 -94
- package/src/gl-operations/constants.js +9 -9
- package/src/gl-operations/default_options.js +97 -97
- package/src/gl-operations/index.js +532 -532
- package/src/gl-operations/reglCommands/contours.js +27 -27
- package/src/gl-operations/reglCommands/default.js +45 -45
- package/src/gl-operations/reglCommands/hillshading.js +340 -340
- package/src/gl-operations/reglCommands/index.js +6 -6
- package/src/gl-operations/reglCommands/multiLayers.js +303 -303
- package/src/gl-operations/reglCommands/transitions.js +111 -111
- package/src/gl-operations/reglCommands/util.js +71 -71
- package/src/gl-operations/renderer.js +209 -209
- package/src/gl-operations/shaders/fragment/convertDem.js +25 -25
- package/src/gl-operations/shaders/fragment/convolutionSmooth.js +54 -54
- package/src/gl-operations/shaders/fragment/diffCalc.js +33 -33
- package/src/gl-operations/shaders/fragment/drawResult.js +46 -46
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +78 -78
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +59 -59
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +30 -30
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +60 -60
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +26 -26
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +25 -25
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +53 -53
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +80 -80
- package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +54 -54
- package/src/gl-operations/shaders/fragment/interpolateColor.js +65 -65
- package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +49 -49
- package/src/gl-operations/shaders/fragment/interpolateValue.js +136 -136
- package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +35 -35
- package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +45 -45
- package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +53 -53
- package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +61 -61
- package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +69 -69
- package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +77 -77
- package/src/gl-operations/shaders/fragment/single.js +93 -93
- package/src/gl-operations/shaders/transform.js +21 -21
- package/src/gl-operations/shaders/util/computeColor.glsl +85 -85
- package/src/gl-operations/shaders/util/getTexelValue.glsl +10 -10
- package/src/gl-operations/shaders/util/isCloseEnough.glsl +9 -9
- package/src/gl-operations/shaders/util/rgbaToFloat.glsl +17 -17
- package/src/gl-operations/shaders/vertex/double.js +16 -16
- package/src/gl-operations/shaders/vertex/multi3.js +19 -19
- package/src/gl-operations/shaders/vertex/multi4.js +22 -22
- package/src/gl-operations/shaders/vertex/multi5.js +25 -25
- package/src/gl-operations/shaders/vertex/multi6.js +28 -28
- package/src/gl-operations/shaders/vertex/single.js +13 -13
- package/src/gl-operations/shaders/vertex/singleNotTransformed.js +11 -11
- package/src/gl-operations/texture_manager.js +141 -141
- package/src/gl-operations/util.js +336 -336
- package/src/util.js +14 -6
- package/CHANGELOG.md +0 -72
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#define TRANSPARENT vec4(0.0)
|
|
10
|
-
|
|
11
|
-
#pragma glslify: computeColor = require(../util/computeColor.glsl)
|
|
12
|
-
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
13
|
-
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
14
|
-
|
|
15
|
-
uniform int scaleLength;
|
|
16
|
-
uniform int sentinelLength;
|
|
17
|
-
uniform sampler2D scaleColormap;
|
|
18
|
-
uniform sampler2D sentinelColormap;
|
|
19
|
-
|
|
20
|
-
uniform float nodataValue;
|
|
21
|
-
uniform sampler2D textureA;
|
|
22
|
-
uniform sampler2D textureB;
|
|
23
|
-
uniform bool littleEndian;
|
|
24
|
-
uniform float interpolationFraction;
|
|
25
|
-
|
|
26
|
-
uniform vec4 aboveColor;
|
|
27
|
-
uniform vec4 belowColor;
|
|
28
|
-
|
|
29
|
-
varying vec2 vTexCoordA;
|
|
30
|
-
varying vec2 vTexCoordB;
|
|
31
|
-
|
|
32
|
-
bool isSentinelValue(sampler2D sentinelColormap, int len, float value) {
|
|
33
|
-
for (int i = 0; i < SENTINEL_MAX_LENGTH; ++i) {
|
|
34
|
-
if (i == len) {
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
float i_f = float(i);
|
|
38
|
-
float lenFloat = float(len);
|
|
39
|
-
float sentinelOffset = getTexelValue(sentinelColormap, vec2((i_f + 0.5) / lenFloat, 0.75), littleEndian);
|
|
40
|
-
if (isCloseEnough(sentinelOffset, value)) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
void main() {
|
|
48
|
-
if (interpolationFraction <= 0.0) {
|
|
49
|
-
float texelFloat = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
50
|
-
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
51
|
-
discard;
|
|
52
|
-
}
|
|
53
|
-
gl_FragColor = computeColor(
|
|
54
|
-
texelFloat,
|
|
55
|
-
scaleColormap,
|
|
56
|
-
sentinelColormap,
|
|
57
|
-
scaleLength,
|
|
58
|
-
sentinelLength,
|
|
59
|
-
littleEndian,
|
|
60
|
-
aboveColor,
|
|
61
|
-
belowColor
|
|
62
|
-
);
|
|
63
|
-
} else if (interpolationFraction >= 1.0) {
|
|
64
|
-
float texelFloat = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
65
|
-
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
66
|
-
discard;
|
|
67
|
-
}
|
|
68
|
-
gl_FragColor = computeColor(
|
|
69
|
-
texelFloat,
|
|
70
|
-
scaleColormap,
|
|
71
|
-
sentinelColormap,
|
|
72
|
-
scaleLength,
|
|
73
|
-
sentinelLength,
|
|
74
|
-
littleEndian,
|
|
75
|
-
aboveColor,
|
|
76
|
-
belowColor
|
|
77
|
-
);
|
|
78
|
-
} else {
|
|
79
|
-
// retrieve and decode pixel value from both tiles
|
|
80
|
-
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
81
|
-
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
82
|
-
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
83
|
-
bool bIsNodata = isCloseEnough(texelFloatB, nodataValue);
|
|
84
|
-
if (aIsNodata && bIsNodata) {
|
|
85
|
-
discard;
|
|
86
|
-
} else if (
|
|
87
|
-
aIsNodata
|
|
88
|
-
|| bIsNodata
|
|
89
|
-
|| scaleLength == 0
|
|
90
|
-
|| isSentinelValue(sentinelColormap, sentinelLength, texelFloatA)
|
|
91
|
-
|| isSentinelValue(sentinelColormap, sentinelLength, texelFloatB)
|
|
92
|
-
) {
|
|
93
|
-
vec4 colorA = (
|
|
94
|
-
aIsNodata
|
|
95
|
-
? TRANSPARENT
|
|
96
|
-
: computeColor(
|
|
97
|
-
texelFloatA,
|
|
98
|
-
scaleColormap,
|
|
99
|
-
sentinelColormap,
|
|
100
|
-
scaleLength,
|
|
101
|
-
sentinelLength,
|
|
102
|
-
littleEndian,
|
|
103
|
-
aboveColor,
|
|
104
|
-
belowColor
|
|
105
|
-
)
|
|
106
|
-
);
|
|
107
|
-
vec4 colorB = (
|
|
108
|
-
bIsNodata
|
|
109
|
-
? TRANSPARENT
|
|
110
|
-
: computeColor(
|
|
111
|
-
texelFloatB,
|
|
112
|
-
scaleColormap,
|
|
113
|
-
sentinelColormap,
|
|
114
|
-
scaleLength,
|
|
115
|
-
sentinelLength,
|
|
116
|
-
littleEndian,
|
|
117
|
-
aboveColor,
|
|
118
|
-
belowColor
|
|
119
|
-
)
|
|
120
|
-
);
|
|
121
|
-
gl_FragColor = mix(colorA, colorB, interpolationFraction);
|
|
122
|
-
} else {
|
|
123
|
-
float interpolated = mix(texelFloatA, texelFloatB, interpolationFraction);
|
|
124
|
-
gl_FragColor = computeColor(
|
|
125
|
-
interpolated,
|
|
126
|
-
scaleColormap,
|
|
127
|
-
sentinelColormap,
|
|
128
|
-
scaleLength,
|
|
129
|
-
sentinelLength,
|
|
130
|
-
littleEndian,
|
|
131
|
-
aboveColor,
|
|
132
|
-
belowColor
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
1
|
+
import glsl from 'glslify'
|
|
2
|
+
|
|
3
|
+
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
+
precision highp float;
|
|
5
|
+
#else
|
|
6
|
+
precision mediump float;
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
#define TRANSPARENT vec4(0.0)
|
|
10
|
+
|
|
11
|
+
#pragma glslify: computeColor = require(../util/computeColor.glsl)
|
|
12
|
+
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
13
|
+
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
14
|
+
|
|
15
|
+
uniform int scaleLength;
|
|
16
|
+
uniform int sentinelLength;
|
|
17
|
+
uniform sampler2D scaleColormap;
|
|
18
|
+
uniform sampler2D sentinelColormap;
|
|
19
|
+
|
|
20
|
+
uniform float nodataValue;
|
|
21
|
+
uniform sampler2D textureA;
|
|
22
|
+
uniform sampler2D textureB;
|
|
23
|
+
uniform bool littleEndian;
|
|
24
|
+
uniform float interpolationFraction;
|
|
25
|
+
|
|
26
|
+
uniform vec4 aboveColor;
|
|
27
|
+
uniform vec4 belowColor;
|
|
28
|
+
|
|
29
|
+
varying vec2 vTexCoordA;
|
|
30
|
+
varying vec2 vTexCoordB;
|
|
31
|
+
|
|
32
|
+
bool isSentinelValue(sampler2D sentinelColormap, int len, float value) {
|
|
33
|
+
for (int i = 0; i < SENTINEL_MAX_LENGTH; ++i) {
|
|
34
|
+
if (i == len) {
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
float i_f = float(i);
|
|
38
|
+
float lenFloat = float(len);
|
|
39
|
+
float sentinelOffset = getTexelValue(sentinelColormap, vec2((i_f + 0.5) / lenFloat, 0.75), littleEndian);
|
|
40
|
+
if (isCloseEnough(sentinelOffset, value)) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
void main() {
|
|
48
|
+
if (interpolationFraction <= 0.0) {
|
|
49
|
+
float texelFloat = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
50
|
+
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
51
|
+
discard;
|
|
52
|
+
}
|
|
53
|
+
gl_FragColor = computeColor(
|
|
54
|
+
texelFloat,
|
|
55
|
+
scaleColormap,
|
|
56
|
+
sentinelColormap,
|
|
57
|
+
scaleLength,
|
|
58
|
+
sentinelLength,
|
|
59
|
+
littleEndian,
|
|
60
|
+
aboveColor,
|
|
61
|
+
belowColor
|
|
62
|
+
);
|
|
63
|
+
} else if (interpolationFraction >= 1.0) {
|
|
64
|
+
float texelFloat = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
65
|
+
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
66
|
+
discard;
|
|
67
|
+
}
|
|
68
|
+
gl_FragColor = computeColor(
|
|
69
|
+
texelFloat,
|
|
70
|
+
scaleColormap,
|
|
71
|
+
sentinelColormap,
|
|
72
|
+
scaleLength,
|
|
73
|
+
sentinelLength,
|
|
74
|
+
littleEndian,
|
|
75
|
+
aboveColor,
|
|
76
|
+
belowColor
|
|
77
|
+
);
|
|
78
|
+
} else {
|
|
79
|
+
// retrieve and decode pixel value from both tiles
|
|
80
|
+
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
81
|
+
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
82
|
+
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
83
|
+
bool bIsNodata = isCloseEnough(texelFloatB, nodataValue);
|
|
84
|
+
if (aIsNodata && bIsNodata) {
|
|
85
|
+
discard;
|
|
86
|
+
} else if (
|
|
87
|
+
aIsNodata
|
|
88
|
+
|| bIsNodata
|
|
89
|
+
|| scaleLength == 0
|
|
90
|
+
|| isSentinelValue(sentinelColormap, sentinelLength, texelFloatA)
|
|
91
|
+
|| isSentinelValue(sentinelColormap, sentinelLength, texelFloatB)
|
|
92
|
+
) {
|
|
93
|
+
vec4 colorA = (
|
|
94
|
+
aIsNodata
|
|
95
|
+
? TRANSPARENT
|
|
96
|
+
: computeColor(
|
|
97
|
+
texelFloatA,
|
|
98
|
+
scaleColormap,
|
|
99
|
+
sentinelColormap,
|
|
100
|
+
scaleLength,
|
|
101
|
+
sentinelLength,
|
|
102
|
+
littleEndian,
|
|
103
|
+
aboveColor,
|
|
104
|
+
belowColor
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
vec4 colorB = (
|
|
108
|
+
bIsNodata
|
|
109
|
+
? TRANSPARENT
|
|
110
|
+
: computeColor(
|
|
111
|
+
texelFloatB,
|
|
112
|
+
scaleColormap,
|
|
113
|
+
sentinelColormap,
|
|
114
|
+
scaleLength,
|
|
115
|
+
sentinelLength,
|
|
116
|
+
littleEndian,
|
|
117
|
+
aboveColor,
|
|
118
|
+
belowColor
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
gl_FragColor = mix(colorA, colorB, interpolationFraction);
|
|
122
|
+
} else {
|
|
123
|
+
float interpolated = mix(texelFloatA, texelFloatB, interpolationFraction);
|
|
124
|
+
gl_FragColor = computeColor(
|
|
125
|
+
interpolated,
|
|
126
|
+
scaleColormap,
|
|
127
|
+
sentinelColormap,
|
|
128
|
+
scaleLength,
|
|
129
|
+
sentinelLength,
|
|
130
|
+
littleEndian,
|
|
131
|
+
aboveColor,
|
|
132
|
+
belowColor
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
137
|
`
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
10
|
-
#pragma glslify: floatToRgba = require(glsl-float-to-rgba)
|
|
11
|
-
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
12
|
-
|
|
13
|
-
uniform sampler2D textureA;
|
|
14
|
-
|
|
15
|
-
uniform float nodataValue;
|
|
16
|
-
uniform bool littleEndian;
|
|
17
|
-
|
|
18
|
-
uniform float filterLowA;
|
|
19
|
-
uniform float filterHighA;
|
|
20
|
-
uniform float multiplierA;
|
|
21
|
-
|
|
22
|
-
varying vec2 vTexCoord;
|
|
23
|
-
|
|
24
|
-
void main() {
|
|
25
|
-
float texelFloatA = getTexelValue(textureA, vTexCoord, littleEndian);
|
|
26
|
-
|
|
27
|
-
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
28
|
-
|
|
29
|
-
if (aIsNodata || texelFloatA < filterLowA || texelFloatA > filterHighA) {
|
|
30
|
-
gl_FragColor = floatToRgba(nodataValue, littleEndian);
|
|
31
|
-
} else {
|
|
32
|
-
float texelFloatFinal = texelFloatA * multiplierA;
|
|
33
|
-
gl_FragColor = floatToRgba(texelFloatFinal, littleEndian);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
import glsl from 'glslify'
|
|
2
|
+
|
|
3
|
+
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
+
precision highp float;
|
|
5
|
+
#else
|
|
6
|
+
precision mediump float;
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
10
|
+
#pragma glslify: floatToRgba = require(glsl-float-to-rgba)
|
|
11
|
+
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
12
|
+
|
|
13
|
+
uniform sampler2D textureA;
|
|
14
|
+
|
|
15
|
+
uniform float nodataValue;
|
|
16
|
+
uniform bool littleEndian;
|
|
17
|
+
|
|
18
|
+
uniform float filterLowA;
|
|
19
|
+
uniform float filterHighA;
|
|
20
|
+
uniform float multiplierA;
|
|
21
|
+
|
|
22
|
+
varying vec2 vTexCoord;
|
|
23
|
+
|
|
24
|
+
void main() {
|
|
25
|
+
float texelFloatA = getTexelValue(textureA, vTexCoord, littleEndian);
|
|
26
|
+
|
|
27
|
+
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
28
|
+
|
|
29
|
+
if (aIsNodata || texelFloatA < filterLowA || texelFloatA > filterHighA) {
|
|
30
|
+
gl_FragColor = floatToRgba(nodataValue, littleEndian);
|
|
31
|
+
} else {
|
|
32
|
+
float texelFloatFinal = texelFloatA * multiplierA;
|
|
33
|
+
gl_FragColor = floatToRgba(texelFloatFinal, littleEndian);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
36
|
`
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
10
|
-
#pragma glslify: floatToRgba = require(glsl-float-to-rgba)
|
|
11
|
-
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
12
|
-
|
|
13
|
-
uniform sampler2D textureA;
|
|
14
|
-
uniform sampler2D textureB;
|
|
15
|
-
|
|
16
|
-
uniform float nodataValue;
|
|
17
|
-
uniform bool littleEndian;
|
|
18
|
-
|
|
19
|
-
uniform float filterLowA;
|
|
20
|
-
uniform float filterHighA;
|
|
21
|
-
uniform float filterLowB;
|
|
22
|
-
uniform float filterHighB;
|
|
23
|
-
uniform float multiplierA;
|
|
24
|
-
uniform float multiplierB;
|
|
25
|
-
|
|
26
|
-
varying vec2 vTexCoordA;
|
|
27
|
-
varying vec2 vTexCoordB;
|
|
28
|
-
|
|
29
|
-
void main() {
|
|
30
|
-
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
31
|
-
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
32
|
-
|
|
33
|
-
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
34
|
-
bool bIsNodata = isCloseEnough(texelFloatB, nodataValue);
|
|
35
|
-
|
|
36
|
-
if (aIsNodata || bIsNodata ||
|
|
37
|
-
texelFloatA < filterLowA || texelFloatA > filterHighA ||
|
|
38
|
-
texelFloatB < filterLowB || texelFloatB > filterHighB
|
|
39
|
-
) {
|
|
40
|
-
gl_FragColor = floatToRgba(nodataValue, littleEndian);
|
|
41
|
-
} else {
|
|
42
|
-
float texelFloatFinal = texelFloatA * multiplierA + texelFloatB * multiplierB;
|
|
43
|
-
gl_FragColor = floatToRgba(texelFloatFinal, littleEndian);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
import glsl from 'glslify'
|
|
2
|
+
|
|
3
|
+
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
+
precision highp float;
|
|
5
|
+
#else
|
|
6
|
+
precision mediump float;
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
10
|
+
#pragma glslify: floatToRgba = require(glsl-float-to-rgba)
|
|
11
|
+
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
12
|
+
|
|
13
|
+
uniform sampler2D textureA;
|
|
14
|
+
uniform sampler2D textureB;
|
|
15
|
+
|
|
16
|
+
uniform float nodataValue;
|
|
17
|
+
uniform bool littleEndian;
|
|
18
|
+
|
|
19
|
+
uniform float filterLowA;
|
|
20
|
+
uniform float filterHighA;
|
|
21
|
+
uniform float filterLowB;
|
|
22
|
+
uniform float filterHighB;
|
|
23
|
+
uniform float multiplierA;
|
|
24
|
+
uniform float multiplierB;
|
|
25
|
+
|
|
26
|
+
varying vec2 vTexCoordA;
|
|
27
|
+
varying vec2 vTexCoordB;
|
|
28
|
+
|
|
29
|
+
void main() {
|
|
30
|
+
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
31
|
+
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
32
|
+
|
|
33
|
+
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
34
|
+
bool bIsNodata = isCloseEnough(texelFloatB, nodataValue);
|
|
35
|
+
|
|
36
|
+
if (aIsNodata || bIsNodata ||
|
|
37
|
+
texelFloatA < filterLowA || texelFloatA > filterHighA ||
|
|
38
|
+
texelFloatB < filterLowB || texelFloatB > filterHighB
|
|
39
|
+
) {
|
|
40
|
+
gl_FragColor = floatToRgba(nodataValue, littleEndian);
|
|
41
|
+
} else {
|
|
42
|
+
float texelFloatFinal = texelFloatA * multiplierA + texelFloatB * multiplierB;
|
|
43
|
+
gl_FragColor = floatToRgba(texelFloatFinal, littleEndian);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
46
|
`
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
10
|
-
#pragma glslify: floatToRgba = require(glsl-float-to-rgba)
|
|
11
|
-
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
12
|
-
|
|
13
|
-
uniform sampler2D textureA;
|
|
14
|
-
uniform sampler2D textureB;
|
|
15
|
-
uniform sampler2D textureC;
|
|
16
|
-
|
|
17
|
-
uniform float nodataValue;
|
|
18
|
-
uniform bool littleEndian;
|
|
19
|
-
|
|
20
|
-
uniform float filterLowA;
|
|
21
|
-
uniform float filterHighA;
|
|
22
|
-
uniform float filterLowB;
|
|
23
|
-
uniform float filterHighB;
|
|
24
|
-
uniform float filterLowC;
|
|
25
|
-
uniform float filterHighC;
|
|
26
|
-
uniform float multiplierA;
|
|
27
|
-
uniform float multiplierB;
|
|
28
|
-
uniform float multiplierC;
|
|
29
|
-
|
|
30
|
-
varying vec2 vTexCoordA;
|
|
31
|
-
varying vec2 vTexCoordB;
|
|
32
|
-
varying vec2 vTexCoordC;
|
|
33
|
-
|
|
34
|
-
void main() {
|
|
35
|
-
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
36
|
-
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
37
|
-
float texelFloatC = getTexelValue(textureC, vTexCoordC, littleEndian);
|
|
38
|
-
|
|
39
|
-
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
40
|
-
bool bIsNodata = isCloseEnough(texelFloatB, nodataValue);
|
|
41
|
-
bool cIsNodata = isCloseEnough(texelFloatC, nodataValue);
|
|
42
|
-
|
|
43
|
-
if (aIsNodata || bIsNodata || cIsNodata ||
|
|
44
|
-
texelFloatA < filterLowA || texelFloatA > filterHighA ||
|
|
45
|
-
texelFloatB < filterLowB || texelFloatB > filterHighB ||
|
|
46
|
-
texelFloatC < filterLowC || texelFloatC > filterHighC
|
|
47
|
-
) {
|
|
48
|
-
gl_FragColor = floatToRgba(nodataValue, littleEndian);
|
|
49
|
-
} else {
|
|
50
|
-
float texelFloatFinal = texelFloatA * multiplierA + texelFloatB * multiplierB + texelFloatC * multiplierC;
|
|
51
|
-
gl_FragColor = floatToRgba(texelFloatFinal, littleEndian);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
import glsl from 'glslify'
|
|
2
|
+
|
|
3
|
+
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
+
precision highp float;
|
|
5
|
+
#else
|
|
6
|
+
precision mediump float;
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
10
|
+
#pragma glslify: floatToRgba = require(glsl-float-to-rgba)
|
|
11
|
+
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
12
|
+
|
|
13
|
+
uniform sampler2D textureA;
|
|
14
|
+
uniform sampler2D textureB;
|
|
15
|
+
uniform sampler2D textureC;
|
|
16
|
+
|
|
17
|
+
uniform float nodataValue;
|
|
18
|
+
uniform bool littleEndian;
|
|
19
|
+
|
|
20
|
+
uniform float filterLowA;
|
|
21
|
+
uniform float filterHighA;
|
|
22
|
+
uniform float filterLowB;
|
|
23
|
+
uniform float filterHighB;
|
|
24
|
+
uniform float filterLowC;
|
|
25
|
+
uniform float filterHighC;
|
|
26
|
+
uniform float multiplierA;
|
|
27
|
+
uniform float multiplierB;
|
|
28
|
+
uniform float multiplierC;
|
|
29
|
+
|
|
30
|
+
varying vec2 vTexCoordA;
|
|
31
|
+
varying vec2 vTexCoordB;
|
|
32
|
+
varying vec2 vTexCoordC;
|
|
33
|
+
|
|
34
|
+
void main() {
|
|
35
|
+
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
36
|
+
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
37
|
+
float texelFloatC = getTexelValue(textureC, vTexCoordC, littleEndian);
|
|
38
|
+
|
|
39
|
+
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
40
|
+
bool bIsNodata = isCloseEnough(texelFloatB, nodataValue);
|
|
41
|
+
bool cIsNodata = isCloseEnough(texelFloatC, nodataValue);
|
|
42
|
+
|
|
43
|
+
if (aIsNodata || bIsNodata || cIsNodata ||
|
|
44
|
+
texelFloatA < filterLowA || texelFloatA > filterHighA ||
|
|
45
|
+
texelFloatB < filterLowB || texelFloatB > filterHighB ||
|
|
46
|
+
texelFloatC < filterLowC || texelFloatC > filterHighC
|
|
47
|
+
) {
|
|
48
|
+
gl_FragColor = floatToRgba(nodataValue, littleEndian);
|
|
49
|
+
} else {
|
|
50
|
+
float texelFloatFinal = texelFloatA * multiplierA + texelFloatB * multiplierB + texelFloatC * multiplierC;
|
|
51
|
+
gl_FragColor = floatToRgba(texelFloatFinal, littleEndian);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
54
|
`
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
10
|
-
#pragma glslify: floatToRgba = require(glsl-float-to-rgba)
|
|
11
|
-
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
12
|
-
|
|
13
|
-
uniform sampler2D textureA;
|
|
14
|
-
uniform sampler2D textureB;
|
|
15
|
-
uniform sampler2D textureC;
|
|
16
|
-
uniform sampler2D textureD;
|
|
17
|
-
|
|
18
|
-
uniform float nodataValue;
|
|
19
|
-
uniform bool littleEndian;
|
|
20
|
-
|
|
21
|
-
uniform float filterLowA;
|
|
22
|
-
uniform float filterHighA;
|
|
23
|
-
uniform float filterLowB;
|
|
24
|
-
uniform float filterHighB;
|
|
25
|
-
uniform float filterLowC;
|
|
26
|
-
uniform float filterHighC;
|
|
27
|
-
uniform float filterLowD;
|
|
28
|
-
uniform float filterHighD;
|
|
29
|
-
uniform float multiplierA;
|
|
30
|
-
uniform float multiplierB;
|
|
31
|
-
uniform float multiplierC;
|
|
32
|
-
uniform float multiplierD;
|
|
33
|
-
|
|
34
|
-
varying vec2 vTexCoordA;
|
|
35
|
-
varying vec2 vTexCoordB;
|
|
36
|
-
varying vec2 vTexCoordC;
|
|
37
|
-
varying vec2 vTexCoordD;
|
|
38
|
-
|
|
39
|
-
void main() {
|
|
40
|
-
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
41
|
-
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
42
|
-
float texelFloatC = getTexelValue(textureC, vTexCoordC, littleEndian);
|
|
43
|
-
float texelFloatD = getTexelValue(textureD, vTexCoordD, littleEndian);
|
|
44
|
-
|
|
45
|
-
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
46
|
-
bool bIsNodata = isCloseEnough(texelFloatB, nodataValue);
|
|
47
|
-
bool cIsNodata = isCloseEnough(texelFloatC, nodataValue);
|
|
48
|
-
bool dIsNodata = isCloseEnough(texelFloatD, nodataValue);
|
|
49
|
-
|
|
50
|
-
if (aIsNodata || bIsNodata || cIsNodata || dIsNodata ||
|
|
51
|
-
texelFloatA < filterLowA || texelFloatA > filterHighA ||
|
|
52
|
-
texelFloatB < filterLowB || texelFloatB > filterHighB ||
|
|
53
|
-
texelFloatC < filterLowC || texelFloatC > filterHighC ||
|
|
54
|
-
texelFloatD < filterLowD || texelFloatD > filterHighD
|
|
55
|
-
) {
|
|
56
|
-
gl_FragColor = floatToRgba(nodataValue, littleEndian);
|
|
57
|
-
} else {
|
|
58
|
-
float texelFloatFinal = texelFloatA * multiplierA + texelFloatB * multiplierB + texelFloatC * multiplierC + texelFloatD * multiplierD;
|
|
59
|
-
gl_FragColor = floatToRgba(texelFloatFinal, littleEndian);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
1
|
+
import glsl from 'glslify'
|
|
2
|
+
|
|
3
|
+
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
+
precision highp float;
|
|
5
|
+
#else
|
|
6
|
+
precision mediump float;
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
10
|
+
#pragma glslify: floatToRgba = require(glsl-float-to-rgba)
|
|
11
|
+
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
12
|
+
|
|
13
|
+
uniform sampler2D textureA;
|
|
14
|
+
uniform sampler2D textureB;
|
|
15
|
+
uniform sampler2D textureC;
|
|
16
|
+
uniform sampler2D textureD;
|
|
17
|
+
|
|
18
|
+
uniform float nodataValue;
|
|
19
|
+
uniform bool littleEndian;
|
|
20
|
+
|
|
21
|
+
uniform float filterLowA;
|
|
22
|
+
uniform float filterHighA;
|
|
23
|
+
uniform float filterLowB;
|
|
24
|
+
uniform float filterHighB;
|
|
25
|
+
uniform float filterLowC;
|
|
26
|
+
uniform float filterHighC;
|
|
27
|
+
uniform float filterLowD;
|
|
28
|
+
uniform float filterHighD;
|
|
29
|
+
uniform float multiplierA;
|
|
30
|
+
uniform float multiplierB;
|
|
31
|
+
uniform float multiplierC;
|
|
32
|
+
uniform float multiplierD;
|
|
33
|
+
|
|
34
|
+
varying vec2 vTexCoordA;
|
|
35
|
+
varying vec2 vTexCoordB;
|
|
36
|
+
varying vec2 vTexCoordC;
|
|
37
|
+
varying vec2 vTexCoordD;
|
|
38
|
+
|
|
39
|
+
void main() {
|
|
40
|
+
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
41
|
+
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
42
|
+
float texelFloatC = getTexelValue(textureC, vTexCoordC, littleEndian);
|
|
43
|
+
float texelFloatD = getTexelValue(textureD, vTexCoordD, littleEndian);
|
|
44
|
+
|
|
45
|
+
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
46
|
+
bool bIsNodata = isCloseEnough(texelFloatB, nodataValue);
|
|
47
|
+
bool cIsNodata = isCloseEnough(texelFloatC, nodataValue);
|
|
48
|
+
bool dIsNodata = isCloseEnough(texelFloatD, nodataValue);
|
|
49
|
+
|
|
50
|
+
if (aIsNodata || bIsNodata || cIsNodata || dIsNodata ||
|
|
51
|
+
texelFloatA < filterLowA || texelFloatA > filterHighA ||
|
|
52
|
+
texelFloatB < filterLowB || texelFloatB > filterHighB ||
|
|
53
|
+
texelFloatC < filterLowC || texelFloatC > filterHighC ||
|
|
54
|
+
texelFloatD < filterLowD || texelFloatD > filterHighD
|
|
55
|
+
) {
|
|
56
|
+
gl_FragColor = floatToRgba(nodataValue, littleEndian);
|
|
57
|
+
} else {
|
|
58
|
+
float texelFloatFinal = texelFloatA * multiplierA + texelFloatB * multiplierB + texelFloatC * multiplierC + texelFloatD * multiplierD;
|
|
59
|
+
gl_FragColor = floatToRgba(texelFloatFinal, littleEndian);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
62
|
`
|