normalized
andtype
keys were not respected for attributes, which prevented usage with more granular memory layout.
- Throw an error if missing the
ANGLE_instanced_arrays
extension instead of just rendering incorrectly.
- Includes sort of hacky "instanced" rendering (undocumented). Requires duplicating instanced geometry N times in order to draw N line segments, then sort of draws the first segment of all instances, then the second, etc. So it's not ideal, but it's better than issuing N draw calls. See
examples/instanced.js
.
- Try hot-fixing an issue with VAO setup.
- Adds support for Vertex Array Objects (VAOs). To use, move
vertexAttributes
andendpointAttributes
out of per-frame draw call properties to thedrawLines.vao({vertexAttributes, endpointAttributes})
constructor, then pass the resulting object to the draw call as thevao
property.
- Adds
postproject
pragma to apply an additional transformation to lines after screen-projection. - Adds
viewportSize
render-time option in case you wish to project lines to some other shape than the viewport size. May be used in conjunction withpostproject
, for example to render to the unit square and then view that square from some other angle.
- Moves
insertCaps
from a compile-time to a runtime configuration option. - Lazily instantiates the four potential draw command variations (endpoints vs. interior segments, and insert caps true vs. false).
- Adds
reorder
as a compile-time option. When true (default: true), it internally reorders draw calls for arrays of line props (drawLines([{...}, {...}, ...])
) to avoid repeatedly changing the shader program.
- Reenable NaN to signal line breaks. It seems to work now. Confirm here.
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. 🎉
- Turning an integer index into a position was somewhat badly done. This release completely renumbers all of the indices. Instead of modifying geometry and flipping it in order to get winding order correct, it now shifts vertex indices by one while preserving geometry. At the cost of one extra wasted vertex, this has the effect of flipping winding order when needed in order to make it consistent--but without modifying geometry. The resulting code is easier to follow, shorter, cleaner, and shows better results.
- As a result of renumbering, winding order is now consistent.
- Collapsed triangle vertices are now repeated at the first and last points only, rather than scattered throughout the instances.
- A new live-reloading test page with
npm run serve-render-tests
, accessible online using published module at https://rreusser.github.io/regl-gpu-lines/docs/tests.html
- Fixes badly broken behavior on devices which don't successfully check for NaN in the shader
- Clean up one of the worst parts of the shader code and get end cap insertion working with all combinations of joins and caps. 🎉
- Add optional
extrapolate
keyword, as in#pragma lines: extrapolate varying float name
to distinguish between varyings which are extrapolated outside the bounds of their respective segment endpoint values, and varyings which are clamped to the range of the segment. This can be used to dash caps and joins or to ensure colors are not extrapolated.
- Add
insertCaps
option to be explicit about when caps are automatically inserted
- Switch to preferring
w = 0
instead ofNaN
sinceNaN
detection is a bit unreliable in GLSL.
- Now inserts caps when it encounters NaN. With some remaining API cleanup since miters and bevels don't have enough points per instance to build a proper round.
- Resolve hairpin and collinear cases!! 🎉
- Fix debug instance ID
- Almost a complete rewrite. Consolidated everything into a single shader with two switches (round vs. miter, cap vs. interior).
- Line dashes work with both round and miter
- SDF borders now work with round and miter
- Bundle size down to 11kB minified, 4.5kB gzipped
- Degenerate lines which turn 180 degrees are a regression. They sometimes but not always work. A tiny floating point offset will fix things.
- Completely reworked rounded join geometry to split joins down the middle. This makes dashes usable, currently only with rounded joins.
- Improved handling of z-coordinate
- Improved handling of some corner cases, including self-intersecting lines and short segments
- Added tests
- Convert the index attribute into a unit-grid-aligned coordinate for wireframes. This is equivalent but much easier than exploding the triangle strip geometry into individual triangles.
- Republish after botched 0.0.13 publish
- Fix an issue in which varying parameters were not triggering inclusion of their respective attributes.
- Fix custom attribute divisor not set correctly
- Debugged interleaved attributes. They work great! 🎉
- Rename
isstart
tocapOrientation
and change from a boolean to a float.isstart
seemed unpleasantly asymmetric.CAP_START
andCAP_END
are now exported as constants on thereglLines
function. In the future this may be used as a bit mask to additionally allow signaling two-vertex lines.
- Throw errors when attempting to forward
count
,elements
,attributes
orinstances
to regl.
- Fix inner miters to clip to the lesser of the two adjacent segment lengths
- Remove the minimum-length constraint (was 1/100 pixel) since it sometimes results in missing caps.
- Improved documentation!
- Fix an issue with using nan or w=0 to split lines into multiple segments
Beginning a changelog as the module is starting to stabilize. 🎉
- It's proving extremely common to implement a regl wrapper with customization that falls outside the scope of this module. This release adds the ability to merge that config with the arguments to this module. It now uses the
vert
,frag
, anddebug
options and forward all other configuration to a regl wrapper, invoked on each draw.