Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rreusser committed Nov 19, 2021
1 parent 87d7d19 commit 81bc016
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0

This release has no new features. Flipping the switch since, for the first time since starting, I don't have major new features or blocking bugs which would prevent me from calling this a piece of usable software. :tada:

## 0.0.23

### Features
Expand Down
3 changes: 2 additions & 1 deletion dist/regl-gpu-lines.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@
return [props.joinRes2, props.joinRes2];
};
return regl({
vert: "".concat(meta.glsl, "\nconst float CAP_START = ").concat(ORIENTATION$2.CAP_START, ".0;\nconst float CAP_END = ").concat(ORIENTATION$2.CAP_END, ".0;\n\n").concat(spec.glsl, "\n\nattribute float index;\n").concat(debug ? 'attribute float debugInstanceID;' : '', "\n\nuniform vec2 vertCnt2, capJoinRes2;\nuniform vec2 resolution, capScale;\nuniform float miterLimit;\n").concat(meta.orientation || !isEndpoints ? '' : 'uniform float orientation;', "\n\nvarying vec3 lineCoord;\nvarying float dir;\n").concat(debug ? 'varying vec2 triStripCoord;' : '', "\n").concat(debug ? 'varying float instanceID;' : '', "\n").concat(debug ? 'varying float vertexIndex;' : '', "\n\n// This turns out not to work very well\n// bool isnan(float val) {\n// return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n// }\n\nbool invalid(vec4 p) {\n return p.w == 0.0;\n}\n\nvoid main() {\n const float pi = 3.141592653589793;\n\n bool isRound = ").concat(isRound ? 'true' : 'false', ";\n ").concat(debug ? 'vertexIndex = index;' : '', "\n lineCoord = vec3(0);\n\n ").concat(debug ? "instanceID = ".concat(isEndpoints ? '-1.0' : 'debugInstanceID', ";") : '', "\n ").concat(debug ? 'triStripCoord = vec2(floor(index / 2.0), mod(index, 2.0));' : '', "\n\n ").concat(verts.map(function (vert) {
// Insert user GLSL at the top
vert: "".concat(meta.glsl, "\nconst float CAP_START = ").concat(ORIENTATION$2.CAP_START, ".0;\nconst float CAP_END = ").concat(ORIENTATION$2.CAP_END, ".0;\n\n// Attribute specification\n").concat(spec.glsl, "\n\nattribute float index;\n").concat(debug ? 'attribute float debugInstanceID;' : '', "\n\nuniform vec2 vertCnt2, capJoinRes2;\nuniform vec2 resolution, capScale;\nuniform float miterLimit;\n").concat(meta.orientation || !isEndpoints ? '' : 'uniform float orientation;', "\n\nvarying vec3 lineCoord;\n").concat(debug ? 'varying vec2 triStripCoord;' : '', "\n").concat(debug ? 'varying float instanceID;' : '', "\n").concat(debug ? 'varying float vertexIndex;' : '', "\n\n// This turns out not to work very well\n// bool isnan(float val) {\n// return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n// }\n\nbool invalid(vec4 p) {\n return p.w == 0.0;\n}\n\nvoid main() {\n const float pi = 3.141592653589793;\n\n bool isRound = ").concat(isRound ? 'true' : 'false', ";\n ").concat(debug ? 'vertexIndex = index;' : '', "\n lineCoord = vec3(0);\n\n ").concat(debug ? "instanceID = ".concat(isEndpoints ? '-1.0' : 'debugInstanceID', ";") : '', "\n ").concat(debug ? 'triStripCoord = vec2(floor(index / 2.0), mod(index, 2.0));' : '', "\n\n ").concat(verts.map(function (vert) {
return "vec4 p".concat(vert, " = ").concat(meta.position.generate(vert), ";");
}).join('\n'), "\n\n // A sensible default for early returns\n gl_Position = pB;\n\n bool aInvalid = ").concat(isEndpoints ? 'false' : 'invalid(pA)', ";\n bool bInvalid = invalid(pB);\n bool cInvalid = invalid(pC);\n bool dInvalid = invalid(pD);\n\n // Vertex count for each part (first half of join, second (mirrored) half). Note that not all of\n // these vertices may be used, for example if we have enough for a round cap but only draw a miter\n // join.\n vec2 v = vertCnt2 + 3.0;\n\n // Total vertex count\n float N = dot(v, vec2(1));\n\n // If we're past the first half-join and half of the segment, then we swap all vertices and start\n // over from the opposite end.\n bool mirror = index >= v.x;\n\n // When rendering dedicated endoints, this allows us to insert an end cap *alone* (without the attached\n // segment and join)\n ").concat(isEndpoints ? "if (dInvalid && mirror) return;" : '', "\n\n // Convert to screen-pixel coordinates\n // Save w so we can perspective re-multiply at the end to get varyings depth-correct\n float pw = mirror ? pC.w : pB.w;\n ").concat(verts.map(function (v) {
return "p".concat(v, " = vec4(vec3(p").concat(v, ".xy * resolution, p").concat(v, ".z) / p").concat(v, ".w, 1);");
Expand Down
Loading

0 comments on commit 81bc016

Please sign in to comment.