geojs 1.14.0 → 1.14.1
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/geo.js +3 -3
- package/geo.lean.js +3 -3
- package/geo.lean.min.js +2 -2
- package/geo.min.js +4 -4
- package/package.json +2 -2
- package/src/webgl/lineFeature.vert +26 -5
package/geo.js
CHANGED
|
@@ -28164,7 +28164,7 @@ module.exports = _sceneObject;
|
|
|
28164
28164
|
* @constant
|
|
28165
28165
|
* @type {string}
|
|
28166
28166
|
*/
|
|
28167
|
-
module.exports = "
|
|
28167
|
+
module.exports = "81c2c67b6f61c4292a790edab5e583c82095b099";
|
|
28168
28168
|
|
|
28169
28169
|
/***/ }),
|
|
28170
28170
|
|
|
@@ -40049,7 +40049,7 @@ module.exports = _vectorFeature;
|
|
|
40049
40049
|
* @constant
|
|
40050
40050
|
* @type {string}
|
|
40051
40051
|
*/
|
|
40052
|
-
module.exports = "1.14.
|
|
40052
|
+
module.exports = "1.14.1";
|
|
40053
40053
|
|
|
40054
40054
|
/***/ }),
|
|
40055
40055
|
|
|
@@ -75967,7 +75967,7 @@ module.exports = "/* lineFeature fragment shader */\n\n#ifdef GL_ES\n #ifdef GL
|
|
|
75967
75967
|
/***/ 9336:
|
|
75968
75968
|
/***/ (function(module) {
|
|
75969
75969
|
|
|
75970
|
-
module.exports = "/* lineFeature vertex shader */\n\n#ifdef GL_ES\n precision highp float;\n#endif\nattribute vec3 pos;\nattribute vec3 prev;\nattribute vec3 next;\nattribute vec3 far;\nattribute float flags;\n\nattribute vec3 strokeColor;\nattribute float strokeOpacity;\nattribute float strokeWidth;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float pixelWidth;\nuniform float aspect;\nuniform float miterLimit;\nuniform float antialiasing;\n\nvarying vec4 strokeColorVar;\nvarying vec4 subpos; /* px, py, length - px, width */\nvarying vec4 info; /* near mode, far mode, offset */\nvarying vec4 angles; /* near angle cos, sin, far angle cos, sin */\n\nconst float PI = 3.14159265358979323846264;\n\nvec4 viewCoord(vec3 c) {\n vec4 result = projectionMatrix * modelViewMatrix * vec4(c.xyz, 1.0);\n if (result.w != 0.0) result = result / result.w;\n return result;\n}\n\nfloat atan2(float y, float x) {\n if (x > 0.0) return atan(y / x);\n if (x < 0.0 && y >= 0.0) return atan(y / x) + PI;\n if (x < 0.0) return atan(y / x) - PI;\n return sign(y) * 0.5 * PI;\n}\n\nvoid main(void)\n{\n /* If any vertex has been deliberately set to a negative opacity,\n * skip doing computations on it. */\n if (strokeOpacity < 0.0) {\n gl_Position = vec4(2.0, 2.0, 0.0, 1.0);\n return;\n }\n /* convert coordinates. We have four values, since we need to\n * calculate the angles between the lines formed by prev-pos and\n * pos-next, and between pos-next and next-far, plus know the angle\n * (prev)---(pos)---(next)---(far) => A---B---C---D */\n vec4 A = viewCoord(prev);\n vec4 B = viewCoord(pos);\n vec4 C = viewCoord(next);\n vec4 D = viewCoord(far);\n // calculate line segment vector and angle\n vec2 deltaCB = C.xy - B.xy;\n if (deltaCB == vec2(0.0, 0.0)) {\n gl_Position = vec4(2.0, 2.0, 0.0, 1.0);\n return;\n }\n float angleCB = atan2(deltaCB.y, deltaCB.x * aspect);\n // values we need to pass along\n strokeColorVar = vec4(strokeColor, strokeOpacity);\n // extract values from our flags field\n int vertex = int(mod(flags, 4.0));\n int nearMode = int(mod(floor(flags / 4.0), 8.0));\n int farMode = int(mod(floor(flags / 32.0), 8.0));\n // we use 11 bits of the flags for the offset, where -1023 to 1023\n // maps to -1 to 1. The 11 bits are a signed value, so simply\n // selecting the bits will result in an unsigned values that may be\n // greater than 1, in which case we have to subtract appropriately.\n float offset = mod(floor(flags / 256.0), 2048.0) / 1023.0;\n if (offset > 1.0) offset -= 2048.0 / 1023.0;\n // by default, offset by the width and don't extend lines. Later,\n // calculate line extensions based on end cap and end join modes\n float yOffset = strokeWidth + antialiasing;\n if (vertex == 0
|
|
75970
|
+
module.exports = "/* lineFeature vertex shader */\n\n#ifdef GL_ES\n precision highp float;\n#endif\nattribute vec3 pos;\nattribute vec3 prev;\nattribute vec3 next;\nattribute vec3 far;\nattribute float flags;\n\nattribute vec3 strokeColor;\nattribute float strokeOpacity;\nattribute float strokeWidth;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float pixelWidth;\nuniform float aspect;\nuniform float miterLimit;\nuniform float antialiasing;\n\nvarying vec4 strokeColorVar;\nvarying vec4 subpos; /* px, py, length - px, width */\nvarying vec4 info; /* near mode, far mode, offset */\nvarying vec4 angles; /* near angle cos, sin, far angle cos, sin */\n\nconst float PI = 3.14159265358979323846264;\n\nvec4 viewCoord(vec3 c) {\n vec4 result = projectionMatrix * modelViewMatrix * vec4(c.xyz, 1.0);\n if (result.w != 0.0) result = result / result.w;\n return result;\n}\n\nfloat atan2(float y, float x) {\n if (x > 0.0) return atan(y / x);\n if (x < 0.0 && y >= 0.0) return atan(y / x) + PI;\n if (x < 0.0) return atan(y / x) - PI;\n return sign(y) * 0.5 * PI;\n}\n\nvoid main(void)\n{\n /* If any vertex has been deliberately set to a negative opacity,\n * skip doing computations on it. */\n if (strokeOpacity < 0.0) {\n gl_Position = vec4(2.0, 2.0, 0.0, 1.0);\n return;\n }\n /* convert coordinates. We have four values, since we need to\n * calculate the angles between the lines formed by prev-pos and\n * pos-next, and between pos-next and next-far, plus know the angle\n * (prev)---(pos)---(next)---(far) => A---B---C---D */\n vec4 A = viewCoord(prev);\n vec4 B = viewCoord(pos);\n vec4 C = viewCoord(next);\n vec4 D = viewCoord(far);\n // calculate line segment vector and angle\n vec2 deltaCB = C.xy - B.xy;\n if (deltaCB == vec2(0.0, 0.0)) {\n gl_Position = vec4(2.0, 2.0, 0.0, 1.0);\n return;\n }\n float lineLength = length(vec2(deltaCB.x, deltaCB.y / aspect)) / pixelWidth;\n // if lines reverse upon themselves and are not nearly the same length, skip\n // joins. This is a heuristic; the correct method would to be to pass some\n // sort of length of the adjacent line to the fragment renderer and adjust\n // which fragments are rendered, but this is much more complex.\n float abLimit = length(vec2(A.x - B.x, (A.y - B.y) / aspect)) / pixelWidth;\n float dcLimit = length(vec2(D.x - C.x, (D.y - C.y) / aspect)) / pixelWidth;\n if (abLimit >= lineLength - antialiasing - strokeWidth * 0.5 && abLimit <= lineLength + antialiasing + strokeWidth * 0.5) {\n abLimit = 0.0001;\n } else {\n if (abLimit < lineLength) abLimit = lineLength;\n abLimit = (strokeWidth - antialiasing) / (abLimit + antialiasing);\n if (abLimit < 0.0001) abLimit = 0.0001;\n if (abLimit > 0.1) abLimit = 0.1;\n }\n if (dcLimit >= lineLength - antialiasing - strokeWidth * 0.5 && dcLimit <= lineLength + antialiasing + strokeWidth * 0.5) {\n dcLimit = 0.0001;\n } else {\n if (dcLimit < lineLength) dcLimit = lineLength;\n dcLimit = (strokeWidth - antialiasing) / (dcLimit + antialiasing);\n if (dcLimit < 0.0001) dcLimit = 0.0001;\n if (dcLimit > 0.1) dcLimit = 0.1;\n }\n float angleCB = atan2(deltaCB.y, deltaCB.x * aspect);\n // values we need to pass along\n strokeColorVar = vec4(strokeColor, strokeOpacity);\n // extract values from our flags field\n int vertex = int(mod(flags, 4.0));\n int nearMode = int(mod(floor(flags / 4.0), 8.0));\n int farMode = int(mod(floor(flags / 32.0), 8.0));\n // we use 11 bits of the flags for the offset, where -1023 to 1023\n // maps to -1 to 1. The 11 bits are a signed value, so simply\n // selecting the bits will result in an unsigned values that may be\n // greater than 1, in which case we have to subtract appropriately.\n float offset = mod(floor(flags / 256.0), 2048.0) / 1023.0;\n if (offset > 1.0) offset -= 2048.0 / 1023.0;\n // by default, offset by the width and don't extend lines. Later,\n // calculate line extensions based on end cap and end join modes\n float yOffset = strokeWidth + antialiasing;\n if (vertex == 0) yOffset *= -1.0;\n yOffset += strokeWidth * offset;\n float xOffset = 0.0;\n // end caps\n if (nearMode == 0) {\n xOffset = antialiasing;\n } else if (nearMode == 1 || nearMode == 2) {\n xOffset = strokeWidth + antialiasing;\n }\n\n // If joining lines, calculate the angles in screen space formed by\n // the near end (A-B-C) and far end (B-C-D), and determine how much\n // space is needed for the particular join.\n // This could be changed: if the lines are not a uniform width and\n // offset, then the functional join angle is not simply half the\n // angle between the two lines, but rather half the angle of the\n // inside edge of the the two lines.\n float cosABC = 1.0, sinABC = 0.0, cosBCD = 1.0, sinBCD = 0.0; // of half angles\n // handle near end\n if (nearMode >= 4) {\n float angleBA = atan2(B.y - A.y, (B.x - A.x) * aspect);\n if (A.xy == B.xy) angleBA = angleCB;\n float angleABC = angleCB - angleBA;\n // ensure angle is in the range [-PI, PI], then take the half angle\n angleABC = (mod(angleABC + 3.0 * PI, 2.0 * PI) - PI) / 2.0;\n cosABC = cos(angleABC); sinABC = sin(angleABC);\n // if this angle is close to flat, pass-through the join\n if (nearMode >= 4 && (cosABC > 0.999999 || cosABC < abLimit)) {\n nearMode = 3;\n }\n // miter, miter-clip\n if (nearMode == 4 || nearMode == 7) {\n if (cosABC < 0.000001 || 1.0 / cosABC > miterLimit) {\n if (nearMode == 4) {\n nearMode = 5;\n } else {\n xOffset = miterLimit * strokeWidth * (1.0 - offset * sign(sinABC)) + antialiasing;\n }\n } else {\n // we add an extra 1.0 to the xOffset to make sure that fragment\n // shader is doing the clipping\n xOffset = abs(sinABC / cosABC) * strokeWidth * (1.0 - offset * sign(sinABC)) + antialiasing + 1.0;\n nearMode = 4;\n }\n }\n // bevel or round join\n if (nearMode == 5 || nearMode == 6) {\n xOffset = strokeWidth * (1.0 - offset * sign(sinABC)) + antialiasing;\n }\n }\n\n // handle far end\n if (farMode >= 4) {\n float angleDC = atan2(D.y - C.y, (D.x - C.x) * aspect);\n if (D.xy == C.xy) angleDC = angleCB;\n float angleBCD = angleDC - angleCB;\n // ensure angle is in the range [-PI, PI], then take the half angle\n angleBCD = (mod(angleBCD + 3.0 * PI, 2.0 * PI) - PI) / 2.0;\n cosBCD = cos(angleBCD); sinBCD = sin(angleBCD);\n // if this angle is close to flat, pass-through the join\n if (farMode >= 4 && (cosBCD > 0.999999 || cosBCD < dcLimit)) {\n farMode = 3;\n }\n // miter, miter-clip\n if (farMode == 4 || farMode == 7) {\n if (cosBCD < 0.000001 || 1.0 / cosBCD > miterLimit) {\n if (farMode == 4) farMode = 5;\n } else {\n farMode = 4;\n }\n }\n }\n\n // compute the location of a vertex to include everything that might\n // need to be rendered\n xOffset *= -1.0;\n gl_Position = vec4(\n B.x + (xOffset * cos(angleCB) - yOffset * sin(angleCB)) * pixelWidth,\n B.y + (xOffset * sin(angleCB) + yOffset * cos(angleCB)) * pixelWidth * aspect,\n B.z, 1.0);\n // store other values needed to determine which pixels to plot.\n if (vertex == 0 || vertex == 1) {\n subpos = vec4(xOffset, yOffset, lineLength - xOffset, strokeWidth);\n info = vec4(float(nearMode), float(farMode), offset, 0.0);\n angles = vec4(cosABC, sinABC, cosBCD, sinBCD);\n } else {\n subpos = vec4(lineLength - xOffset, -yOffset, xOffset, strokeWidth);\n info = vec4(float(farMode), float(nearMode), -offset, 0.0);\n angles = vec4(cosBCD, -sinBCD, cosABC, -sinABC);\n }\n}\n"
|
|
75971
75971
|
|
|
75972
75972
|
/***/ }),
|
|
75973
75973
|
|
package/geo.lean.js
CHANGED
|
@@ -25163,7 +25163,7 @@ module.exports = _sceneObject;
|
|
|
25163
25163
|
* @constant
|
|
25164
25164
|
* @type {string}
|
|
25165
25165
|
*/
|
|
25166
|
-
module.exports = "
|
|
25166
|
+
module.exports = "81c2c67b6f61c4292a790edab5e583c82095b099";
|
|
25167
25167
|
|
|
25168
25168
|
/***/ }),
|
|
25169
25169
|
|
|
@@ -37048,7 +37048,7 @@ module.exports = _vectorFeature;
|
|
|
37048
37048
|
* @constant
|
|
37049
37049
|
* @type {string}
|
|
37050
37050
|
*/
|
|
37051
|
-
module.exports = "1.14.
|
|
37051
|
+
module.exports = "1.14.1";
|
|
37052
37052
|
|
|
37053
37053
|
/***/ }),
|
|
37054
37054
|
|
|
@@ -72966,7 +72966,7 @@ module.exports = "/* lineFeature fragment shader */\n\n#ifdef GL_ES\n #ifdef GL
|
|
|
72966
72966
|
/***/ 9336:
|
|
72967
72967
|
/***/ (function(module) {
|
|
72968
72968
|
|
|
72969
|
-
module.exports = "/* lineFeature vertex shader */\n\n#ifdef GL_ES\n precision highp float;\n#endif\nattribute vec3 pos;\nattribute vec3 prev;\nattribute vec3 next;\nattribute vec3 far;\nattribute float flags;\n\nattribute vec3 strokeColor;\nattribute float strokeOpacity;\nattribute float strokeWidth;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float pixelWidth;\nuniform float aspect;\nuniform float miterLimit;\nuniform float antialiasing;\n\nvarying vec4 strokeColorVar;\nvarying vec4 subpos; /* px, py, length - px, width */\nvarying vec4 info; /* near mode, far mode, offset */\nvarying vec4 angles; /* near angle cos, sin, far angle cos, sin */\n\nconst float PI = 3.14159265358979323846264;\n\nvec4 viewCoord(vec3 c) {\n vec4 result = projectionMatrix * modelViewMatrix * vec4(c.xyz, 1.0);\n if (result.w != 0.0) result = result / result.w;\n return result;\n}\n\nfloat atan2(float y, float x) {\n if (x > 0.0) return atan(y / x);\n if (x < 0.0 && y >= 0.0) return atan(y / x) + PI;\n if (x < 0.0) return atan(y / x) - PI;\n return sign(y) * 0.5 * PI;\n}\n\nvoid main(void)\n{\n /* If any vertex has been deliberately set to a negative opacity,\n * skip doing computations on it. */\n if (strokeOpacity < 0.0) {\n gl_Position = vec4(2.0, 2.0, 0.0, 1.0);\n return;\n }\n /* convert coordinates. We have four values, since we need to\n * calculate the angles between the lines formed by prev-pos and\n * pos-next, and between pos-next and next-far, plus know the angle\n * (prev)---(pos)---(next)---(far) => A---B---C---D */\n vec4 A = viewCoord(prev);\n vec4 B = viewCoord(pos);\n vec4 C = viewCoord(next);\n vec4 D = viewCoord(far);\n // calculate line segment vector and angle\n vec2 deltaCB = C.xy - B.xy;\n if (deltaCB == vec2(0.0, 0.0)) {\n gl_Position = vec4(2.0, 2.0, 0.0, 1.0);\n return;\n }\n float angleCB = atan2(deltaCB.y, deltaCB.x * aspect);\n // values we need to pass along\n strokeColorVar = vec4(strokeColor, strokeOpacity);\n // extract values from our flags field\n int vertex = int(mod(flags, 4.0));\n int nearMode = int(mod(floor(flags / 4.0), 8.0));\n int farMode = int(mod(floor(flags / 32.0), 8.0));\n // we use 11 bits of the flags for the offset, where -1023 to 1023\n // maps to -1 to 1. The 11 bits are a signed value, so simply\n // selecting the bits will result in an unsigned values that may be\n // greater than 1, in which case we have to subtract appropriately.\n float offset = mod(floor(flags / 256.0), 2048.0) / 1023.0;\n if (offset > 1.0) offset -= 2048.0 / 1023.0;\n // by default, offset by the width and don't extend lines. Later,\n // calculate line extensions based on end cap and end join modes\n float yOffset = strokeWidth + antialiasing;\n if (vertex == 0
|
|
72969
|
+
module.exports = "/* lineFeature vertex shader */\n\n#ifdef GL_ES\n precision highp float;\n#endif\nattribute vec3 pos;\nattribute vec3 prev;\nattribute vec3 next;\nattribute vec3 far;\nattribute float flags;\n\nattribute vec3 strokeColor;\nattribute float strokeOpacity;\nattribute float strokeWidth;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float pixelWidth;\nuniform float aspect;\nuniform float miterLimit;\nuniform float antialiasing;\n\nvarying vec4 strokeColorVar;\nvarying vec4 subpos; /* px, py, length - px, width */\nvarying vec4 info; /* near mode, far mode, offset */\nvarying vec4 angles; /* near angle cos, sin, far angle cos, sin */\n\nconst float PI = 3.14159265358979323846264;\n\nvec4 viewCoord(vec3 c) {\n vec4 result = projectionMatrix * modelViewMatrix * vec4(c.xyz, 1.0);\n if (result.w != 0.0) result = result / result.w;\n return result;\n}\n\nfloat atan2(float y, float x) {\n if (x > 0.0) return atan(y / x);\n if (x < 0.0 && y >= 0.0) return atan(y / x) + PI;\n if (x < 0.0) return atan(y / x) - PI;\n return sign(y) * 0.5 * PI;\n}\n\nvoid main(void)\n{\n /* If any vertex has been deliberately set to a negative opacity,\n * skip doing computations on it. */\n if (strokeOpacity < 0.0) {\n gl_Position = vec4(2.0, 2.0, 0.0, 1.0);\n return;\n }\n /* convert coordinates. We have four values, since we need to\n * calculate the angles between the lines formed by prev-pos and\n * pos-next, and between pos-next and next-far, plus know the angle\n * (prev)---(pos)---(next)---(far) => A---B---C---D */\n vec4 A = viewCoord(prev);\n vec4 B = viewCoord(pos);\n vec4 C = viewCoord(next);\n vec4 D = viewCoord(far);\n // calculate line segment vector and angle\n vec2 deltaCB = C.xy - B.xy;\n if (deltaCB == vec2(0.0, 0.0)) {\n gl_Position = vec4(2.0, 2.0, 0.0, 1.0);\n return;\n }\n float lineLength = length(vec2(deltaCB.x, deltaCB.y / aspect)) / pixelWidth;\n // if lines reverse upon themselves and are not nearly the same length, skip\n // joins. This is a heuristic; the correct method would to be to pass some\n // sort of length of the adjacent line to the fragment renderer and adjust\n // which fragments are rendered, but this is much more complex.\n float abLimit = length(vec2(A.x - B.x, (A.y - B.y) / aspect)) / pixelWidth;\n float dcLimit = length(vec2(D.x - C.x, (D.y - C.y) / aspect)) / pixelWidth;\n if (abLimit >= lineLength - antialiasing - strokeWidth * 0.5 && abLimit <= lineLength + antialiasing + strokeWidth * 0.5) {\n abLimit = 0.0001;\n } else {\n if (abLimit < lineLength) abLimit = lineLength;\n abLimit = (strokeWidth - antialiasing) / (abLimit + antialiasing);\n if (abLimit < 0.0001) abLimit = 0.0001;\n if (abLimit > 0.1) abLimit = 0.1;\n }\n if (dcLimit >= lineLength - antialiasing - strokeWidth * 0.5 && dcLimit <= lineLength + antialiasing + strokeWidth * 0.5) {\n dcLimit = 0.0001;\n } else {\n if (dcLimit < lineLength) dcLimit = lineLength;\n dcLimit = (strokeWidth - antialiasing) / (dcLimit + antialiasing);\n if (dcLimit < 0.0001) dcLimit = 0.0001;\n if (dcLimit > 0.1) dcLimit = 0.1;\n }\n float angleCB = atan2(deltaCB.y, deltaCB.x * aspect);\n // values we need to pass along\n strokeColorVar = vec4(strokeColor, strokeOpacity);\n // extract values from our flags field\n int vertex = int(mod(flags, 4.0));\n int nearMode = int(mod(floor(flags / 4.0), 8.0));\n int farMode = int(mod(floor(flags / 32.0), 8.0));\n // we use 11 bits of the flags for the offset, where -1023 to 1023\n // maps to -1 to 1. The 11 bits are a signed value, so simply\n // selecting the bits will result in an unsigned values that may be\n // greater than 1, in which case we have to subtract appropriately.\n float offset = mod(floor(flags / 256.0), 2048.0) / 1023.0;\n if (offset > 1.0) offset -= 2048.0 / 1023.0;\n // by default, offset by the width and don't extend lines. Later,\n // calculate line extensions based on end cap and end join modes\n float yOffset = strokeWidth + antialiasing;\n if (vertex == 0) yOffset *= -1.0;\n yOffset += strokeWidth * offset;\n float xOffset = 0.0;\n // end caps\n if (nearMode == 0) {\n xOffset = antialiasing;\n } else if (nearMode == 1 || nearMode == 2) {\n xOffset = strokeWidth + antialiasing;\n }\n\n // If joining lines, calculate the angles in screen space formed by\n // the near end (A-B-C) and far end (B-C-D), and determine how much\n // space is needed for the particular join.\n // This could be changed: if the lines are not a uniform width and\n // offset, then the functional join angle is not simply half the\n // angle between the two lines, but rather half the angle of the\n // inside edge of the the two lines.\n float cosABC = 1.0, sinABC = 0.0, cosBCD = 1.0, sinBCD = 0.0; // of half angles\n // handle near end\n if (nearMode >= 4) {\n float angleBA = atan2(B.y - A.y, (B.x - A.x) * aspect);\n if (A.xy == B.xy) angleBA = angleCB;\n float angleABC = angleCB - angleBA;\n // ensure angle is in the range [-PI, PI], then take the half angle\n angleABC = (mod(angleABC + 3.0 * PI, 2.0 * PI) - PI) / 2.0;\n cosABC = cos(angleABC); sinABC = sin(angleABC);\n // if this angle is close to flat, pass-through the join\n if (nearMode >= 4 && (cosABC > 0.999999 || cosABC < abLimit)) {\n nearMode = 3;\n }\n // miter, miter-clip\n if (nearMode == 4 || nearMode == 7) {\n if (cosABC < 0.000001 || 1.0 / cosABC > miterLimit) {\n if (nearMode == 4) {\n nearMode = 5;\n } else {\n xOffset = miterLimit * strokeWidth * (1.0 - offset * sign(sinABC)) + antialiasing;\n }\n } else {\n // we add an extra 1.0 to the xOffset to make sure that fragment\n // shader is doing the clipping\n xOffset = abs(sinABC / cosABC) * strokeWidth * (1.0 - offset * sign(sinABC)) + antialiasing + 1.0;\n nearMode = 4;\n }\n }\n // bevel or round join\n if (nearMode == 5 || nearMode == 6) {\n xOffset = strokeWidth * (1.0 - offset * sign(sinABC)) + antialiasing;\n }\n }\n\n // handle far end\n if (farMode >= 4) {\n float angleDC = atan2(D.y - C.y, (D.x - C.x) * aspect);\n if (D.xy == C.xy) angleDC = angleCB;\n float angleBCD = angleDC - angleCB;\n // ensure angle is in the range [-PI, PI], then take the half angle\n angleBCD = (mod(angleBCD + 3.0 * PI, 2.0 * PI) - PI) / 2.0;\n cosBCD = cos(angleBCD); sinBCD = sin(angleBCD);\n // if this angle is close to flat, pass-through the join\n if (farMode >= 4 && (cosBCD > 0.999999 || cosBCD < dcLimit)) {\n farMode = 3;\n }\n // miter, miter-clip\n if (farMode == 4 || farMode == 7) {\n if (cosBCD < 0.000001 || 1.0 / cosBCD > miterLimit) {\n if (farMode == 4) farMode = 5;\n } else {\n farMode = 4;\n }\n }\n }\n\n // compute the location of a vertex to include everything that might\n // need to be rendered\n xOffset *= -1.0;\n gl_Position = vec4(\n B.x + (xOffset * cos(angleCB) - yOffset * sin(angleCB)) * pixelWidth,\n B.y + (xOffset * sin(angleCB) + yOffset * cos(angleCB)) * pixelWidth * aspect,\n B.z, 1.0);\n // store other values needed to determine which pixels to plot.\n if (vertex == 0 || vertex == 1) {\n subpos = vec4(xOffset, yOffset, lineLength - xOffset, strokeWidth);\n info = vec4(float(nearMode), float(farMode), offset, 0.0);\n angles = vec4(cosABC, sinABC, cosBCD, sinBCD);\n } else {\n subpos = vec4(lineLength - xOffset, -yOffset, xOffset, strokeWidth);\n info = vec4(float(farMode), float(nearMode), -offset, 0.0);\n angles = vec4(cosBCD, -sinBCD, cosABC, -sinABC);\n }\n}\n"
|
|
72970
72970
|
|
|
72971
72971
|
/***/ }),
|
|
72972
72972
|
|